37 include_once
'./Services/Xml/classes/class.ilSaxParser.php';
72 $this->md_parsing_enabled =
true;
79 $this->md_parsing_enabled = (bool) $a_status;
92 return is_object($this->md) ? $this->md :
false;
108 xml_set_object($a_xml_parser,$this);
109 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
110 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
120 include_once
'Services/MetaData/classes/class.ilMDLanguageItem.php';
130 $this->md_in_md =
true;
135 $this->md_gen =& $this->md->addGeneral();
136 $this->md_gen->setStructure($a_attribs[
'Structure']);
137 $this->md_gen->save();
143 $this->md_ide =& $par->addIdentifier();
144 $this->md_ide->setCatalog($a_attribs[
'Catalog']);
145 $this->md_ide->setEntry($a_attribs[
'Entry']);
146 $this->md_ide->save();
157 $this->md_lan =& $par->addLanguage();
159 $this->md_lan->save();
166 if(strtolower(get_class($par)) ==
'ilmdrights' or
167 strtolower(get_class($par)) ==
'ilmdannotation' or
168 strtolower(get_class($par)) ==
'ilmdclassification')
175 $this->md_des =& $par->addDescription();
176 $this->md_des->setDescriptionLanguage(
new ilMDLanguageItem($a_attribs[
'Language']));
177 $this->md_des->save();
184 $this->md_key =& $par->addKeyword();
185 $this->md_key->setKeywordLanguage(
new ilMDLanguageItem($a_attribs[
'Language']));
186 $this->md_key->save();
197 $this->md_lif =& $par->addLifecycle();
198 $this->md_lif->setStatus($a_attribs[
'Status']);
199 $this->md_lif->save();
210 $this->md_con =& $par->addContribute();
211 $this->md_con->setRole($a_attribs[
'Role']);
212 $this->md_con->save();
219 if(strtolower(get_class($par)) ==
'ilmdcontribute')
221 $this->md_ent =& $par->addEntity();
222 $this->md_ent->save();
234 case 'Meta-Metadata':
236 $this->md_met =& $par->addMetaMetadata();
237 $this->md_met->setMetaDataScheme($a_attribs[
'MetadataScheme']);
239 $this->md_met->save();
245 $this->md_tec =& $par->addTechnical();
246 $this->md_tec->save();
252 $this->md_for =& $par->addFormat();
253 $this->md_for->save();
262 $this->md_loc =& $par->addLocation();
263 $this->md_loc->setLocationType($a_attribs[
'Type']);
264 $this->md_loc->save();
270 $this->md_req =& $par->addRequirement();
271 $this->md_req->save();
277 $this->md_orc =& $par->addOrComposite();
284 case 'OperatingSystem':
286 $par->setOperatingSystemName($a_attribs[
'Name']);
287 $par->setOperatingSystemMinimumVersion($a_attribs[
'MinimumVersion']);
288 $par->setOperatingSystemMaximumVersion($a_attribs[
'MaximumVersion']);
293 $par->setBrowserName($a_attribs[
'Name']);
294 $par->setBrowserMinimumVersion($a_attribs[
'MinimumVersion']);
295 $par->setBrowserMaximumVersion($a_attribs[
'MaximumVersion']);
298 case 'InstallationRemarks':
300 $par->setInstallationRemarksLanguage(
new ilMDLanguageItem($a_attribs[
'Language']));
303 case 'OtherPlatformRequirements':
305 $par->setOtherPlatformRequirementsLanguage(
new ilMDLanguageItem($a_attribs[
'Language']));
313 $this->md_edu =& $par->addEducational();
314 $this->md_edu->setInteractivityType($a_attribs[
'InteractivityType']);
315 $this->md_edu->setLearningResourceType($a_attribs[
'LearningResourceType']);
316 $this->md_edu->setInteractivityLevel($a_attribs[
'InteractivityLevel']);
317 $this->md_edu->setSemanticDensity($a_attribs[
'SemanticDensity']);
318 $this->md_edu->setIntendedEndUserRole($a_attribs[
'IntendedEndUserRole']);
319 $this->md_edu->setContext($a_attribs[
'Context']);
320 $this->md_edu->setDifficulty($a_attribs[
'Difficulty']);
321 $this->md_edu->save();
325 case 'TypicalAgeRange':
327 $this->md_typ =& $par->addTypicalAgeRange();
328 $this->md_typ->setTypicalAgeRangeLanguage(
new ilMDLanguageItem($a_attribs[
'Language']));
329 $this->md_typ->save();
333 case 'TypicalLearningTime':
338 $this->md_rig =& $par->addRights();
339 $this->md_rig->setCosts($a_attribs[
'Cost']);
340 $this->md_rig->setCopyrightAndOtherRestrictions($a_attribs[
'CopyrightAndOtherRestrictions']);
341 $this->md_rig->save();
347 $this->md_rel =& $par->addRelation();
348 $this->md_rel->setKind($a_attribs[
'Kind']);
349 $this->md_rel->save();
358 $this->md_ide_ =& $par->addIdentifier_();
359 $this->md_ide_->setCatalog($a_attribs[
'Catalog']);
360 $this->md_ide_->setEntry($a_attribs[
'Entry']);
361 $this->md_ide_->save();
367 $this->md_ann =& $par->addAnnotation();
368 $this->md_ann->save();
372 case 'Classification':
374 $this->md_cla =& $par->addClassification();
375 $this->md_cla->setPurpose($a_attribs[
'Purpose']);
376 $this->md_cla->save();
382 $this->md_taxp =& $par->addTaxonPath();
383 $this->md_taxp->save();
394 $this->md_tax =& $par->addTaxon();
395 $this->md_tax->setTaxonLanguage(
new ilMDLanguageItem($a_attribs[
'Language']));
396 $this->md_tax->setTaxonId($a_attribs[
'Id']);
397 $this->md_tax->save();
416 $this->md_parent = array();
417 $this->md_in_md =
false;
445 if(strtolower(get_class($par)) ==
'ilmddescription')
490 if(strtolower(get_class($par)) ==
'ilmdentity')
508 case 'Meta-Metadata':
552 case 'OperatingSystem':
558 case 'InstallationRemarks':
563 case 'OtherPlatformRequirements':
579 case 'TypicalAgeRange':
586 case 'TypicalLearningTime':
618 case 'Classification':
643 $this->md_chr_data =
'';
659 $a_data = preg_replace(
"/\t+/",
" ",$a_data);
661 $this->md_chr_data .= $a_data;
670 return trim($this->md_chr_data);
675 $this->md_parent[] =& $md_obj;
677 foreach($this->md_parent as $class)
679 #echo get_class($class).' -> ';
684 $class = array_pop($this->md_parent);
686 #echo '<br />DELETE '.get_class($class);
690 return $this->md_parent[count($this->md_parent) - 1];