ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilSCORM13MDImporter Class Reference

SCORM 13 Metadata importer. More...

+ Inheritance diagram for ilSCORM13MDImporter:
+ Collaboration diagram for ilSCORM13MDImporter:

Public Member Functions

 __construct ($a_manifest_dom, $a_obj_id)
 Constructor. More...
 
 setTitle ($a_val)
 Set title. More...
 
 getTitle ()
 Get title. More...
 
 setDescription ($a_val)
 Set description. More...
 
 getDescription ()
 Get description. More...
 
 import ()
 Import. 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...
 
 in ($a_name)
 
- Public Member Functions inherited from ilMDXMLCopier
 __construct ($content, $a_rbac_id, $a_obj_id, $a_obj_type)
 
 setHandlers ($a_xml_parser)
 
 handlerBeginTag ($a_xml_parser, $a_name, $a_attribs)
 
 handlerEndTag ($a_xml_parser, $a_name)
 
 handlerCharacterData ($a_xml_parser, $a_data)
 
 __setFilter ()
 
 __inFilter ($a_tag_name)
 
- Public Member Functions inherited from ilMDSaxParser
 __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 ()
 
- 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...
 

Protected Attributes

 $manifest_dom
 
 $metadata_found = false
 
 $path = array()
 
 $title = ""
 
 $description = ""
 
- Protected Attributes inherited from ilMDSaxParser
 $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...
 
- Data Fields inherited from ilMDXMLCopier
 $filter = array()
 
- Data Fields inherited from ilMDSaxParser
 $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 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

SCORM 13 Metadata importer.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 14 of file class.ilSCORM13MDImporter.php.

Constructor & Destructor Documentation

◆ __construct()

ilSCORM13MDImporter::__construct (   $a_manifest_dom,
  $a_obj_id 
)

Constructor.

Parameters

Definition at line 28 of file class.ilSCORM13MDImporter.php.

References $path, and ilObject\_lookupType().

29  {
30  $this->manifest_dom = $a_manifest_dom;
31  $path = new DOMXpath($a_manifest_dom);
32  $path->registerNamespace("ims","http://www.imsproject.org/xsd/imscp_rootv1p1p2");
33  $items = $path->query("//ims:manifest/ims:metadata");
34  if($items->length == 1)
35  {
36  foreach($items as $i)
37  {
38  //echo htmlentities($a_manifest_dom->saveXML($i)); exit;
39  parent::__construct($a_manifest_dom->saveXML($i), $a_obj_id,$a_obj_id,ilObject::_lookupType($a_obj_id));
40  $this->metadata_found = true;
41  }
42  }
43  }
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:

Member Function Documentation

◆ getDescription()

ilSCORM13MDImporter::getDescription ( )

Get description.

Returns
string description

Definition at line 80 of file class.ilSCORM13MDImporter.php.

References $description.

Referenced by handlerEndTag().

+ Here is the caller graph for this function:

◆ getTitle()

ilSCORM13MDImporter::getTitle ( )

Get title.

Returns
string title

Definition at line 60 of file class.ilSCORM13MDImporter.php.

References $title.

Referenced by handlerEndTag().

61  {
62  return $this->title;
63  }
+ Here is the caller graph for this function:

◆ handlerBeginTag()

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

handler for begin of element

Definition at line 103 of file class.ilSCORM13MDImporter.php.

References ilMDSaxParser\__getParent(), ilMDSaxParser\__pushParent(), ilMDSaxParser\getMDParsingStatus(), and in().

