ILIAS  release_4-4 Revision
ilLearningModuleImporter Class Reference

Importer class for files. More...

+ Inheritance diagram for ilLearningModuleImporter:
+ Collaboration diagram for ilLearningModuleImporter:

Public Member Functions

 importXmlRepresentation ($a_entity, $a_id, $a_xml, $a_mapping)
 Import XML. More...
 
- Public Member Functions inherited from ilXmlImporter
 __construct ()
 Constructor. 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...
 
 importXmlRepresentation ($a_entity, $a_id, $a_xml, $a_mapping)
 Import xml representation. More...
 
 finalProcessing ($a_mapping)
 Final processing. More...
 

Additional Inherited Members

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

Detailed Description

Importer class for files.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id

Definition at line 13 of file class.ilLearningModuleImporter.php.

Member Function Documentation

◆ importXmlRepresentation()

ilLearningModuleImporter::importXmlRepresentation (   $a_entity,
  $a_id,
  $a_xml,
  $a_mapping 
)

Import XML.

Parameters

Definition at line 21 of file class.ilLearningModuleImporter.php.

References $GLOBALS, ilXmlImporter\getImportDirectory(), and ilObjectFactory\getInstanceByObjId().

22  {
23  include_once './Modules/File/classes/class.ilObjFile.php';
24 
25  // case i container
26  if($new_id = $a_mapping->getMapping('Services/Container','objs',$a_id))
27  {
28  $newObj = ilObjectFactory::getInstanceByObjId($new_id,false);
29  $newObj->createLMTree();
30  $newObj->setImportDirectory(dirname(rtrim($this->getImportDirectory(),'/')));
31  }
32  else // case ii, non container
33  {
34  // Shouldn't happen
35  $GLOBALS['ilLog']->write(__METHOD__.': Called in non container mode');
36  return false;
37  }
38 
39  $mess = $newObj->importFromDirectory($this->getImportDirectory(),true);
40  $GLOBALS['ilLog']->write(__METHOD__.': Import message is: '.$mess);
41 
42  $a_mapping->addMapping("Modules/LearningModule", "lm", $a_id, $newObj->getId());
43  }
getImportDirectory()
Get import directory.
$GLOBALS['ct_recipient']
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
+ Here is the call graph for this function:

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