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';
134 $this->md_in_md =
true;
139 $this->md_gen =&$this->md->addGeneral();
140 $this->md_gen->setStructure($a_attribs[
'Structure']);
141 $this->md_gen->save();
147 $this->md_ide =&$par->addIdentifier();
148 $this->md_ide->setCatalog($a_attribs[
'Catalog']);
149 $this->md_ide->setEntry($a_attribs[
'Entry']);
150 $this->md_ide->save();
161 $this->md_lan =&$par->addLanguage();
163 $this->md_lan->save();
170 if (strtolower(get_class($par)) ==
'ilmdrights' or
171 strtolower(get_class($par)) ==
'ilmdannotation' or
172 strtolower(get_class($par)) ==
'ilmdclassification') {
176 $this->md_des =&$par->addDescription();
177 $this->md_des->setDescriptionLanguage(
new ilMDLanguageItem($a_attribs[
'Language']));
178 $this->md_des->save();
186 $this->md_key =&$par->addKeyword();
187 $this->md_key->setKeywordLanguage(
new ilMDLanguageItem($a_attribs[
'Language']));
188 $this->md_key->save();
199 $this->md_lif =&$par->addLifecycle();
200 $this->md_lif->setStatus($a_attribs[
'Status']);
201 $this->md_lif->save();
212 $this->md_con =&$par->addContribute();
213 $this->md_con->setRole($a_attribs[
'Role']);
214 $this->md_con->save();
221 if (strtolower(get_class($par)) ==
'ilmdcontribute') {
222 $this->md_ent =&$par->addEntity();
223 $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();
414 $this->md_parent =
array();
415 $this->md_in_md =
false;
443 if (strtolower(get_class($par)) ==
'ilmddescription') {
487 if (strtolower(get_class($par)) ==
'ilmdentity') {
502 case 'Meta-Metadata':
546 case 'OperatingSystem':
552 case 'InstallationRemarks':
557 case 'OtherPlatformRequirements':
573 case 'TypicalAgeRange':
580 case 'TypicalLearningTime':
612 case 'Classification':
637 $this->md_chr_data =
'';
649 if ($this->
inMetaData() and $a_data !=
"\n") {
651 $a_data = preg_replace(
"/\t+/",
" ", $a_data);
653 $this->md_chr_data .= $a_data;
662 return trim($this->md_chr_data);
667 $this->md_parent[] =&$md_obj;
669 foreach ($this->md_parent as $class) {
670 #echo get_class($class).' -> '; 675 $class = array_pop($this->md_parent);
676 $this->meta_log->debug(is_object($class) ? get_class($class) :
'null');
681 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.