104  {
105  include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
106 //echo "<br>BEGIN:".$a_name;
107  $this->path[count($this->path)] = $a_name;
108 
109  if(!$this->getMDParsingStatus())
110  {
111  return;
112  }
113 
114  switch($a_name)
115  {
116  case 'metadata':
117  $this->md_in_md = true;
118  $this->in_meta_data = true;
119  $this->__pushParent($this->md);
120  break;
121 
122  case 'general':
123  $this->md_gen = $this->md->addGeneral();
124  $this->md_gen->save();
125  $this->__pushParent($this->md_gen);
126  break;
127 
128  case 'identifier':
129  if ($this->in("general"))
130  {
131  $par = $this->__getParent();
132  $this->md_ide = $par->addIdentifier();
133  $this->md_ide->save();
134  $this->__pushParent($this->md_ide);
135  }
136  break;
137 
138  case 'title':
139  // nothing to do here
140  break;
141 
142  case 'language':
143  if ($this->in("general"))
144  {
145  $par = $this->__getParent();
146  $this->md_lan = $par->addLanguage();
147  $this->md_lan->save();
148  $this->__pushParent($this->md_lan);
149  }
150  break;
151 
152  case 'description':
153  $par = $this->__getParent();
154 
155  if(strtolower(get_class($par)) == 'ilmdrights' or
156  strtolower(get_class($par)) == 'ilmdannotation' or
157  strtolower(get_class($par)) == 'ilmdclassification')
158  {
159  // todo
160 // $par->setDescriptionLanguage(new ilMDLanguageItem($a_attribs['Language']));
161  }
162  else if ($this->in("general"))
163  {
164  $this->md_des = $par->addDescription();
165  $this->md_des->save();
166  $this->__pushParent($this->md_des);
167  }
168  break;
169 
170  case 'keyword':
171  if ($this->in("general"))
172  {
173  $par = $this->__getParent();
174  $this->md_key = $par->addKeyword();
175  $this->md_key->save();
176  $this->__pushParent($this->md_key);
177  }
178  break;
179 
180  // todo
181  /*case 'Coverage':
182  $par =& $this->__getParent();
183  $par->setCoverageLanguage(new ilMDLanguageItem($a_attribs['Language']));
184  break;*/
185 
186  case 'lifeCycle':
187  $par = $this->__getParent();
188  $this->md_lif = $par->addLifecycle();
189  //$this->md_lif->setStatus($a_attribs['Status']);
190  $this->md_lif->save();
191  $this->__pushParent($this->md_lif);
192  break;
193 
194  case 'version':
195  // nothing to do here
196  break;
197 
198  /*case 'metaMetadata':
199  $par = $this->__getParent();
200  $this->md_met = $par->addMetaMetadata();
201  $this->md_met->setMetaDataScheme($a_attribs['MetadataScheme']);
202  $this->md_met->setLanguage(new ilMDLanguageItem($a_attribs['Language']));
203  $this->md_met->save();
204  $this->__pushParent($this->md_met);
205  break;*/
206 
207  // todo
208  /*case 'Contribute':
209  $par =& $this->__getParent();
210  $this->md_con =& $par->addContribute();
211  $this->md_con->setRole($a_attribs['Role']);
212  $this->md_con->save();
213  $this->__pushParent($this->md_con);
214  break;
215 
216  case 'Entity':
217  $par =& $this->__getParent();
218 
219  if(strtolower(get_class($par)) == 'ilmdcontribute')
220  {
221  $this->md_ent =& $par->addEntity();
222  $this->md_ent->save();
223  $this->__pushParent($this->md_ent);
224  break;
225  }
226  else
227  {
228  // single element in 'Annotation'
229  break;
230  }
231  case 'Date':
232  break;
233 
234 
235  case 'Technical':
236  $par =& $this->__getParent();
237  $this->md_tec =& $par->addTechnical();
238  $this->md_tec->save();
239  $this->__pushParent($this->md_tec);
240  break;
241 
242  case 'Format':
243  $par =& $this->__getParent();
244  $this->md_for =& $par->addFormat();
245  $this->md_for->save();
246  $this->__pushParent($this->md_for);
247  break;
248 
249  case 'Size':
250  break;
251 
252  case 'Location':
253  $par =& $this->__getParent();
254  $this->md_loc =& $par->addLocation();
255  $this->md_loc->setLocationType($a_attribs['Type']);
256  $this->md_loc->save();
257  $this->__pushParent($this->md_loc);
258  break;
259 
260  case 'Requirement':
261  $par =& $this->__getParent();
262  $this->md_req =& $par->addRequirement();
263  $this->md_req->save();
264  $this->__pushParent($this->md_req);
265  break;
266 
267  case 'OrComposite':
268  $par =& $this->__getParent();
269  $this->md_orc =& $par->addOrComposite();
270  $this->__pushParent($this->md_orc);
271  break;
272 
273  case 'Type':
274  break;
275 
276  case 'OperatingSystem':
277  $par =& $this->__getParent();
278  $par->setOperatingSystemName($a_attribs['Name']);
279  $par->setOperatingSystemMinimumVersion($a_attribs['MinimumVersion']);
280  $par->setOperatingSystemMaximumVersion($a_attribs['MaximumVersion']);
281  break;
282 
283  case 'Browser':
284  $par =& $this->__getParent();
285  $par->setBrowserName($a_attribs['Name']);
286  $par->setBrowserMinimumVersion($a_attribs['MinimumVersion']);
287  $par->setBrowserMaximumVersion($a_attribs['MaximumVersion']);
288  break;
289 
290  case 'InstallationRemarks':
291  $par =& $this->__getParent();
292  $par->setInstallationRemarksLanguage(new ilMDLanguageItem($a_attribs['Language']));
293  break;
294 
295  case 'OtherPlatformRequirements':
296  $par =& $this->__getParent();
297  $par->setOtherPlatformRequirementsLanguage(new ilMDLanguageItem($a_attribs['Language']));
298  break;
299 
300  case 'Duration':
301  break;
302 
303  case 'Educational':
304  $par =& $this->__getParent();
305  $this->md_edu =& $par->addEducational();
306  $this->md_edu->setInteractivityType($a_attribs['InteractivityType']);
307  $this->md_edu->setLearningResourceType($a_attribs['LearningResourceType']);
308  $this->md_edu->setInteractivityLevel($a_attribs['InteractivityLevel']);
309  $this->md_edu->setSemanticDensity($a_attribs['SemanticDensity']);
310  $this->md_edu->setIntendedEndUserRole($a_attribs['IntendedEndUserRole']);
311  $this->md_edu->setContext($a_attribs['Context']);
312  $this->md_edu->setDifficulty($a_attribs['Difficulty']);
313  $this->md_edu->save();
314  $this->__pushParent($this->md_edu);
315  break;
316 
317  case 'TypicalAgeRange':
318  $par =& $this->__getParent();
319  $this->md_typ =& $par->addTypicalAgeRange();
320  $this->md_typ->setTypicalAgeRangeLanguage(new ilMDLanguageItem($a_attribs['Language']));
321  $this->md_typ->save();
322  $this->__pushParent($this->md_typ);
323  break;
324 
325  case 'TypicalLearningTime':
326  break;
327 
328  case 'Rights':
329  $par =& $this->__getParent();
330  $this->md_rig =& $par->addRights();
331  $this->md_rig->setCosts($a_attribs['Cost']);
332  $this->md_rig->setCopyrightAndOtherRestrictions($a_attribs['CopyrightAndOtherRestrictions']);
333  $this->md_rig->save();
334  $this->__pushParent($this->md_rig);
335  break;
336 
337  case 'Relation':
338  $par =& $this->__getParent();
339  $this->md_rel =& $par->addRelation();
340  $this->md_rel->setKind($a_attribs['Kind']);
341  $this->md_rel->save();
342  $this->__pushParent($this->md_rel);
343  break;
344 
345  case 'Resource':
346  break;
347 
348  case 'Identifier_':
349  $par =& $this->__getParent();
350  $this->md_ide_ =& $par->addIdentifier_();
351  $this->md_ide_->setCatalog($a_attribs['Catalog']);
352  $this->md_ide_->setEntry($a_attribs['Entry']);
353  $this->md_ide_->save();
354  $this->__pushParent($this->md_ide_);
355  break;
356 
357  case 'Annotation':
358  $par =& $this->__getParent();
359  $this->md_ann =& $par->addAnnotation();
360  $this->md_ann->save();
361  $this->__pushParent($this->md_ann);
362  break;
363 
364  case 'Classification':
365  $par =& $this->__getParent();
366  $this->md_cla =& $par->addClassification();
367  $this->md_cla->setPurpose($a_attribs['Purpose']);
368  $this->md_cla->save();
369  $this->__pushParent($this->md_cla);
370  break;
371 
372  case 'TaxonPath':
373  $par =& $this->__getParent();
374  $this->md_taxp =& $par->addTaxonPath();
375  $this->md_taxp->save();
376  $this->__pushParent($this->md_taxp);
377  break;
378 
379  case 'Source':
380  $par =& $this->__getParent();
381  $par->setSourceLanguage(new ilMDLanguageItem($a_attribs['Language']));
382  break;
383 
384  case 'Taxon':
385  $par =& $this->__getParent();
386  $this->md_tax =& $par->addTaxon();
387  $this->md_tax->setTaxonLanguage(new ilMDLanguageItem($a_attribs['Language']));
388  $this->md_tax->setTaxonId($a_attribs['Id']);
389  $this->md_tax->save();
390  $this->__pushParent($this->md_tax);
391  break;
392  */
393 
394  case 'string':
395  $par = $this->__getParent();
396  if ($this->in("general"))
397  {
398  if ($this->in("title"))
399  {
400  $par->setTitleLanguage(new ilMDLanguageItem($a_attribs['language']));
401  $par->update();
402  }
403  else if ($this->in("description"))
404  {
405  $this->md_des->setDescriptionLanguage(new ilMDLanguageItem($a_attribs['language']));
406  $this->md_des->update();
407  }
408  else if ($this->in("keyword"))
409  {
410  $this->md_key->setKeywordLanguage(new ilMDLanguageItem($a_attribs['language']));
411  $this->md_key->update();
412  }
413  }
414  if ($this->in("lifeCycle"))
415  {
416  if ($this->in("version"))
417  {
418  $par->setVersionLanguage(new ilMDLanguageItem($a_attribs['language']));
419  }
420  }
421 
422  break;
423 
424  }
425  }
+ Here is the call graph for this function:

