ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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)
 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...
 
 __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 ()
 
 __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 @access 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 @access 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

return

Reimplemented from ilSaxParser.

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

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 foreach ($items as $i) {
36 //echo htmlentities($a_manifest_dom->saveXML($i)); exit;
37 parent::__construct($a_manifest_dom->saveXML($i), $a_obj_id, $a_obj_id, ilObject::_lookupType($a_obj_id));
38 $this->metadata_found = true;
39 }
40 }
41 }
static _lookupType($a_id, $a_reference=false)
lookup object type
$i
Definition: disco.tpl.php:19

References $i, $path, and ilObject\_lookupType().

+ Here is the call graph for this function:

Member Function Documentation

◆ getDescription()

ilSCORM13MDImporter::getDescription ( )

Get description.

Returns
string description

Definition at line 78 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 58 of file class.ilSCORM13MDImporter.php.

References $title.

Referenced by handlerEndTag().

+ Here is the caller graph for this function:

◆ handlerBeginTag()

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

handler for begin of element

Reimplemented from ilMDXMLCopier.

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

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

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

+ Here is the call graph for this function:

◆ handlerEndTag()

ilSCORM13MDImporter::handlerEndTag (   $a_xml_parser,
  $a_name 
)

handler for end of element

Reimplemented from ilMDXMLCopier.

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

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

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

+ Here is the call graph for this function:

◆ import()

ilSCORM13MDImporter::import ( )

Import.

Parameters

return

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

90 {
91 if ($this->metadata_found) {
92 $this->startParsing();
93 $this->getMDObject()->update();
94 }
95 }
startParsing()
stores xml data in array

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

+ Here is the call graph for this function:

◆ in()

ilSCORM13MDImporter::in (   $a_name)
Parameters

return

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

745 {
746 // echo "<br>"; var_dump($this->path);
747 if (in_array($a_name, $this->path)) {
748 return true;
749 }
750 return false;
751 }

Referenced by handlerBeginTag(), and handlerEndTag().

+ Here is the caller graph for this function:

◆ setDescription()

ilSCORM13MDImporter::setDescription (   $a_val)

Set description.

Parameters
string$a_valdescription

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

69 {
70 $this->description = $a_val;
71 }

Referenced by handlerEndTag().

+ Here is the caller graph for this function:

◆ setTitle()

ilSCORM13MDImporter::setTitle (   $a_val)

Set title.

Parameters
string$a_valtitle

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

49 {
50 $this->title = $a_val;
51 }

Referenced by handlerEndTag().

+ 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: