ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilMDSaxParser Class Reference
+ Inheritance diagram for ilMDSaxParser:
+ Collaboration diagram for ilMDSaxParser:

Public Member Functions

 __construct ($a_xml_file='')
 Constructor. More...
 
 enableMDParsing ($a_status)
 
 getMDParsingStatus ()
 
 setMDObject (&$md)
 
getMDObject ()
 
 inMetaData ()
 
 setHandlers ($a_xml_parser)
 set event handlers More...
 
 handlerBeginTag ($a_xml_parser, $a_name, $a_attribs)
 handler for begin of element More...
 
 handlerEndTag ($a_xml_parser, $a_name)
 handler for end of element More...
 
 handlerCharacterData ($a_xml_parser, $a_data)
 handler for character data More...
 
 __getCharacterData ()
 
 __pushParent (&$md_obj)
 
 __popParent ()
 
 __getParent ()
 
 __construct ($a_xml_file='')
 Constructor. More...
 
 setMDObject (&$md)
 
 inMetaData ()
 
 handlerBeginTag ($a_xml_parser, $a_name, $a_attribs)
 handler for begin of element More...
 
 handlerEndTag ($a_xml_parser, $a_name)
 handler for end of element More...
 
 handlerCharacterData ($a_xml_parser, $a_data)
 handler for character data More...
 
 __getCharacterData ()
 
 __pushParent (&$md_obj)
 
__popParent ()
 
__getParent ()
 
 __construct ($a_xml_file='')
 Constructor. More...
 
 enableMDParsing ($a_status)
 
 getMDParsingStatus ()
 
 setMDObject (&$md)
 
getMDObject ()
 
 inMetaData ()
 
 setHandlers ($a_xml_parser)
 set event handlers More...
 
 handlerBeginTag ($a_xml_parser, $a_name, $a_attribs)
 handler for begin of element More...
 
 handlerEndTag ($a_xml_parser, $a_name)
 handler for end of element More...
 
 handlerCharacterData ($a_xml_parser, $a_data)
 handler for character data More...
 
 __getCharacterData ()
 
 __pushParent (&$md_obj)
 
__popParent ()
 
__getParent ()
 
- Public Member Functions inherited from ilSaxParser
 __construct ($a_xml_file='', $throwException=false)
 Constructor setup ILIAS global object public. More...
 
 setXMLContent ($a_xml_content)
 
 getXMLContent ()
 
 getInputType ()
 
 startParsing ()
 stores xml data in array More...
 
 createParser ()
 create parser More...
 
 setOptions ($a_xml_parser)
 set parser options More...
 
 setHandlers ($a_xml_parser)
 set event handler should be overwritten by inherited class private More...
 
 openXMLFile ()
 open xml file More...
 
 parse ($a_xml_parser, $a_fp=null)
 parse xml file More...
 
 freeParser ($a_xml_parser)
 free xml parser handle More...
 
 setThrowException ($throwException)
 set error handling More...
 
- Public Member Functions inherited from PEAR
 __construct ($error_class=null)
 Constructor. More...
 
 _PEAR ()
 Destructor (the emulated type of...). More...
 
 registerShutdownFunc ($func, $args=array())
 Use this function to register a shutdown method for static classes. More...
 
 isError ($data, $code=null)
 Tell whether a value is a PEAR error. More...
 
 expectError ($code=' *')
 This method is used to tell which errors you expect to get. More...
 
 popExpect ()
 This method pops one element off the expected error codes stack. More...
 
 _checkDelExpect ($error_code)
 This method checks unsets an error code if available. More...
 
 delExpect ($error_code)
 This method deletes all occurences of the specified element from the expected error codes stack. More...
 
raiseError ($message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false)
 This method is a wrapper that returns an instance of the configured error class with this object's default error handling applied. More...
 
throwError ($message=null, $code=null, $userinfo=null)
 Simpler form of raiseError with fewer options. More...
 
 staticPushErrorHandling ($mode, $options=null)
 
 staticPopErrorHandling ()
 
 pushErrorHandling ($mode, $options=null)
 Push a new error handler on top of the error handler options stack. More...
 
 popErrorHandling ()
 Pop the last error handler used. More...
 
 loadExtension ($ext)
 OS independant PHP extension load. More...
 

Data Fields

 $md_in_md = false
 
 $md_chr_data = ''
 
 $md_cur_el = null
 
 $md_parsing_enabled = null
 
 $md = null
 
 $md_gen
 
- Data Fields inherited from ilSaxParser
 $input_type = null
 
 $xml_content = ''
 
 $ilias
 
 $lng
 
 $xml_file
 
 $throwException = false
 
- Data Fields inherited from PEAR
 $_debug = false
 
 $_default_error_mode = null
 
 $_default_error_options = null
 
 $_default_error_handler = ''
 
 $_error_class = 'PEAR_Error'
 
 $_expected_errors = array()
 

Protected Attributes

 $meta_log
 

Additional Inherited Members

- Static Public Member Functions inherited from PEAR
static & getStaticProperty ($class, $var)
 If you have a class that's mostly/entirely static, and you need static properties, you can use this method to simulate them. More...
 
static setErrorHandling ($mode=null, $options=null)
 Sets how errors generated by this object should be handled. More...
 
- Protected Member Functions inherited from ilSaxParser
 handleError ($message, $code)
 use given error handler to handle error message or internal ilias error message handle More...
 

Detailed Description

Definition at line 34 of file class.ilMDSaxParser.php.

Constructor & Destructor Documentation

◆ __construct() [1/3]

ilMDSaxParser::__construct (   $a_xml_file = '')

Constructor.

public

Definition at line 65 of file class.ilMDSaxParser.php.

References $DIC, ilSaxParser\$lng, and $tree.

66  {
67  global $DIC;
68 
69  $lng = $DIC['lng'];
70  $tree = $DIC['tree'];
71 
72  $this->meta_log = $DIC->logger()->meta();
73 
74 
75  // Enable parsing. E.g qpl' s will set this value to false
76  $this->md_parsing_enabled = true;
77 
78  parent::__construct($a_xml_file);
79  }
global $DIC
Definition: saml.php:7

◆ __construct() [2/3]

ilMDSaxParser::__construct (   $a_xml_file = '')

Constructor.

public

Definition at line 62 of file class.ilMDSaxParser.php.

References ilSaxParser\$lng, and $tree.

63  {
64  global $lng, $tree;
65 
66  parent::__construct($a_xml_file);
67  }

◆ __construct() [3/3]

ilMDSaxParser::__construct (   $a_xml_file = '')

Constructor.

public

Definition at line 70 of file class.ilMDSaxParser.php.

References $DIC, ilSaxParser\$lng, $tree, and ilLoggerFactory\getLogger().

71  {
72  global $DIC;
73 
74  $lng = $DIC['lng'];
75  $tree = $DIC['tree'];
76 
77  $this->meta_log = ilLoggerFactory::getLogger("meta");
78 
79 
80  // Enable parsing. E.g qpl' s will set this value to false
81  $this->md_parsing_enabled = true;
82 
83  parent::__construct($a_xml_file);
84  }
global $DIC
Definition: saml.php:7
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:

Member Function Documentation

◆ __getCharacterData() [1/3]

ilMDSaxParser::__getCharacterData ( )

Definition at line 606 of file class.ilMDSaxParser.php.

607  {
608  return trim($this->md_chr_data);
609  }

◆ __getCharacterData() [2/3]

ilMDSaxParser::__getCharacterData ( )

Definition at line 663 of file class.ilMDSaxParser.php.

664  {
665  return trim($this->md_chr_data);
666  }

◆ __getCharacterData() [3/3]

ilMDSaxParser::__getCharacterData ( )

Definition at line 664 of file class.ilMDSaxParser.php.

Referenced by handlerEndTag(), and ilSCORM13MDImporter\handlerEndTag().

665  {
666  return trim($this->md_chr_data);
667  }
+ Here is the caller graph for this function:

◆ __getParent() [1/3]

& ilMDSaxParser::__getParent ( )

Definition at line 625 of file class.ilMDSaxParser.php.

