37 include_once
'./Services/Xml/classes/class.ilSaxParser.php';
81 $this->md_parsing_enabled =
true;
83 parent::__construct($a_xml_file);
88 $this->md_parsing_enabled = (bool) $a_status;
101 return is_object($this->md) ? $this->md :
false;
117 xml_set_object($a_xml_parser, $this);
118 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
119 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
129 include_once
'Services/Migration/DBUpdate_5295/classes/class.ilMDLanguageItem.php';
137 $this->md_in_md =
true;
142 $this->md_gen = &$this->md->addGeneral();
143 $this->md_gen->setStructure($a_attribs[
'Structure']);
144 $this->md_gen->save();
150 $this->md_ide = &$par->addIdentifier();
151 $this->md_ide->setCatalog($a_attribs[
'Catalog']);
152 $this->md_ide->setEntry($a_attribs[
'Entry']);
153 $this->md_ide->save();
164 $this->md_lan = &$par->addLanguage();
166 $this->md_lan->save();
173 if (strtolower(get_class($par)) ==
'ilmdrights' or 174 strtolower(get_class($par)) ==
'ilmdannotation' or 175 strtolower(get_class($par)) ==
'ilmdclassification') {
179 $this->md_des = &$par->addDescription();
180 $this->md_des->setDescriptionLanguage(
new ilMDLanguageItem($a_attribs[
'Language']));
181 $this->md_des->save();
189 $this->md_key = &$par->addKeyword();
190 $this->md_key->setKeywordLanguage(
new ilMDLanguageItem($a_attribs[
'Language']));
191 $this->md_key->save();
202 $this->md_lif = &$par->addLifecycle();
203 $this->md_lif->setStatus($a_attribs[
'Status']);
204 $this->md_lif->save();
215 $this->md_con = &$par->addContribute();
216 $this->md_con->setRole($a_attribs[
'Role']);
217 $this->md_con->save();
224 if (strtolower(get_class($par)) ==
'ilmdcontribute') {
225 $this->md_ent = &$par->addEntity();
226 $this->md_ent->save();
237 case 'Meta-Metadata':
239 $this->md_met = &$par->addMetaMetadata();
240 $this->md_met->setMetaDataScheme($a_attribs[
'MetadataScheme']);
242 $this->md_met->save();
248 $this->md_tec = &$par->addTechnical();
249 $this->md_tec->save();
255 $this->md_for = &$par->addFormat();
256 $this->md_for->save();
265 $this->md_loc = &$par->addLocation();
266 $this->md_loc->setLocationType($a_attribs[
'Type']);
267 $this->md_loc->save();
273 $this->md_req = &$par->addRequirement();
274 $this->md_req->save();
280 $this->md_orc = &$par->addOrComposite();
287 case 'OperatingSystem':
289 $par->setOperatingSystemName($a_attribs[
'Name']);
290 $par->setOperatingSystemMinimumVersion($a_attribs[
'MinimumVersion']);
291 $par->setOperatingSystemMaximumVersion($a_attribs[
'MaximumVersion']);
296 $par->setBrowserName($a_attribs[
'Name']);
297 $par->setBrowserMinimumVersion($a_attribs[
'MinimumVersion']);
298 $par->setBrowserMaximumVersion($a_attribs[
'MaximumVersion']);
301 case 'InstallationRemarks':
303 $par->setInstallationRemarksLanguage(
new ilMDLanguageItem($a_attribs[
'Language']));
306 case 'OtherPlatformRequirements':
308 $par->setOtherPlatformRequirementsLanguage(
new ilMDLanguageItem($a_attribs[
'Language']));
316 $this->md_edu = &$par->addEducational();
317 $this->md_edu->setInteractivityType($a_attribs[
'InteractivityType']);
318 $this->md_edu->setLearningResourceType($a_attribs[
'LearningResourceType']);
319 $this->md_edu->setInteractivityLevel($a_attribs[
'InteractivityLevel']);
320 $this->md_edu->setSemanticDensity($a_attribs[
'SemanticDensity']);
321 $this->md_edu->setIntendedEndUserRole($a_attribs[
'IntendedEndUserRole']);
322 $this->md_edu->setContext($a_attribs[
'Context']);
323 $this->md_edu->setDifficulty($a_attribs[
'Difficulty']);
324 $this->md_edu->save();
328 case 'TypicalAgeRange':
330 $this->md_typ = &$par->addTypicalAgeRange();
331 $this->md_typ->setTypicalAgeRangeLanguage(
new ilMDLanguageItem($a_attribs[
'Language']));
332 $this->md_typ->save();
336 case 'TypicalLearningTime':
341 $this->md_rig = &$par->addRights();
342 $this->md_rig->setCosts($a_attribs[
'Cost']);
343 $this->md_rig->setCopyrightAndOtherRestrictions($a_attribs[
'CopyrightAndOtherRestrictions']);
344 $this->md_rig->save();
350 $this->md_rel = &$par->addRelation();
351 $this->md_rel->setKind($a_attribs[
'Kind']);
352 $this->md_rel->save();
361 $this->md_ide_ = &$par->addIdentifier_();
362 $this->md_ide_->setCatalog($a_attribs[
'Catalog']);
363 $this->md_ide_->setEntry($a_attribs[
'Entry']);
364 $this->md_ide_->save();
370 $this->md_ann = &$par->addAnnotation();
371 $this->md_ann->save();
375 case 'Classification':
377 $this->md_cla = &$par->addClassification();
378 $this->md_cla->setPurpose($a_attribs[
'Purpose']);
379 $this->md_cla->save();
385 $this->md_taxp = &$par->addTaxonPath();
386 $this->md_taxp->save();
397 $this->md_tax = &$par->addTaxon();
398 $this->md_tax->setTaxonLanguage(
new ilMDLanguageItem($a_attribs[
'Language']));
399 $this->md_tax->setTaxonId($a_attribs[
'Id']);
400 $this->md_tax->save();
417 $this->md_parent = array();
418 $this->md_in_md =
false;
446 if (strtolower(get_class($par)) ==
'ilmddescription') {
490 if (strtolower(get_class($par)) ==
'ilmdentity') {
505 case 'Meta-Metadata':
549 case 'OperatingSystem':
555 case 'InstallationRemarks':
560 case 'OtherPlatformRequirements':
576 case 'TypicalAgeRange':
583 case 'TypicalLearningTime':
615 case 'Classification':
640 $this->md_chr_data =
'';
654 $a_data = preg_replace(
"/\t+/",
" ", $a_data);
656 $this->md_chr_data .= $a_data;
665 return trim($this->md_chr_data);
670 $this->md_parent[] = &$md_obj;
672 foreach ($this->md_parent as $class) {
673 #echo get_class($class).' -> '; 678 $class = array_pop($this->md_parent);
680 #echo '<br />DELETE '.get_class($class); 684 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
static getLogger($a_component_id)
Get component logger.