37 include_once
'classes/class.ilSaxParser.php';
85 include_once
'Services/Migration/DBUpdate_426/classes/class.ilMDLanguageItem.php';
90 $this->md_in_md =
true;
95 $this->md_gen =& $this->md->addGeneral();
96 $this->md_gen->setStructure($a_attribs[
'Structure']);
97 $this->md_gen->save();
103 $this->md_ide =& $par->addIdentifier();
104 $this->md_ide->setCatalog($a_attribs[
'Catalog']);
105 $this->md_ide->setEntry($a_attribs[
'Entry']);
106 $this->md_ide->save();
117 $this->md_lan =& $par->addLanguage();
119 $this->md_lan->save();
126 if(strtolower(get_class($par)) ==
'ilmdrights' or
127 strtolower(get_class($par)) ==
'ilmdannotation' or
128 strtolower(get_class($par)) ==
'ilmdclassification')
135 $this->md_des =& $par->addDescription();
136 $this->md_des->setDescriptionLanguage(
new ilMDLanguageItem($a_attribs[
'Language']));
137 $this->md_des->save();
144 $this->md_key =& $par->addKeyword();
145 $this->md_key->setKeywordLanguage(
new ilMDLanguageItem($a_attribs[
'Language']));
146 $this->md_key->save();
157 $this->md_lif =& $par->addLifecycle();
158 $this->md_lif->setStatus($a_attribs[
'Status']);
159 $this->md_lif->save();
170 $this->md_con =& $par->addContribute();
171 $this->md_con->setRole($a_attribs[
'Role']);
172 $this->md_con->save();
179 if(strtolower(get_class($par)) ==
'ilmdcontribute')
181 $this->md_ent =& $par->addEntity();
182 $this->md_ent->save();
194 case 'Meta-Metadata':
196 $this->md_met =& $par->addMetaMetadata();
197 $this->md_met->setMetaDataScheme($a_attribs[
'MetadataScheme']);
199 $this->md_met->save();
205 $this->md_tec =& $par->addTechnical();
206 $this->md_tec->save();
212 $this->md_for =& $par->addFormat();
213 $this->md_for->save();
222 $this->md_loc =& $par->addLocation();
223 $this->md_loc->setLocationType($a_attribs[
'Type']);
224 $this->md_loc->save();
230 $this->md_req =& $par->addRequirement();
231 $this->md_req->save();
237 $this->md_orc =& $par->addOrComposite();
244 case 'OperatingSystem':
246 $par->setOperatingSystemName($a_attribs[
'Name']);
247 $par->setOperatingSystemMinimumVersion($a_attribs[
'MinimumVersion']);
248 $par->setOperatingSystemMaximumVersion($a_attribs[
'MaximumVersion']);
253 $par->setBrowserName($a_attribs[
'Name']);
254 $par->setBrowserMinimumVersion($a_attribs[
'MinimumVersion']);
255 $par->setBrowserMaximumVersion($a_attribs[
'MaximumVersion']);
258 case 'InstallationRemarks':
260 $par->setInstallationRemarksLanguage(
new ilMDLanguageItem($a_attribs[
'Language']));
263 case 'OtherPlatformRequirements':
265 $par->setOtherPlatformRequirementsLanguage(
new ilMDLanguageItem($a_attribs[
'Language']));
273 $this->md_edu =& $par->addEducational();
274 $this->md_edu->setInteractivityType($a_attribs[
'InteractivityType']);
275 $this->md_edu->setLearningResourceType($a_attribs[
'LearningResourceType']);
276 $this->md_edu->setInteractivityLevel($a_attribs[
'InteractivityLevel']);
277 $this->md_edu->setSemanticDensity($a_attribs[
'SemanticDensity']);
278 $this->md_edu->setIntendedEndUserRole($a_attribs[
'IntendedEndUserRole']);
279 $this->md_edu->setContext($a_attribs[
'Context']);
280 $this->md_edu->setDifficulty($a_attribs[
'Difficulty']);
281 $this->md_edu->save();
285 case 'TypicalAgeRange':
287 $this->md_typ =& $par->addTypicalAgeRange();
288 $this->md_typ->setTypicalAgeRangeLanguage(
new ilMDLanguageItem($a_attribs[
'Language']));
289 $this->md_typ->save();
293 case 'TypicalLearningTime':
298 $this->md_rig =& $par->addRights();
299 $this->md_rig->setCosts($a_attribs[
'Costs']);
300 $this->md_rig->setCopyrightAndOtherRestrictions($a_attribs[
'CopyrightAndOtherRestrictions']);
301 $this->md_rig->save();
307 $this->md_rel =& $par->addRelation();
308 $this->md_rel->setKind($a_attribs[
'Kind']);
309 $this->md_rel->save();
318 $this->md_ide_ =& $par->addIdentifier_();
319 $this->md_ide_->setCatalog($a_attribs[
'Catalog']);
320 $this->md_ide_->setEntry($a_attribs[
'Entry']);
321 $this->md_ide_->save();
327 $this->md_ann =& $par->addAnnotation();
328 $this->md_ann->save();
332 case 'Classification':
334 $this->md_cla =& $par->addClassification();
335 $this->md_cla->setPurpose($a_attribs[
'Purpose']);
336 $this->md_cla->save();
342 $this->md_taxp =& $par->addTaxonPath();
343 $this->md_taxp->save();
354 $this->md_tax =& $par->addTaxon();
355 $this->md_tax->setTaxonLanguage(
new ilMDLanguageItem($a_attribs[
'Language']));
356 $this->md_tax->setTaxonId($a_attribs[
'Id']);
357 $this->md_tax->save();
371 $this->md_parent = array();
372 $this->md_in_md =
false;
400 if(strtolower(get_class($par)) ==
'ilmddescription')
445 if(strtolower(get_class($par)) ==
'ilmdentity')
463 case 'Meta-Metadata':
507 case 'OperatingSystem':
513 case 'InstallationRemarks':
518 case 'OtherPlatformRequirements':
534 case 'TypicalAgeRange':
541 case 'TypicalLearningTime':
573 case 'Classification':
598 $this->md_chr_data =
'';
609 $a_data = preg_replace(
"/\t+/",
" ",$a_data);
611 $this->md_chr_data .= $a_data;
620 return trim($this->md_chr_data);
625 $this->md_parent[] =& $md_obj;
627 foreach($this->md_parent as $class)
629 #echo get_class($class).' -> ';
634 $class =& array_pop($this->md_parent);
636 #echo '<br />Popped '.get_class($class);
640 return $this->md_parent[count($this->md_parent) - 1];