ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilScormAiccImporter Class Reference
+ Inheritance diagram for ilScormAiccImporter:
+ Collaboration diagram for ilScormAiccImporter:

Public Member Functions

 __construct ()
 
 init ()
 
 importXmlRepresentation ($a_entity, $a_id, $a_import_dirname, $a_mapping)
 Import XML. More...
 
 writeData ($a_entity, $version, $a_id)
 
- Public Member Functions inherited from ilXmlImporter
 __construct ()
 Constructor. More...
 
 setImport ($a_val)
 Set import. More...
 
 getImport ()
 Get import. More...
 
 init ()
 Init. More...
 
 setInstallId ($a_val)
 Set installation id. More...
 
 getInstallId ()
 Get installation id. More...
 
 setInstallUrl ($a_val)
 Set installation url. More...
 
 getInstallUrl ()
 Get installation url. More...
 
 setSchemaVersion ($a_val)
 Set schema version. More...
 
 getSchemaVersion ()
 Get schema version. More...
 
 setImportDirectory ($a_val)
 Set import directory. More...
 
 getImportDirectory ()
 Get import directory. More...
 
 setSkipEntities ($a_val)
 Set skip entities. More...
 
 getSkipEntities ()
 Get skip entities. More...
 
 exportedFromSameInstallation ()
 Is exporting and importing installation identical? More...
 
 importXmlRepresentation ($a_entity, $a_id, $a_xml, $a_mapping)
 Import xml representation. More...
 
 finalProcessing ($a_mapping)
 Final processing. More...
 
 afterContainerImportProcessing (ilImportMapping $mapping)
 Called after all container objects have been implemented. More...
 

Additional Inherited Members

- Protected Attributes inherited from ilXmlImporter
 $skip_entities = array()
 
 $imp
 

Detailed Description

Definition at line 4 of file class.ilScormAiccImporter.php.

Constructor & Destructor Documentation

◆ __construct()

ilScormAiccImporter::__construct ( )

Definition at line 6 of file class.ilScormAiccImporter.php.

7  {
8  require_once "./Modules/ScormAicc/classes/class.ilScormAiccDataSet.php";
9  $this->dataset = new ilScormAiccDataSet ();
10  //todo: at the moment restricted to one module in xml file, extend?
11  $this->moduleProperties = [];
12  $this->manifest = [];
13  }

Member Function Documentation

◆ importXmlRepresentation()

ilScormAiccImporter::importXmlRepresentation (   $a_entity,
  $a_id,
  $a_import_dirname,
  $a_mapping 
)

Import XML.

Parameters

Definition at line 25 of file class.ilScormAiccImporter.php.

References $ilLog, and $result.

26  {
27  global $ilLog;
28  $result = false;
29  if (file_exists($a_import_dirname))
30  {
31  $manifestFile = $a_import_dirname . "/manifest.xml";
32  if (file_exists($manifestFile))
33  {
34  $manifest = file_get_contents ($manifestFile);
35  $manifestRoot = simplexml_load_string($manifest);
36  $this->manifest["scormFile"] = $manifestRoot->scormFile;
37  $this->manifest["properties"] = $manifestRoot->properties;
38  if(isset ($manifest))
39  {
40  $propertiesFile = $a_import_dirname . "/" . $this->manifest["properties"][0];
41  $xml = file_get_contents ($propertiesFile);
42  if(isset ($xml))
43  {
44  $xmlRoot = simplexml_load_string($xml);
45  //todo: extend for import of multiple modules in one file ??
46  foreach ($this->dataset->properties as $key => $value)
47  {
48  $this->moduleProperties[$key] = $xmlRoot->$key;
49  }
50  $this->moduleProperties["Title"] = $xmlRoot->Title;
51  $this->moduleProperties["Description"] = $xmlRoot->Description;
52  $result = true;
53  }
54  else
55  {
56  $ilLog->write("error parsing xml file for scorm import");
57  //error xml parsing
58  }
59  }
60  else
61  {
62  $ilLog->write("error reading manifest file");
63  }
64  }
65  else
66  {
67  $ilLog->write("error no manifest file found");
68  }
69  }
70  else
71  {
72  $ilLog->write("error file lost while importing");
73  //error non existing file
74  }
75  return $result;
76  }
$result

◆ init()

ilScormAiccImporter::init ( )

Definition at line 15 of file class.ilScormAiccImporter.php.

16  {
17  }

◆ writeData()

ilScormAiccImporter::writeData (   $a_entity,
  $version,
  $a_id 
)

Definition at line 78 of file class.ilScormAiccImporter.php.

79  {
80  $this->dataset->writeData($a_entity, $a_version, $a_id, $this->moduleProperties);
81  }

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