626  {
627  return $this->md_parent[count($this->md_parent) - 1];
628  }

◆ __getParent() [2/3]

& ilMDSaxParser::__getParent ( )

Definition at line 682 of file class.ilMDSaxParser.php.

683  {
684  return $this->md_parent[count($this->md_parent) - 1];
685  }

◆ __getParent() [3/3]

ilMDSaxParser::__getParent ( )

Definition at line 687 of file class.ilMDSaxParser.php.

Referenced by ilMDXMLCopier\handlerBeginTag(), ilSCORM13MDImporter\handlerBeginTag(), handlerBeginTag(), ilMDXMLCopier\handlerEndTag(), handlerEndTag(), and ilSCORM13MDImporter\handlerEndTag().

688  {
689  return $this->md_parent[count($this->md_parent) - 1];
690  }
+ Here is the caller graph for this function:

◆ __popParent() [1/3]

& ilMDSaxParser::__popParent ( )

Definition at line 619 of file class.ilMDSaxParser.php.

620  {
621  $class = &array_pop($this->md_parent);
622  unset($class);
623  #echo '<br />Popped '.get_class($class);
624  }

◆ __popParent() [2/3]

& ilMDSaxParser::__popParent ( )

Definition at line 676 of file class.ilMDSaxParser.php.

677  {
678  $class = array_pop($this->md_parent);
679  unset($class);
680  #echo '<br />DELETE '.get_class($class);
681  }

◆ __popParent() [3/3]

ilMDSaxParser::__popParent ( )

Definition at line 677 of file class.ilMDSaxParser.php.

Referenced by ilMDXMLCopier\handlerEndTag(), handlerEndTag(), and ilSCORM13MDImporter\handlerEndTag().

678  {
679  $this->meta_log->debug('New parent stack (pop)....');
680  $class = array_pop($this->md_parent);
681  foreach ((array) $this->md_parent as $class) {
682  $this->meta_log->debug(get_class($class));
683  }
684  $this->meta_log->debug(is_object($class) ? get_class($class) : 'null');
685  unset($class);
686  }
+ Here is the caller graph for this function:

◆ __pushParent() [1/3]

ilMDSaxParser::__pushParent ( $md_obj)

Definition at line 611 of file class.ilMDSaxParser.php.

612  {
613  $this->md_parent[] = &$md_obj;
614  #echo '<br />';
615  foreach ($this->md_parent as $class) {
616  #echo get_class($class).' -> ';
617  }
618  }

◆ __pushParent() [2/3]

ilMDSaxParser::__pushParent ( $md_obj)

Definition at line 668 of file class.ilMDSaxParser.php.

669  {
670  $this->md_parent[] = &$md_obj;
671  #echo '<br />';
672  foreach ($this->md_parent as $class) {
673  #echo get_class($class).' -> ';
674  }
675  }

◆ __pushParent() [3/3]

ilMDSaxParser::__pushParent ( $md_obj)

Definition at line 669 of file class.ilMDSaxParser.php.

Referenced by ilMDXMLCopier\handlerBeginTag(), ilSCORM13MDImporter\handlerBeginTag(), and handlerBeginTag().

670  {
671  $this->md_parent[] = &$md_obj;
672  $this->meta_log->debug('New parent stack (push)...');
673  foreach ($this->md_parent as $class) {
674  $this->meta_log->debug(get_class($class));
675  }
676  }
+ Here is the caller graph for this function:

◆ enableMDParsing() [1/2]

ilMDSaxParser::enableMDParsing (   $a_status)

Definition at line 81 of file class.ilMDSaxParser.php.

Referenced by ilContObjParser\handlerBeginTag(), and ilContObjParser\handlerEndTag().

82  {
83  $this->md_parsing_enabled = (bool) $a_status;
84  }
+ Here is the caller graph for this function:

◆ enableMDParsing() [2/2]

ilMDSaxParser::enableMDParsing (   $a_status)

Definition at line 86 of file class.ilMDSaxParser.php.

87  {
88  $this->md_parsing_enabled = (bool) $a_status;
89  }

◆ getMDObject() [1/2]

& ilMDSaxParser::getMDObject ( )

Definition at line 94 of file class.ilMDSaxParser.php.

Referenced by ilSCORM13MDImporter\import().

95  {
96  return is_object($this->md) ? $this->md : false;
97  }
+ Here is the caller graph for this function:

◆ getMDObject() [2/2]

& ilMDSaxParser::getMDObject ( )

Definition at line 99 of file class.ilMDSaxParser.php.

100  {
101  return is_object($this->md) ? $this->md : false;
102  }

◆ getMDParsingStatus() [1/2]

ilMDSaxParser::getMDParsingStatus ( )

Definition at line 85 of file class.ilMDSaxParser.php.

References $md_parsing_enabled.

Referenced by ilSCORM13MDImporter\handlerBeginTag(), handlerBeginTag(), handlerCharacterData(), handlerEndTag(), and ilSCORM13MDImporter\handlerEndTag().

86  {
87  return (bool) $this->md_parsing_enabled;
88  }
+ Here is the caller graph for this function:

◆ getMDParsingStatus() [2/2]

ilMDSaxParser::getMDParsingStatus ( )

Definition at line 90 of file class.ilMDSaxParser.php.

References $md_parsing_enabled.

91  {
92  return (bool) $this->md_parsing_enabled;
93  }

◆ handlerBeginTag() [1/3]

ilMDSaxParser::handlerBeginTag (   $a_xml_parser,
  $a_name,
  $a_attribs 
)

handler for begin of element

Definition at line 83 of file class.ilMDSaxParser.php.

References __getParent(), and __pushParent().

