37 include_once
'./Services/Xml/classes/class.ilSaxParser.php';
78 $this->md_parsing_enabled =
true;
80 parent::__construct($a_xml_file);
85 $this->md_parsing_enabled = (bool) $a_status;
98 return is_object($this->md) ? $this->md :
false;
114 xml_set_object($a_xml_parser,$this);
115 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
116 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
126 include_once
'Services/MetaData/classes/class.ilMDLanguageItem.php';
136 $this->md_in_md =
true;
141 $this->md_gen =& $this->md->addGeneral();
142 $this->md_gen->setStructure($a_attribs[
'Structure']);
143 $this->md_gen->save();
149 $this->md_ide =& $par->addIdentifier();
150 $this->md_ide->setCatalog($a_attribs[
'Catalog']);
151 $this->md_ide->setEntry($a_attribs[
'Entry']);
152 $this->md_ide->save();
163 $this->md_lan =& $par->addLanguage();
165 $this->md_lan->save();
172 if(strtolower(get_class($par)) ==
'ilmdrights' or 173 strtolower(get_class($par)) ==
'ilmdannotation' or 174 strtolower(get_class($par)) ==
'ilmdclassification')
181 $this->md_des =& $par->addDescription();
182 $this->md_des->setDescriptionLanguage(
new ilMDLanguageItem($a_attribs[
'Language']));
183 $this->md_des->save();
190 $this->md_key =& $par->addKeyword();
191 $this->md_key->setKeywordLanguage(
new ilMDLanguageItem($a_attribs[
'Language']));
192 $this->md_key->save();
203 $this->md_lif =& $par->addLifecycle();
204 $this->md_lif->setStatus($a_attribs[
'Status']);
205 $this->md_lif->save();
216 $this->md_con =& $par->addContribute();
217 $this->md_con->setRole($a_attribs[
'Role']);
218 $this->md_con->save();
225 if(strtolower(get_class($par)) ==
'ilmdcontribute')
227 $this->md_ent =& $par->addEntity();
228 $this->md_ent->save();
240 case 'Meta-Metadata':
242 $this->md_met =& $par->addMetaMetadata();
243 $this->md_met->setMetaDataScheme($a_attribs[
'MetadataScheme']);
245 $this->md_met->save();
251 $this->md_tec =& $par->addTechnical();
252 $this->md_tec->save();
258 $this->md_for =& $par->addFormat();
259 $this->md_for->save();
268 $this->md_loc =& $par->addLocation();
269 $this->md_loc->setLocationType($a_attribs[
'Type']);
270 $this->md_loc->save();
276 $this->md_req =& $par->addRequirement();
277 $this->md_req->save();
283 $this->md_orc =& $par->addOrComposite();
290 case 'OperatingSystem':
292 $par->setOperatingSystemName($a_attribs[
'Name']);
293 $par->setOperatingSystemMinimumVersion($a_attribs[
'MinimumVersion']);
294 $par->setOperatingSystemMaximumVersion($a_attribs[
'MaximumVersion']);
299 $par->setBrowserName($a_attribs[
'Name']);
300 $par->setBrowserMinimumVersion($a_attribs[
'MinimumVersion']);
301 $par->setBrowserMaximumVersion($a_attribs[
'MaximumVersion']);
304 case 'InstallationRemarks':
306 $par->setInstallationRemarksLanguage(
new ilMDLanguageItem($a_attribs[
'Language']));
309 case 'OtherPlatformRequirements':
311 $par->setOtherPlatformRequirementsLanguage(
new ilMDLanguageItem($a_attribs[
'Language']));
319 $this->md_edu =& $par->addEducational();
320 $this->md_edu->setInteractivityType($a_attribs[
'InteractivityType']);
321 $this->md_edu->setLearningResourceType($a_attribs[
'LearningResourceType']);
322 $this->md_edu->setInteractivityLevel($a_attribs[
'InteractivityLevel']);
323 $this->md_edu->setSemanticDensity($a_attribs[
'SemanticDensity']);
324 $this->md_edu->setIntendedEndUserRole($a_attribs[
'IntendedEndUserRole']);
325 $this->md_edu->setContext($a_attribs[
'Context']);
326 $this->md_edu->setDifficulty($a_attribs[
'Difficulty']);
327 $this->md_edu->save();
331 case 'TypicalAgeRange':
333 $this->md_typ =& $par->addTypicalAgeRange();
334 $this->md_typ->setTypicalAgeRangeLanguage(
new ilMDLanguageItem($a_attribs[
'Language']));
335 $this->md_typ->save();
339 case 'TypicalLearningTime':
344 $this->md_rig =& $par->addRights();
345 $this->md_rig->setCosts($a_attribs[
'Cost']);
346 $this->md_rig->setCopyrightAndOtherRestrictions($a_attribs[
'CopyrightAndOtherRestrictions']);
347 $this->md_rig->save();
353 $this->md_rel =& $par->addRelation();
354 $this->md_rel->setKind($a_attribs[
'Kind']);
355 $this->md_rel->save();
364 $this->md_ide_ =& $par->addIdentifier_();
365 $this->md_ide_->setCatalog($a_attribs[
'Catalog']);
366 $this->md_ide_->setEntry($a_attribs[
'Entry']);
367 $this->md_ide_->save();
373 $this->md_ann =& $par->addAnnotation();
374 $this->md_ann->save();
378 case 'Classification':
380 $this->md_cla =& $par->addClassification();
381 $this->md_cla->setPurpose($a_attribs[
'Purpose']);
382 $this->md_cla->save();
388 $this->md_taxp =& $par->addTaxonPath();
389 $this->md_taxp->save();
400 $this->md_tax =& $par->addTaxon();
401 $this->md_tax->setTaxonLanguage(
new ilMDLanguageItem($a_attribs[
'Language']));
402 $this->md_tax->setTaxonId($a_attribs[
'Id']);
403 $this->md_tax->save();
422 $this->md_parent =
array();
423 $this->md_in_md =
false;
451 if(strtolower(get_class($par)) ==
'ilmddescription')
497 if(strtolower(get_class($par)) ==
'ilmdentity')
515 case 'Meta-Metadata':
559 case 'OperatingSystem':
565 case 'InstallationRemarks':
570 case 'OtherPlatformRequirements':
586 case 'TypicalAgeRange':
593 case 'TypicalLearningTime':
625 case 'Classification':
650 $this->md_chr_data =
'';
666 $a_data = preg_replace(
"/\t+/",
" ",$a_data);
668 $this->md_chr_data .= $a_data;
677 return trim($this->md_chr_data);
682 $this->md_parent[] =& $md_obj;
684 foreach($this->md_parent as $class)
686 #echo get_class($class).' -> '; 691 $class = array_pop($this->md_parent);
693 #echo '<br />DELETE '.get_class($class); 697 return $this->md_parent[count($this->md_parent) - 1];
__construct($a_xml_file='')
Constructor.
enableMDParsing($a_status)
handlerCharacterData($a_xml_parser, $a_data)
handler for character data
setHandlers($a_xml_parser)
set event handlers
Base class for sax-based expat parsing extended classes need to overwrite the method setHandlers and ...
handlerEndTag($a_xml_parser, $a_name)
handler for end of element
handlerBeginTag($a_xml_parser, $a_name, $a_attribs)
handler for begin of element
Create styles array
The data for the language used.
static getLogger($a_component_id)
Get component logger.