◆ handlerEndTag()

ilSCORM13MDImporter::handlerEndTag (   $a_xml_parser,
  $a_name 
)

handler for end of element

Definition at line 430 of file class.ilSCORM13MDImporter.php.

References ilMDSaxParser\__getCharacterData(), ilMDSaxParser\__getParent(), ilMDSaxParser\__popParent(), array, getDescription(), ilMDSaxParser\getMDParsingStatus(), getTitle(), in(), setDescription(), and setTitle().

431  {
432 //echo "<br>End TAG: ".$a_name;
433  unset($this->path[count($this->path) - 1]);
434 
435  if(!$this->getMDParsingStatus())
436  {
437  return;
438  }
439  switch($a_name)
440  {
441  case 'metadata':
442  $this->md_parent = array();
443  $this->md_in_md = false;
444  $this->in_meta_data = false;
445  break;
446 
447  case 'general':
448  $par = $this->__getParent();
449  $par->update();
450  $this->__popParent();
451  break;
452 
453  case 'identifier':
454  if ($this->in("general"))
455  {
456  $par = $this->__getParent();
457  $par->update();
458  $this->__popParent();
459  }
460  break;
461 
462  case 'title':
463  // nothing to do here
464  break;
465 
466  case 'language':
467  if ($this->in("general"))
468  {
469  $par = $this->__getParent();
470  $par->setLanguage(new ilMDLanguageItem($this->__getCharacterData()));
471  $par->update();
472  $this->__popParent();
473  }
474  break;
475 
476  case 'description':
477  $par = $this->__getParent();
478  if(strtolower(get_class($par)) == 'ilmddescription')
479  {
480  $this->__popParent();
481  break;
482  }
483  else
484  {
485  // todo
486 // $par->setDescription($this->__getCharacterData());
487  break;
488  }
489 
490  case 'keyword':
491  if ($this->in("general"))
492  {
493  $this->__popParent();
494  }
495  break;
496 
497  // todo
498  /*case 'Coverage':
499  $par =& $this->__getParent();
500  $par->setCoverage($this->__getCharacterData());
501  break;*/
502 
503  case 'lifeCycle':
504  $par = $this->__getParent();
505  $par->update();
506  $this->__popParent();
507  break;
508 
509  case 'version':
510  // nothing to do here
511  break;
512 
513 
514  // todo
515  /*case 'Contribute':
516  $par =& $this->__getParent();
517  $par->update();
518  $this->__popParent();
519  break;
520 
521  case 'Entity':
522  $par =& $this->__getParent();
523 
524  if(strtolower(get_class($par)) == 'ilmdentity')
525  {
526  $par->setEntity($this->__getCharacterData());
527  $par->update();
528  $this->__popParent();
529  }
530  else
531  {
532  // Single element in 'Annotation'
533  $par->setEntity($this->__getCharacterData());
534  }
535  break;
536 
537  case 'Date':
538  $par =& $this->__getParent();
539  $par->setDate($this->__getCharacterData());
540  break;
541 
542  case 'Meta-Metadata':
543  $par =& $this->__getParent();
544  $par->update();
545  $this->__popParent();
546  break;
547 
548  case 'Technical':
549  $par =& $this->__getParent();
550  $par->update();
551  $this->__popParent();
552  break;
553 
554  case 'Format':
555  $par =& $this->__getParent();
556  $par->setFormat($this->__getCharacterData());
557  $par->update();
558  $this->__popParent();
559  break;
560 
561  case 'Size':
562  $par =& $this->__getParent();
563  $par->setSize($this->__getCharacterData());
564  break;
565 
566  case 'Location':
567  $par =& $this->__getParent();
568  $par->setLocation($this->__getCharacterData());
569  $par->update();
570  $this->__popParent();
571  break;
572 
573  case 'Requirement':
574  $par =& $this->__getParent();
575  $par->update();
576  $this->__popParent();
577  break;
578 
579  case 'OrComposite':
580  $this->__popParent();
581  break;
582 
583  case 'Type':
584  break;
585 
586  case 'OperatingSystem':
587  break;
588 
589  case 'Browser':
590  break;
591 
592  case 'InstallationRemarks':
593  $par =& $this->__getParent();
594  $par->setInstallationRemarks($this->__getCharacterData());
595  break;
596 
597  case 'OtherPlatformRequirements':
598  $par =& $this->__getParent();
599  $par->setOtherPlatformRequirements($this->__getCharacterData());
600  break;
601 
602  case 'Duration':
603  $par =& $this->__getParent();
604  $par->setDuration($this->__getCharacterData());
605  break;
606 
607  case 'Educational':
608  $par =& $this->__getParent();
609  $par->update();
610  $this->__popParent();
611  break;
612 
613  case 'TypicalAgeRange':
614  $par =& $this->__getParent();
615  $par->setTypicalAgeRange($this->__getCharacterData());
616  $par->update();
617  $this->__popParent();
618  break;
619 
620  case 'TypicalLearningTime':
621  $par =& $this->__getParent();
622  $par->setTypicalLearningTime($this->__getCharacterData());
623  break;
624 
625  case 'Rights':
626  $par =& $this->__getParent();
627  $par->update();
628  $this->__popParent();
629  break;
630 
631  case 'Relation':
632  $par =& $this->__getParent();
633  $par->update();
634  $this->__popParent();
635  break;
636 
637  case 'Resource':
638  break;
639 
640  case 'Identifier_':
641  $par =& $this->__getParent();
642  $par->update();
643  $this->__popParent();
644  break;
645 
646  case 'Annotation':
647  $par =& $this->__getParent();
648  $par->update();
649  $this->__popParent();
650  break;
651 
652  case 'Classification':
653  $par =& $this->__getParent();
654  $par->update();
655  $this->__popParent();
656  break;
657 
658  case 'TaxonPath':
659  $par =& $this->__getParent();
660  $par->update();
661  $this->__popParent();
662  break;
663 
664  case 'Taxon':
665  $par =& $this->__getParent();
666  $par->setTaxon($this->__getCharacterData());
667  $par->update();
668  $this->__popParent();
669  break;
670 
671  case 'Source':
672  $par =& $this->__getParent();
673  $par->setSource($this->__getCharacterData());
674  break;
675  */
676 
677  case 'string':
678  $par = $this->__getParent();
679  if ($this->in("general"))
680  {
681  if ($this->in("title"))
682  {
683  // set packaget title to first title
684  if ($this->getTitle() == "")
685  {
686  $this->setTitle($this->__getCharacterData());
687  }
688 
689  // parent is General here
690  $par->setTitle($this->__getCharacterData());
691  $par->update();
692  //echo "<br>setTitle (".get_class($par)."): ".$this->__getCharacterData();
693  }
694  if ($this->in("description"))
695  {
696  // set packaget title to first title
697  if ($this->getDescription() == "")
698  {
699  $this->setDescription($this->__getCharacterData());
700  }
701 
702  $this->md_des->setDescription($this->__getCharacterData());
703  $this->md_des->update();
704  }
705  if ($this->in("keyword"))
706  {
707  $par->setKeyword($this->__getCharacterData());
708  $par->update();
709  }
710  }
711  if ($this->in("lifeCycle"))
712  {
713  if ($this->in("version"))
714  {
715  $par->setVersion($this->__getCharacterData());
716  }
717  }
718  break;
719 
720  case 'value':
721  $par = $this->__getParent();
722  if ($this->in("general"))
723  {
724  if ($this->in("structure"))
725  {
726  $map = array (
727  "atomic" => "Atomic",
728  "collection" => "Collection",
729  "networked" => "Networked",
730  "linear" => "Linear",
731  "hierarchical" => "Hierarchical"
732  );
733  if (isset($map[$this->__getCharacterData()]))
734  {
735  // parent is General here
736  $par->setStructure($map[$this->__getCharacterData()]);
737  $par->update();
738  }
739  }
740  }
741  if ($this->in("lifeCycle"))
742  {
743  if ($this->in("status"))
744  {
745  $map = array (
746  "draft" => "Draft",
747  "revised" => "Revised",
748  "unavailable" => "Unavailable",
749  "final" => "Final"
750  );
751  if (isset($map[$this->__getCharacterData()]))
752  {
753  $this->md_lif->setStatus($map[$this->__getCharacterData()]);
754  $this->md_lif->update();
755  }
756  }
757  }
758  break;
759 
760  case 'catalog':
761  if ($this->in("identifier"))
762  {
763  $this->md_ide->setCatalog($this->__getCharacterData());
764  $this->md_ide->update();
765  }
766  break;
767 
768  case 'entry':
769  if ($this->in("identifier"))
770  {
771  $this->md_ide->setEntry($this->__getCharacterData());
772  $this->md_ide->update();
773  }
774  break;
775 
776  }
777  $this->md_chr_data = '';
778  }
setDescription($a_val)
Set description.
Create styles array
The data for the language used.
getDescription()
Get description.
+ Here is the call graph for this function:

◆ import()

ilSCORM13MDImporter::import ( )

Import.

Parameters

Definition at line 91 of file class.ilSCORM13MDImporter.php.

References ilMDSaxParser\getMDObject(), and ilSaxParser\startParsing().

92  {
93  if ($this->metadata_found)
94  {
95  $this->startParsing();
96  $this->getMDObject()->update();
97  }
98  }
startParsing()
stores xml data in array
+ Here is the call graph for this function:

◆ in()

ilSCORM13MDImporter::in (   $a_name)
Parameters

Definition at line 786 of file class.ilSCORM13MDImporter.php.

Referenced by handlerBeginTag(), and handlerEndTag().

787  {
788 // echo "<br>"; var_dump($this->path);
789  if (in_array($a_name, $this->path))
790  {
791  return true;
792  }
793  return false;
794  }
+ Here is the caller graph for this function:

◆ setDescription()

ilSCORM13MDImporter::setDescription (   $a_val)

Set description.

Parameters
string$a_valdescription

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

Referenced by handlerEndTag().

71  {
72  $this->description = $a_val;
73  }
+ Here is the caller graph for this function:

◆ setTitle()

ilSCORM13MDImporter::setTitle (   $a_val)

Set title.

Parameters
string$a_valtitle

Definition at line 50 of file class.ilSCORM13MDImporter.php.

Referenced by handlerEndTag().

51  {
52  $this->title = $a_val;
53  }
+ Here is the caller graph for this function:

Field Documentation

◆ $description

ilSCORM13MDImporter::$description = ""
protected

Definition at line 20 of file class.ilSCORM13MDImporter.php.

Referenced by getDescription().

◆ $manifest_dom

ilSCORM13MDImporter::$manifest_dom
protected

Definition at line 16 of file class.ilSCORM13MDImporter.php.

◆ $metadata_found

ilSCORM13MDImporter::$metadata_found = false
protected

Definition at line 17 of file class.ilSCORM13MDImporter.php.

◆ $path

ilSCORM13MDImporter::$path = array()
protected

Definition at line 18 of file class.ilSCORM13MDImporter.php.

Referenced by __construct().

◆ $title

ilSCORM13MDImporter::$title = ""
protected

Definition at line 19 of file class.ilSCORM13MDImporter.php.

Referenced by getTitle().


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