84  {
85  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguageItem.php';
86 
87  switch ($a_name) {
88  case 'MetaData':
89  $this->md_in_md = true;
90  $this->__pushParent($this->md);
91  break;
92 
93  case 'General':
94  $this->md_gen = &$this->md->addGeneral();
95  $this->md_gen->setStructure($a_attribs['Structure']);
96  $this->md_gen->save();
97  $this->__pushParent($this->md_gen);
98  break;
99 
100  case 'Identifier':
101  $par = &$this->__getParent();
102  $this->md_ide = &$par->addIdentifier();
103  $this->md_ide->setCatalog($a_attribs['Catalog']);
104  $this->md_ide->setEntry($a_attribs['Entry']);
105  $this->md_ide->save();
106  $this->__pushParent($this->md_ide);
107  break;
108 
109  case 'Title':
110  $par = &$this->__getParent();
111  $par->setTitleLanguage(new ilMDLanguageItem($a_attribs['Language']));
112  break;
113 
114  case 'Language':
115  $par = &$this->__getParent();
116  $this->md_lan = &$par->addLanguage();
117  $this->md_lan->setLanguage(new ilMDLanguageItem($a_attribs['Language']));
118  $this->md_lan->save();
119  $this->__pushParent($this->md_lan);
120  break;
121 
122  case 'Description':
123  $par = &$this->__getParent();
124 
125  if (strtolower(get_class($par)) == 'ilmdrights' or
126  strtolower(get_class($par)) == 'ilmdannotation' or
127  strtolower(get_class($par)) == 'ilmdclassification') {
128  $par->setDescriptionLanguage(new ilMDLanguageItem($a_attribs['Language']));
129  break;
130  } else {
131  $this->md_des = &$par->addDescription();
132  $this->md_des->setDescriptionLanguage(new ilMDLanguageItem($a_attribs['Language']));
133  $this->md_des->save();
134  $this->__pushParent($this->md_des);
135  break;
136  }
137 
138  // no break
139  case 'Keyword':
140  $par = &$this->__getParent();
141  $this->md_key = &$par->addKeyword();
142  $this->md_key->setKeywordLanguage(new ilMDLanguageItem($a_attribs['Language']));
143  $this->md_key->save();
144  $this->__pushParent($this->md_key);
145  break;
146 
147  case 'Coverage':
148  $par = &$this->__getParent();
149  $par->setCoverageLanguage(new ilMDLanguageItem($a_attribs['Language']));
150  break;
151 
152  case 'Lifecycle':
153  $par = &$this->__getParent();
154  $this->md_lif = &$par->addLifecycle();
155  $this->md_lif->setStatus($a_attribs['Status']);
156  $this->md_lif->save();
157  $this->__pushParent($this->md_lif);
158  break;
159 
160  case 'Version':
161  $par = &$this->__getParent();
162  $par->setVersionLanguage(new ilMDLanguageItem($a_attribs['Language']));
163  break;
164 
165  case 'Contribute':
166  $par = &$this->__getParent();
167  $this->md_con = &$par->addContribute();
168  $this->md_con->setRole($a_attribs['Role']);
169  $this->md_con->save();
170  $this->__pushParent($this->md_con);
171  break;
172 
173  case 'Entity':
174  $par = &$this->__getParent();
175 
176  if (strtolower(get_class($par)) == 'ilmdcontribute') {
177  $this->md_ent = &$par->addEntity();
178  $this->md_ent->save();
179  $this->__pushParent($this->md_ent);
180  break;
181  } else {
182  // single element in 'Annotation'
183  break;
184  }
185  // no break
186  case 'Date':
187  break;
188 
189  case 'Meta-Metadata':
190  $par = &$this->__getParent();
191  $this->md_met = &$par->addMetaMetadata();
192  $this->md_met->setMetaDataScheme($a_attribs['MetadataScheme']);
193  $this->md_met->setLanguage(new ilMDLanguageItem($a_attribs['Language']));
194  $this->md_met->save();
195  $this->__pushParent($this->md_met);
196  break;
197 
198  case 'Technical':
199  $par = &$this->__getParent();
200  $this->md_tec = &$par->addTechnical();
201  $this->md_tec->save();
202  $this->__pushParent($this->md_tec);
203  break;
204 
205  case 'Format':
206  $par = &$this->__getParent();
207  $this->md_for = &$par->addFormat();
208  $this->md_for->save();
209  $this->__pushParent($this->md_for);
210  break;
211 
212  case 'Size':
213  break;
214 
215  case 'Location':
216  $par = &$this->__getParent();
217  $this->md_loc = &$par->addLocation();
218  $this->md_loc->setLocationType($a_attribs['Type']);
219  $this->md_loc->save();
220  $this->__pushParent($this->md_loc);
221  break;
222 
223  case 'Requirement':
224  $par = &$this->__getParent();
225  $this->md_req = &$par->addRequirement();
226  $this->md_req->save();
227  $this->__pushParent($this->md_req);
228  break;
229 
230  case 'OrComposite':
231  $par = &$this->__getParent();
232  $this->md_orc = &$par->addOrComposite();
233  $this->__pushParent($this->md_orc);
234  break;
235 
236  case 'Type':
237  break;
238 
239  case 'OperatingSystem':
240  $par = &$this->__getParent();
241  $par->setOperatingSystemName($a_attribs['Name']);
242  $par->setOperatingSystemMinimumVersion($a_attribs['MinimumVersion']);
243  $par->setOperatingSystemMaximumVersion($a_attribs['MaximumVersion']);
244  break;
245 
246  case 'Browser':
247  $par = &$this->__getParent();
248  $par->setBrowserName($a_attribs['Name']);
249  $par->setBrowserMinimumVersion($a_attribs['MinimumVersion']);
250  $par->setBrowserMaximumVersion($a_attribs['MaximumVersion']);
251  break;
252 
253  case 'InstallationRemarks':
254  $par = &$this->__getParent();
255  $par->setInstallationRemarksLanguage(new ilMDLanguageItem($a_attribs['Language']));
256  break;
257 
258  case 'OtherPlatformRequirements':
259  $par = &$this->__getParent();
260  $par->setOtherPlatformRequirementsLanguage(new ilMDLanguageItem($a_attribs['Language']));
261  break;
262 
263  case 'Duration':
264  break;
265 
266  case 'Educational':
267  $par = &$this->__getParent();
268  $this->md_edu = &$par->addEducational();
269  $this->md_edu->setInteractivityType($a_attribs['InteractivityType']);
270  $this->md_edu->setLearningResourceType($a_attribs['LearningResourceType']);
271  $this->md_edu->setInteractivityLevel($a_attribs['InteractivityLevel']);
272  $this->md_edu->setSemanticDensity($a_attribs['SemanticDensity']);
273  $this->md_edu->setIntendedEndUserRole($a_attribs['IntendedEndUserRole']);
274  $this->md_edu->setContext($a_attribs['Context']);
275  $this->md_edu->setDifficulty($a_attribs['Difficulty']);
276  $this->md_edu->save();
277  $this->__pushParent($this->md_edu);
278  break;
279 
280  case 'TypicalAgeRange':
281  $par = &$this->__getParent();
282  $this->md_typ = &$par->addTypicalAgeRange();
283  $this->md_typ->setTypicalAgeRangeLanguage(new ilMDLanguageItem($a_attribs['Language']));
284  $this->md_typ->save();
285  $this->__pushParent($this->md_typ);
286  break;
287 
288  case 'TypicalLearningTime':
289  break;
290 
291  case 'Rights':
292  $par = &$this->__getParent();
293  $this->md_rig = &$par->addRights();
294  $this->md_rig->setCosts($a_attribs['Costs']);
295  $this->md_rig->setCopyrightAndOtherRestrictions($a_attribs['CopyrightAndOtherRestrictions']);
296  $this->md_rig->save();
297  $this->__pushParent($this->md_rig);
298  break;
299 
300  case 'Relation':
301  $par = &$this->__getParent();
302  $this->md_rel = &$par->addRelation();
303  $this->md_rel->setKind($a_attribs['Kind']);
304  $this->md_rel->save();
305  $this->__pushParent($this->md_rel);
306  break;
307 
308  case 'Resource':
309  break;
310 
311  case 'Identifier_':
312  $par = &$this->__getParent();
313  $this->md_ide_ = &$par->addIdentifier_();
314  $this->md_ide_->setCatalog($a_attribs['Catalog']);
315  $this->md_ide_->setEntry($a_attribs['Entry']);
316  $this->md_ide_->save();
317  $this->__pushParent($this->md_ide_);
318  break;
319 
320  case 'Annotation':
321  $par = &$this->__getParent();
322  $this->md_ann = &$par->addAnnotation();
323  $this->md_ann->save();
324  $this->__pushParent($this->md_ann);
325  break;
326 
327  case 'Classification':
328  $par = &$this->__getParent();
329  $this->md_cla = &$par->addClassification();
330  $this->md_cla->setPurpose($a_attribs['Purpose']);
331  $this->md_cla->save();
332  $this->__pushParent($this->md_cla);
333  break;
334 
335  case 'TaxonPath':
336  $par = &$this->__getParent();
337  $this->md_taxp = &$par->addTaxonPath();
338  $this->md_taxp->save();
339  $this->__pushParent($this->md_taxp);
340  break;
341 
342  case 'Source':
343  $par = &$this->__getParent();
344  $par->setSourceLanguage(new ilMDLanguageItem($a_attribs['Language']));
345  break;
346 
347  case 'Taxon':
348  $par = &$this->__getParent();
349  $this->md_tax = &$par->addTaxon();
350  $this->md_tax->setTaxonLanguage(new ilMDLanguageItem($a_attribs['Language']));
351  $this->md_tax->setTaxonId($a_attribs['Id']);
352  $this->md_tax->save();
353  $this->__pushParent($this->md_tax);
354  break;
355  }
356  }
+ Here is the call graph for this function:

◆ handlerBeginTag() [2/3]

ilMDSaxParser::handlerBeginTag (   $a_xml_parser,
  $a_name,
  $a_attribs 
)

handler for begin of element

Definition at line 122 of file class.ilMDSaxParser.php.

References __getParent(), __pushParent(), and getMDParsingStatus().

123  {
124  include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
125 
126  if (!$this->getMDParsingStatus()) {
127  return;
128  }
129 
130  switch ($a_name) {
131  case 'MetaData':
132  $this->md_in_md = true;
133  $this->__pushParent($this->md);
134  break;
135 
136  case 'General':
137  $this->md_gen = &$this->md->addGeneral();
138  $this->md_gen->setStructure($a_attribs['Structure']);
139  $this->md_gen->save();
140  $this->__pushParent($this->md_gen);
141  break;
142 
143  case 'Identifier':
144  $par = &$this->__getParent();
145  $this->md_ide = &$par->addIdentifier();
146  $this->md_ide->setCatalog($a_attribs['Catalog']);
147  $this->md_ide->setEntry($a_attribs['Entry']);
148  $this->md_ide->save();
149  $this->__pushParent($this->md_ide);
150  break;
151 
152  case 'Title':
153  $par = &$this->__getParent();
154  $par->setTitleLanguage(new ilMDLanguageItem($a_attribs['Language']));
155  break;
156 
157  case 'Language':
158  $par = &$this->__getParent();
159  $this->md_lan = &$par->addLanguage();
160  $this->md_lan->setLanguage(new ilMDLanguageItem($a_attribs['Language']));
161  $this->md_lan->save();
162  $this->__pushParent($this->md_lan);
163  break;
164 
165  case 'Description':
166  $par = &$this->__getParent();
167 
168  if (strtolower(get_class($par)) == 'ilmdrights' or
169  strtolower(get_class($par)) == 'ilmdannotation' or
170  strtolower(get_class($par)) == 'ilmdclassification') {
171  $par->setDescriptionLanguage(new ilMDLanguageItem($a_attribs['Language']));
172  break;
173  } else {
174  $this->md_des = &$par->addDescription();
175  $this->md_des->setDescriptionLanguage(new ilMDLanguageItem($a_attribs['Language']));
176  $this->md_des->save();
177  $this->__pushParent($this->md_des);
178  break;
179  }
180 
181  // no break
182  case 'Keyword':
183  $par = &$this->__getParent();
184  if (!in_array(get_class($par), ["ilMD"])) {
185  $this->md_key = &$par->addKeyword();
186  $this->md_key->setKeywordLanguage(new ilMDLanguageItem($a_attribs['Language']));
187  $this->md_key->save();
188  $this->__pushParent($this->md_key);
189  }
190  break;
191 
192  case 'Coverage':
193  $par = &$this->__getParent();
194  $par->setCoverageLanguage(new ilMDLanguageItem($a_attribs['Language']));
195  break;
196 
197  case 'Lifecycle':
198  $par = &$this->__getParent();
199  $this->md_lif = &$par->addLifecycle();
200  $this->md_lif->setStatus($a_attribs['Status']);
201  $this->md_lif->save();
202  $this->__pushParent($this->md_lif);
203  break;
204 
205  case 'Version':
206  $par = &$this->__getParent();
207  $par->setVersionLanguage(new ilMDLanguageItem($a_attribs['Language']));
208  break;
209 
210  case 'Contribute':
211  $par = &$this->__getParent();
212  $this->md_con = &$par->addContribute();
213  $this->md_con->setRole($a_attribs['Role']);
214  $this->md_con->save();
215  $this->__pushParent($this->md_con);
216  break;
217 
218  case 'Entity':
219  $par = &$this->__getParent();
220 
221  if (strtolower(get_class($par)) == 'ilmdcontribute') {
222  $this->md_ent = &$par->addEntity();
223  $this->md_ent->save();
224  $this->__pushParent($this->md_ent);
225  break;
226  } else {
227  // single element in 'Annotation'
228  break;
229  }
230  // no break
231  case 'Date':
232  break;
233 
234  case 'Meta-Metadata':
235  $par = &$this->__getParent();
236  $this->md_met = &$par->addMetaMetadata();
237  $this->md_met->setMetaDataScheme($a_attribs['MetadataScheme']);
238  $this->md_met->setLanguage(new ilMDLanguageItem($a_attribs['Language']));
239  $this->md_met->save();
240  $this->__pushParent($this->md_met);
241  break;
242 
243  case 'Technical':
244  $par = &$this->__getParent();
245  $this->md_tec = &$par->addTechnical();
246  $this->md_tec->save();
247  $this->__pushParent($this->md_tec);
248  break;
249 
250  case 'Format':
251  $par = &$this->__getParent();
252  $this->md_for = &$par->addFormat();
253  $this->md_for->save();
254  $this->__pushParent($this->md_for);
255  break;
256 
257  case 'Size':
258  break;
259 
260  case 'Location':
261  $par = &$this->__getParent();
262  $this->md_loc = &$par->addLocation();
263  $this->md_loc->setLocationType($a_attribs['Type']);
264  $this->md_loc->save();
265  $this->__pushParent($this->md_loc);
266  break;
267 
268  case 'Requirement':
269  $par = &$this->__getParent();
270  $this->md_req = &$par->addRequirement();
271  $this->md_req->save();
272  $this->__pushParent($this->md_req);
273  break;
274 
275  case 'OrComposite':
276  $par = &$this->__getParent();
277  $this->md_orc = &$par->addOrComposite();
278  $this->__pushParent($this->md_orc);
279  break;
280 
281  case 'Type':
282  break;
283 
284  case 'OperatingSystem':
285  $par = &$this->__getParent();
286  $par->setOperatingSystemName($a_attribs['Name']);
287  $par->setOperatingSystemMinimumVersion($a_attribs['MinimumVersion']);
288  $par->setOperatingSystemMaximumVersion($a_attribs['MaximumVersion']);
289  break;
290 
291  case 'Browser':
292  $par = &$this->__getParent();
293  $par->setBrowserName($a_attribs['Name']);
294  $par->setBrowserMinimumVersion($a_attribs['MinimumVersion']);
295  $par->setBrowserMaximumVersion($a_attribs['MaximumVersion']);
296  break;
297 
298  case 'InstallationRemarks':
299  $par = &$this->__getParent();
300  $par->setInstallationRemarksLanguage(new ilMDLanguageItem($a_attribs['Language']));
301  break;
302 
303  case 'OtherPlatformRequirements':
304  $par = &$this->__getParent();
305  $par->setOtherPlatformRequirementsLanguage(new ilMDLanguageItem($a_attribs['Language']));
306  break;
307 
308  case 'Duration':
309  break;
310 
311  case 'Educational':
312  $par = &$this->__getParent();
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();
322  $this->__pushParent($this->md_edu);
323  break;
324 
325  case 'TypicalAgeRange':
326  $par = &$this->__getParent();
327  $this->md_typ = &$par->addTypicalAgeRange();
328  $this->md_typ->setTypicalAgeRangeLanguage(new ilMDLanguageItem($a_attribs['Language']));
329  $this->md_typ->save();
330  $this->__pushParent($this->md_typ);
331  break;
332 
333  case 'TypicalLearningTime':
334  break;
335 
336  case 'Rights':
337  $par = &$this->__getParent();
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();
342  $this->__pushParent($this->md_rig);
343  break;
344 
345  case 'Relation':
346  $par = &$this->__getParent();
347  $this->md_rel = &$par->addRelation();
348  $this->md_rel->setKind($a_attribs['Kind']);
349  $this->md_rel->save();
350  $this->__pushParent($this->md_rel);
351  break;
352 
353  case 'Resource':
354  break;
355 
356  case 'Identifier_':
357  $par = &$this->__getParent();
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();
362  $this->__pushParent($this->md_ide_);
363  break;
364 
365  case 'Annotation':
366  $par = &$this->__getParent();
367  $this->md_ann = &$par->addAnnotation();
368  $this->md_ann->save();
369  $this->__pushParent($this->md_ann);
370  break;
371 
372  case 'Classification':
373  $par = &$this->__getParent();
374  $this->md_cla = &$par->addClassification();
375  $this->md_cla->setPurpose($a_attribs['Purpose']);
376  $this->md_cla->save();
377  $this->__pushParent($this->md_cla);
378  break;
379 
380  case 'TaxonPath':
381  $par = &$this->__getParent();
382  $this->md_taxp = &$par->addTaxonPath();
383  $this->md_taxp->save();
384  $this->__pushParent($this->md_taxp);
385  break;
386 
387  case 'Source':
388  $par = &$this->__getParent();
389  $par->setSourceLanguage(new ilMDLanguageItem($a_attribs['Language']));
390  break;
391 
392  case 'Taxon':
393  $par = &$this->__getParent();
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();
398  $this->__pushParent($this->md_tax);
399  break;
400  }
401  }
+ Here is the call graph for this function:

◆ handlerBeginTag() [3/3]

ilMDSaxParser::handlerBeginTag (   $a_xml_parser,
  $a_name,
  $a_attribs 
)

handler for begin of element

Definition at line 127 of file class.ilMDSaxParser.php.

References __getParent(), __pushParent(), and getMDParsingStatus().

128  {
129  include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMDLanguageItem.php';
130 
131  if (!$this->getMDParsingStatus()) {
132  return;
133  }
134 
135  switch ($a_name) {
136  case 'MetaData':
137  $this->md_in_md = true;
138  $this->__pushParent($this->md);
139  break;
140 
141  case 'General':
142  $this->md_gen = &$this->md->addGeneral();
143  $this->md_gen->setStructure($a_attribs['Structure']);
144  $this->md_gen->save();
145  $this->__pushParent($this->md_gen);
146  break;
147 
148  case 'Identifier':
149  $par = &$this->__getParent();
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();
154  $this->__pushParent($this->md_ide);
155  break;
156 
157  case 'Title':
158  $par = &$this->__getParent();
159  $par->setTitleLanguage(new ilMDLanguageItem($a_attribs['Language']));
160  break;
161 
162  case 'Language':
163  $par = &$this->__getParent();
164  $this->md_lan = &$par->addLanguage();
165  $this->md_lan->setLanguage(new ilMDLanguageItem($a_attribs['Language']));
166  $this->md_lan->save();
167  $this->__pushParent($this->md_lan);
168  break;
169 
170  case 'Description':
171  $par = &$this->__getParent();
172 
173  if (strtolower(get_class($par)) == 'ilmdrights' or
174  strtolower(get_class($par)) == 'ilmdannotation' or
175  strtolower(get_class($par)) == 'ilmdclassification') {
176  $par->setDescriptionLanguage(new ilMDLanguageItem($a_attribs['Language']));
177  break;
178  } else {
179  $this->md_des = &$par->addDescription();
180  $this->md_des->setDescriptionLanguage(new ilMDLanguageItem($a_attribs['Language']));
181  $this->md_des->save();
182  $this->__pushParent($this->md_des);
183  break;
184  }
185 
186  // no break
187  case 'Keyword':
188  $par = &$this->__getParent();
189  $this->md_key = &$par->addKeyword();
190  $this->md_key->setKeywordLanguage(new ilMDLanguageItem($a_attribs['Language']));
191  $this->md_key->save();
192  $this->__pushParent($this->md_key);
193  break;
194 
195  case 'Coverage':
196  $par = &$this->__getParent();
197  $par->setCoverageLanguage(new ilMDLanguageItem($a_attribs['Language']));
198  break;
199 
200  case 'Lifecycle':
201  $par = &$this->__getParent();
202  $this->md_lif = &$par->addLifecycle();
203  $this->md_lif->setStatus($a_attribs['Status']);
204  $this->md_lif->save();
205  $this->__pushParent($this->md_lif);
206  break;
207 
208  case 'Version':
209  $par = &$this->__getParent();
210  $par->setVersionLanguage(new ilMDLanguageItem($a_attribs['Language']));
211  break;
212 
213  case 'Contribute':
214  $par = &$this->__getParent();
215  $this->md_con = &$par->addContribute();
216  $this->md_con->setRole($a_attribs['Role']);
217  $this->md_con->save();
218  $this->__pushParent($this->md_con);
219  break;
220 
221  case 'Entity':
222  $par = &$this->__getParent();
223 
224  if (strtolower(get_class($par)) == 'ilmdcontribute') {
225  $this->md_ent = &$par->addEntity();
226  $this->md_ent->save();
227  $this->__pushParent($this->md_ent);
228  break;
229  } else {
230  // single element in 'Annotation'
231  break;
232  }
233  // no break
234  case 'Date':
235  break;
236 
237  case 'Meta-Metadata':
238  $par = &$this->__getParent();
239  $this->md_met = &$par->addMetaMetadata();
240  $this->md_met->setMetaDataScheme($a_attribs['MetadataScheme']);
241  $this->md_met->setLanguage(new ilMDLanguageItem($a_attribs['Language']));
242  $this->md_met->save();
243  $this->__pushParent($this->md_met);
244  break;
245 
246  case 'Technical':
247  $par = &$this->__getParent();
248  $this->md_tec = &$par->addTechnical();
249  $this->md_tec->save();
250  $this->__pushParent($this->md_tec);
251  break;
252 
253  case 'Format':
254  $par = &$this->__getParent();
255  $this->md_for = &$par->addFormat();
256  $this->md_for->save();
257  $this->__pushParent($this->md_for);
258  break;
259 
260  case 'Size':
261  break;
262 
263  case 'Location':
264  $par = &$this->__getParent();
265  $this->md_loc = &$par->addLocation();
266  $this->md_loc->setLocationType($a_attribs['Type']);
267  $this->md_loc->save();
268  $this->__pushParent($this->md_loc);
269  break;
270 
271  case 'Requirement':
272  $par = &$this->__getParent();
273  $this->md_req = &$par->addRequirement();
274  $this->md_req->save();
275  $this->__pushParent($this->md_req);
276  break;
277 
278  case 'OrComposite':
279  $par = &$this->__getParent();
280  $this->md_orc = &$par->addOrComposite();
281  $this->__pushParent($this->md_orc);
282  break;
283 
284  case 'Type':
285  break;
286 
287  case 'OperatingSystem':
288  $par = &$this->__getParent();
289  $par->setOperatingSystemName($a_attribs['Name']);
290  $par->setOperatingSystemMinimumVersion($a_attribs['MinimumVersion']);
291  $par->setOperatingSystemMaximumVersion($a_attribs['MaximumVersion']);
292  break;
293 
294  case 'Browser':
295  $par = &$this->__getParent();
296  $par->setBrowserName($a_attribs['Name']);
297  $par->setBrowserMinimumVersion($a_attribs['MinimumVersion']);
298  $par->setBrowserMaximumVersion($a_attribs['MaximumVersion']);
299  break;
300 
301  case 'InstallationRemarks':
302  $par = &$this->__getParent();
303  $par->setInstallationRemarksLanguage(new ilMDLanguageItem($a_attribs['Language']));
304  break;
305 
306  case 'OtherPlatformRequirements':
307  $par = &$this->__getParent();
308  $par->setOtherPlatformRequirementsLanguage(new ilMDLanguageItem($a_attribs['Language']));
309  break;
310 
311  case 'Duration':
312  break;
313 
314  case 'Educational':
315  $par = &$this->__getParent();
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();
325  $this->__pushParent($this->md_edu);
326  break;
327 
328  case 'TypicalAgeRange':
329  $par = &$this->__getParent();
330  $this->md_typ = &$par->addTypicalAgeRange();
331  $this->md_typ->setTypicalAgeRangeLanguage(new ilMDLanguageItem($a_attribs['Language']));
332  $this->md_typ->save();
333  $this->__pushParent($this->md_typ);
334  break;
335 
336  case 'TypicalLearningTime':
337  break;
338 
339  case 'Rights':
340  $par = &$this->__getParent();
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();
345  $this->__pushParent($this->md_rig);
346  break;
347 
348  case 'Relation':
349  $par = &$this->__getParent();
350  $this->md_rel = &$par->addRelation();
351  $this->md_rel->setKind($a_attribs['Kind']);
352  $this->md_rel->save();
353  $this->__pushParent($this->md_rel);
354  break;
355 
356  case 'Resource':
357  break;
358 
359  case 'Identifier_':
360  $par = &$this->__getParent();
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();
365  $this->__pushParent($this->md_ide_);
366  break;
367 
368  case 'Annotation':
369  $par = &$this->__getParent();
370  $this->md_ann = &$par->addAnnotation();
371  $this->md_ann->save();
372  $this->__pushParent($this->md_ann);
373  break;
374 
375  case 'Classification':
376  $par = &$this->__getParent();
377  $this->md_cla = &$par->addClassification();
378  $this->md_cla->setPurpose($a_attribs['Purpose']);
379  $this->md_cla->save();
380  $this->__pushParent($this->md_cla);
381  break;
382 
383  case 'TaxonPath':
384  $par = &$this->__getParent();
385  $this->md_taxp = &$par->addTaxonPath();
386  $this->md_taxp->save();
387  $this->__pushParent($this->md_taxp);
388  break;
389 
390  case 'Source':
391  $par = &$this->__getParent();
392  $par->setSourceLanguage(new ilMDLanguageItem($a_attribs['Language']));
393  break;
394 
395  case 'Taxon':
396  $par = &$this->__getParent();
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();
401  $this->__pushParent($this->md_tax);
402  break;
403  }
404  }
+ Here is the call graph for this function:

◆ handlerCharacterData() [1/3]

ilMDSaxParser::handlerCharacterData (   $a_xml_parser,
  $a_data 
)

handler for character data

Definition at line 593 of file class.ilMDSaxParser.php.

References inMetaData().

594  {
595  if ($this->inMetaData() and $a_data != "\n") {
596  // Replace multiple tabs with one space
597  $a_data = preg_replace("/\t+/", " ", $a_data);
598 
599  $this->md_chr_data .= $a_data;
600  }
601  }
+ Here is the call graph for this function:

◆ handlerCharacterData() [2/3]

ilMDSaxParser::handlerCharacterData (   $a_xml_parser,
  $a_data 
)

handler for character data

Definition at line 646 of file class.ilMDSaxParser.php.

References getMDParsingStatus(), and inMetaData().

647  {
648  if (!$this->getMDParsingStatus()) {
649  return;
650  }
651 
652  if ($this->inMetaData() and $a_data != "\n") {
653  // Replace multiple tabs with one space
654  $a_data = preg_replace("/\t+/", " ", $a_data);
655 
656  $this->md_chr_data .= $a_data;
657  }
658  }
+ Here is the call graph for this function:

◆ handlerCharacterData() [3/3]

ilMDSaxParser::handlerCharacterData (   $a_xml_parser,
  $a_data 
)

handler for character data

Definition at line 647 of file class.ilMDSaxParser.php.

References getMDParsingStatus(), and inMetaData().

648  {
649  if (!$this->getMDParsingStatus()) {
650  return;
651  }
652 
653  if ($this->inMetaData() and $a_data != "\n") {
654  // Replace multiple tabs with one space
655  $a_data = preg_replace("/\t+/", " ", $a_data);
656 
657  $this->md_chr_data .= $a_data;
658  }
659  }
+ Here is the call graph for this function:

◆ handlerEndTag() [1/3]

ilMDSaxParser::handlerEndTag (   $a_xml_parser,
  $a_name 
)

handler for end of element

Definition at line 361 of file class.ilMDSaxParser.php.

References __getCharacterData(), __getParent(), and __popParent().

362  {
363  switch ($a_name) {
364  case 'MetaData':
365  $this->md_parent = array();
366  $this->md_in_md = false;
367  break;
368 
369  case 'General':
370  $par = &$this->__getParent();
371  $par->update();
372  $this->__popParent();
373  break;
374 
375  case 'Identifier':
376  $par = &$this->__getParent();
377  $par->update();
378  $this->__popParent();
379  break;
380 
381  case 'Title':
382  $par = &$this->__getParent();
383  $par->setTitle($this->__getCharacterData());
384  break;
385 
386  case 'Language':
387  $par = &$this->__getParent();
388  $par->update();
389  $this->__popParent();
390  break;
391 
392  case 'Description':
393  $par = &$this->__getParent();
394  if (strtolower(get_class($par)) == 'ilmddescription') {
395  $par->setDescription($this->__getCharacterData());
396  $par->update();
397  $this->__popParent();
398  break;
399  } else {
400  $par->setDescription($this->__getCharacterData());
401  break;
402  }
403 
404  // no break
405  case 'Keyword':
406  $par = &$this->__getParent();
407  $par->setKeyword($this->__getCharacterData());
408  $par->update();
409  $this->__popParent();
410  break;
411 
412  case 'Coverage':
413  $par = &$this->__getParent();
414  $par->setCoverage($this->__getCharacterData());
415  break;
416 
417  case 'Lifecycle':
418  $par = &$this->__getParent();
419  $par->update();
420  $this->__popParent();
421  break;
422 
423  case 'Version':
424  $par = &$this->__getParent();
425  $par->setVersion($this->__getCharacterData());
426  break;
427 
428  case 'Contribute':
429  $par = &$this->__getParent();
430  $par->update();
431  $this->__popParent();
432  break;
433 
434  case 'Entity':
435  $par = &$this->__getParent();
436 
437  if (strtolower(get_class($par)) == 'ilmdentity') {
438  $par->setEntity($this->__getCharacterData());
439  $par->update();
440  $this->__popParent();
441  } else {
442  // Single element in 'Annotation'
443  $par->setEntity($this->__getCharacterData());
444  }
445  break;
446 
447  case 'Date':
448  $par = &$this->__getParent();
449  $par->setDate($this->__getCharacterData());
450  break;
451 
452  case 'Meta-Metadata':
453  $par = &$this->__getParent();
454  $par->update();
455  $this->__popParent();
456  break;
457 
458  case 'Technical':
459  $par = &$this->__getParent();
460  $par->update();
461  $this->__popParent();
462  break;
463 
464  case 'Format':
465  $par = &$this->__getParent();
466  $par->setFormat($this->__getCharacterData());
467  $par->update();
468  $this->__popParent();
469  break;
470 
471  case 'Size':
472  $par = &$this->__getParent();
473  $par->setSize($this->__getCharacterData());
474  break;
475 
476  case 'Location':
477  $par = &$this->__getParent();
478  $par->setLocation($this->__getCharacterData());
479  $par->update();
480  $this->__popParent();
481  break;
482 
483  case 'Requirement':
484  $par = &$this->__getParent();
485  $par->update();
486  $this->__popParent();
487  break;
488 
489  case 'OrComposite':
490  $this->__popParent();
491  break;
492 
493  case 'Type':
494  break;
495 
496  case 'OperatingSystem':
497  break;
498 
499  case 'Browser':
500  break;
501 
502  case 'InstallationRemarks':
503  $par = &$this->__getParent();
504  $par->setInstallationRemarks($this->__getCharacterData());
505  break;
506 
507  case 'OtherPlatformRequirements':
508  $par = &$this->__getParent();
509  $par->setOtherPlatformRequirements($this->__getCharacterData());
510  break;
511 
512  case 'Duration':
513  $par = &$this->__getParent();
514  $par->setDuration($this->__getCharacterData());
515  break;
516 
517  case 'Educational':
518  $par = &$this->__getParent();
519  $par->update();
520  $this->__popParent();
521  break;
522 
523  case 'TypicalAgeRange':
524  $par = &$this->__getParent();
525  $par->setTypicalAgeRange($this->__getCharacterData());
526  $par->update();
527  $this->__popParent();
528  break;
529 
530  case 'TypicalLearningTime':
531  $par = &$this->__getParent();
532  $par->setTypicalLearningTime($this->__getCharacterData());
533  break;
534 
535  case 'Rights':
536  $par = &$this->__getParent();
537  $par->update();
538  $this->__popParent();
539  break;
540 
541  case 'Relation':
542  $par = &$this->__getParent();
543  $par->update();
544  $this->__popParent();
545  break;
546 
547  case 'Resource':
548  break;
549 
550  case 'Identifier_':
551  $par = &$this->__getParent();
552  $par->update();
553  $this->__popParent();
554  break;
555 
556  case 'Annotation':
557  $par = &$this->__getParent();
558  $par->update();
559  $this->__popParent();
560  break;
561 
562  case 'Classification':
563  $par = &$this->__getParent();
564  $par->update();
565  $this->__popParent();
566  break;
567 
568  case 'TaxonPath':
569  $par = &$this->__getParent();
570  $par->update();
571  $this->__popParent();
572  break;
573 
574  case 'Taxon':
575  $par = &$this->__getParent();
576  $par->setTaxon($this->__getCharacterData());
577  $par->update();
578  $this->__popParent();
579  break;
580 
581  case 'Source':
582  $par = &$this->__getParent();
583  $par->setSource($this->__getCharacterData());
584  break;
585 
586  }
587  $this->md_chr_data = '';
588  }
+ Here is the call graph for this function:

◆ handlerEndTag() [2/3]

ilMDSaxParser::handlerEndTag (   $a_xml_parser,
  $a_name 
)

handler for end of element

Definition at line 406 of file class.ilMDSaxParser.php.

References __getCharacterData(), __getParent(), __popParent(), and getMDParsingStatus().

407  {
408  if (!$this->getMDParsingStatus()) {
409  return;
410  }
411 
412  switch ($a_name) {
413  case 'MetaData':
414  $this->md_parent = array();
415  $this->md_in_md = false;
416  break;
417 
418  case 'General':
419  $par = &$this->__getParent();
420  $par->update();
421  $this->__popParent();
422  break;
423 
424  case 'Identifier':
425  $par = &$this->__getParent();
426  $par->update();
427  $this->__popParent();
428  break;
429 
430  case 'Title':
431  $par = &$this->__getParent();
432  $par->setTitle($this->__getCharacterData());
433  break;
434 
435  case 'Language':
436  $par = &$this->__getParent();
437  $par->update();
438  $this->__popParent();
439  break;
440 
441  case 'Description':
442  $par = $this->__getParent();
443  if ($par instanceof ilMDRights) {
444  $par->parseDescriptionFromImport(
445  $this->__getCharacterData()
446  );
447  } else {
448  $par->setDescription($this->__getCharacterData());
449  }
450  $par->update();
451  if ($par instanceof ilMDDescription) {
452  $this->__popParent();
453  }
454  break;
455 
456  case 'Keyword':
457  $par = &$this->__getParent();
458  if (!in_array(get_class($par), ["ilMD"])) {
459  $par->setKeyword($this->__getCharacterData());
460  $this->meta_log->debug("Keyword: " . $this->__getCharacterData());
461  $par->update();
462  $this->__popParent();
463  }
464  break;
465 
466  case 'Coverage':
467  $par = &$this->__getParent();
468  $par->setCoverage($this->__getCharacterData());
469  break;
470 
471  case 'Lifecycle':
472  $par = &$this->__getParent();
473  $par->update();
474  $this->__popParent();
475  break;
476 
477  case 'Version':
478  $par = &$this->__getParent();
479  $par->setVersion($this->__getCharacterData());
480  break;
481 
482  case 'Contribute':
483  $par = &$this->__getParent();
484  $par->update();
485  $this->__popParent();
486  break;
487 
488  case 'Entity':
489  $par = &$this->__getParent();
490 
491  if (strtolower(get_class($par)) == 'ilmdentity') {
492  $par->setEntity($this->__getCharacterData());
493  $par->update();
494  $this->__popParent();
495  } else {
496  // Single element in 'Annotation'
497  $par->setEntity($this->__getCharacterData());
498  }
499  break;
500 
501  case 'Date':
502  $par = &$this->__getParent();
503  $par->setDate($this->__getCharacterData());
504  break;
505 
506  case 'Meta-Metadata':
507  $par = &$this->__getParent();
508  $par->update();
509  $this->__popParent();
510  break;
511 
512  case 'Technical':
513  $par = &$this->__getParent();
514  $par->update();
515  $this->__popParent();
516  break;
517 
518  case 'Format':
519  $par = &$this->__getParent();
520  $par->setFormat($this->__getCharacterData());
521  $par->update();
522  $this->__popParent();
523  break;
524 
525  case 'Size':
526  $par = &$this->__getParent();
527  $par->setSize($this->__getCharacterData());
528  break;
529 
530  case 'Location':
531  $par = &$this->__getParent();
532  $par->setLocation($this->__getCharacterData());
533  $par->update();
534  $this->__popParent();
535  break;
536 
537  case 'Requirement':
538  $par = &$this->__getParent();
539  $par->update();
540  $this->__popParent();
541  break;
542 
543  case 'OrComposite':
544  $this->__popParent();
545  break;
546 
547  case 'Type':
548  break;
549 
550  case 'OperatingSystem':
551  break;
552 
553  case 'Browser':
554  break;
555 
556  case 'InstallationRemarks':
557  $par = &$this->__getParent();
558  $par->setInstallationRemarks($this->__getCharacterData());
559  break;
560 
561  case 'OtherPlatformRequirements':
562  $par = &$this->__getParent();
563  $par->setOtherPlatformRequirements($this->__getCharacterData());
564  break;
565 
566  case 'Duration':
567  $par = &$this->__getParent();
568  $par->setDuration($this->__getCharacterData());
569  break;
570 
571  case 'Educational':
572  $par = &$this->__getParent();
573  $par->update();
574  $this->__popParent();
575  break;
576 
577  case 'TypicalAgeRange':
578  $par = &$this->__getParent();
579  $par->setTypicalAgeRange($this->__getCharacterData());
580  $par->update();
581  $this->__popParent();
582  break;
583 
584  case 'TypicalLearningTime':
585  $par = &$this->__getParent();
586  $par->setTypicalLearningTime($this->__getCharacterData());
587  break;
588 
589  case 'Rights':
590  $par = &$this->__getParent();
591  $par->update();
592  $this->__popParent();
593  break;
594 
595  case 'Relation':
596  $par = &$this->__getParent();
597  $par->update();
598  $this->__popParent();
599  break;
600 
601  case 'Resource':
602  break;
603 
604  case 'Identifier_':
605  $par = &$this->__getParent();
606  $par->update();
607  $this->__popParent();
608  break;
609 
610  case 'Annotation':
611  $par = &$this->__getParent();
612  $par->update();
613  $this->__popParent();
614  break;
615 
616  case 'Classification':
617  $par = &$this->__getParent();
618  $par->update();
619  $this->__popParent();
620  break;
621 
622  case 'TaxonPath':
623  $par = &$this->__getParent();
624  $par->update();
625  $this->__popParent();
626  break;
627 
628  case 'Taxon':
629  $par = &$this->__getParent();
630  $par->setTaxon($this->__getCharacterData());
631  $par->update();
632  $this->__popParent();
633  break;
634 
635  case 'Source':
636  $par = &$this->__getParent();
637  $par->setSource($this->__getCharacterData());
638  break;
639 
640  }
641  $this->md_chr_data = '';
642  }
+ Here is the call graph for this function:

◆ handlerEndTag() [3/3]

ilMDSaxParser::handlerEndTag (   $a_xml_parser,
  $a_name 
)

handler for end of element

Definition at line 409 of file class.ilMDSaxParser.php.

References __getCharacterData(), __getParent(), __popParent(), and getMDParsingStatus().

410  {
411  if (!$this->getMDParsingStatus()) {
412  return;
413  }
414 
415  switch ($a_name) {
416  case 'MetaData':
417  $this->md_parent = array();
418  $this->md_in_md = false;
419  break;
420 
421  case 'General':
422  $par = &$this->__getParent();
423  $par->update();
424  $this->__popParent();
425  break;
426 
427  case 'Identifier':
428  $par = &$this->__getParent();
429  $par->update();
430  $this->__popParent();
431  break;
432 
433  case 'Title':
434  $par = &$this->__getParent();
435  $par->setTitle($this->__getCharacterData());
436  break;
437 
438  case 'Language':
439  $par = &$this->__getParent();
440  $par->update();
441  $this->__popParent();
442  break;
443 
444  case 'Description':
445  $par = &$this->__getParent();
446  if (strtolower(get_class($par)) == 'ilmddescription') {
447  $par->setDescription($this->__getCharacterData());
448  $par->update();
449  $this->__popParent();
450  break;
451  } else {
452  $par->setDescription($this->__getCharacterData());
453  break;
454  }
455 
456  // no break
457  case 'Keyword':
458  $par = &$this->__getParent();
459  $par->setKeyword($this->__getCharacterData());
460  $this->meta_log->debug("Keyword: " . $this->__getCharacterData());
461  $par->update();
462  $this->__popParent();
463  break;
464 
465  case 'Coverage':
466  $par = &$this->__getParent();
467  $par->setCoverage($this->__getCharacterData());
468  break;
469 
470  case 'Lifecycle':
471  $par = &$this->__getParent();
472  $par->update();
473  $this->__popParent();
474  break;
475 
476  case 'Version':
477  $par = &$this->__getParent();
478  $par->setVersion($this->__getCharacterData());
479  break;
480 
481  case 'Contribute':
482  $par = &$this->__getParent();
483  $par->update();
484  $this->__popParent();
485  break;
486 
487  case 'Entity':
488  $par = &$this->__getParent();
489 
490  if (strtolower(get_class($par)) == 'ilmdentity') {
491  $par->setEntity($this->__getCharacterData());
492  $par->update();
493  $this->__popParent();
494  } else {
495  // Single element in 'Annotation'
496  $par->setEntity($this->__getCharacterData());
497  }
498  break;
499 
500  case 'Date':
501  $par = &$this->__getParent();
502  $par->setDate($this->__getCharacterData());
503  break;
504 
505  case 'Meta-Metadata':
506  $par = &$this->__getParent();
507  $par->update();
508  $this->__popParent();
509  break;
510 
511  case 'Technical':
512  $par = &$this->__getParent();
513  $par->update();
514  $this->__popParent();
515  break;
516 
517  case 'Format':
518  $par = &$this->__getParent();
519  $par->setFormat($this->__getCharacterData());
520  $par->update();
521  $this->__popParent();
522  break;
523 
524  case 'Size':
525  $par = &$this->__getParent();
526  $par->setSize($this->__getCharacterData());
527  break;
528 
529  case 'Location':
530  $par = &$this->__getParent();
531  $par->setLocation($this->__getCharacterData());
532  $par->update();
533  $this->__popParent();
534  break;
535 
536  case 'Requirement':
537  $par = &$this->__getParent();
538  $par->update();
539  $this->__popParent();
540  break;
541 
542  case 'OrComposite':
543  $this->__popParent();
544  break;
545 
546  case 'Type':
547  break;
548 
549  case 'OperatingSystem':
550  break;
551 
552  case 'Browser':
553  break;
554 
555  case 'InstallationRemarks':
556  $par = &$this->__getParent();
557  $par->setInstallationRemarks($this->__getCharacterData());
558  break;
559 
560  case 'OtherPlatformRequirements':
561  $par = &$this->__getParent();
562  $par->setOtherPlatformRequirements($this->__getCharacterData());
563  break;
564 
565  case 'Duration':
566  $par = &$this->__getParent();
567  $par->setDuration($this->__getCharacterData());
568  break;
569 
570  case 'Educational':
571  $par = &$this->__getParent();
572  $par->update();
573  $this->__popParent();
574  break;
575 
576  case 'TypicalAgeRange':
577  $par = &$this->__getParent();
578  $par->setTypicalAgeRange($this->__getCharacterData());
579  $par->update();
580  $this->__popParent();
581  break;
582 
583  case 'TypicalLearningTime':
584  $par = &$this->__getParent();
585  $par->setTypicalLearningTime($this->__getCharacterData());
586  break;
587 
588  case 'Rights':
589  $par = &$this->__getParent();
590  $par->update();
591  $this->__popParent();
592  break;
593 
594  case 'Relation':
595  $par = &$this->__getParent();
596  $par->update();
597  $this->__popParent();
598  break;
599 
600  case 'Resource':
601  break;
602 
603  case 'Identifier_':
604  $par = &$this->__getParent();
605  $par->update();
606  $this->__popParent();
607  break;
608 
609  case 'Annotation':
610  $par = &$this->__getParent();
611  $par->update();
612  $this->__popParent();
613  break;
614 
615  case 'Classification':
616  $par = &$this->__getParent();
617  $par->update();
618  $this->__popParent();
619  break;
620 
621  case 'TaxonPath':
622  $par = &$this->__getParent();
623  $par->update();
624  $this->__popParent();
625  break;
626 
627  case 'Taxon':
628  $par = &$this->__getParent();
629  $par->setTaxon($this->__getCharacterData());
630  $par->update();
631  $this->__popParent();
632  break;
633 
634  case 'Source':
635  $par = &$this->__getParent();
636  $par->setSource($this->__getCharacterData());
637  break;
638 
639  }
640  $this->md_chr_data = '';
641  }
+ Here is the call graph for this function:

◆ inMetaData() [1/3]

ilMDSaxParser::inMetaData ( )

Definition at line 74 of file class.ilMDSaxParser.php.

References $md_in_md.

75  {
76  return $this->md_in_md;
77  }

◆ inMetaData() [2/3]

ilMDSaxParser::inMetaData ( )

Definition at line 99 of file class.ilMDSaxParser.php.

References $md_in_md.

Referenced by handlerCharacterData().

100  {
101  return $this->md_in_md;
102  }
+ Here is the caller graph for this function:

◆ inMetaData() [3/3]

ilMDSaxParser::inMetaData ( )

Definition at line 104 of file class.ilMDSaxParser.php.

References $md_in_md.

105  {
106  return $this->md_in_md;
107  }

◆ setHandlers() [1/2]

ilMDSaxParser::setHandlers (   $a_xml_parser)

set event handlers

Parameters
resourcereference to the xml parser private

Definition at line 110 of file class.ilMDSaxParser.php.

111  {
112  xml_set_object($a_xml_parser, $this);
113  xml_set_element_handler($a_xml_parser, 'handlerBeginTag', 'handlerEndTag');
114  xml_set_character_data_handler($a_xml_parser, 'handlerCharacterData');
115  }

◆ setHandlers() [2/2]

ilMDSaxParser::setHandlers (   $a_xml_parser)

set event handlers

Parameters
resourcereference to the xml parser private

Definition at line 115 of file class.ilMDSaxParser.php.

116  {
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');
120  }

◆ setMDObject() [1/3]

ilMDSaxParser::setMDObject ( $md)

Definition at line 69 of file class.ilMDSaxParser.php.

References $md.

70  {
71  $this->md = &$md;
72  }

◆ setMDObject() [2/3]

ilMDSaxParser::setMDObject ( $md)

Definition at line 90 of file class.ilMDSaxParser.php.

References $md.

Referenced by ilMDXMLParser\__construct(), ilWebLinkXmlParser\__construct(), ilMDXMLCopier\__construct(), ilCourseXMLParser\__construct(), and ilGroupXMLParser\__construct().

91  {
92  $this->md = &$md;
93  }
+ Here is the caller graph for this function:

◆ setMDObject() [3/3]

ilMDSaxParser::setMDObject ( $md)

Definition at line 95 of file class.ilMDSaxParser.php.

References $md.

96  {
97  $this->md = &$md;
98  }

Field Documentation

◆ $md

ilMDSaxParser::$md = null

Definition at line 48 of file class.ilMDSaxParser.php.

Referenced by ilWebLinkXmlParser\handlerBeginTag(), and setMDObject().

◆ $md_chr_data

ilMDSaxParser::$md_chr_data = ''

Definition at line 37 of file class.ilMDSaxParser.php.

◆ $md_cur_el

ilMDSaxParser::$md_cur_el = null

Definition at line 39 of file class.ilMDSaxParser.php.

◆ $md_gen

ilMDSaxParser::$md_gen

Definition at line 53 of file class.ilMDSaxParser.php.

◆ $md_in_md

ilMDSaxParser::$md_in_md = false

Definition at line 36 of file class.ilMDSaxParser.php.

Referenced by inMetaData().

◆ $md_parsing_enabled

ilMDSaxParser::$md_parsing_enabled = null

Definition at line 44 of file class.ilMDSaxParser.php.

Referenced by getMDParsingStatus().

◆ $meta_log

ilMDSaxParser::$meta_log
protected

Definition at line 58 of file class.ilMDSaxParser.php.


The documentation for this class was generated from the following file: