ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilFolderImporter Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilFolderImporter:
+ Collaboration diagram for ilFolderImporter:

Public Member Functions

 init ()
 
 importXmlRepresentation (string $a_entity, string $a_id, string $a_xml, ilImportMapping $a_mapping)
 
- Public Member Functions inherited from ilXmlImporter
 __construct ()
 
 setImport (ilImport $a_val)
 
 getImport ()
 
 init ()
 
 setInstallId (string $a_val)
 
 getInstallId ()
 
 setInstallUrl (string $a_val)
 
 getInstallUrl ()
 
 setSchemaVersion (string $a_val)
 
 getSchemaVersion ()
 
 setImportDirectory (string $a_val)
 
 getImportDirectory ()
 
 setSkipEntities (array $a_val)
 
 getSkipEntities ()
 
 exportedFromSameInstallation ()
 
 importXmlRepresentation (string $a_entity, string $a_id, string $a_xml, ilImportMapping $a_mapping)
 
 finalProcessing (ilImportMapping $a_mapping)
 
 afterContainerImportProcessing (ilImportMapping $mapping)
 

Private Attributes

ilObject $folder = null
 

Additional Inherited Members

- Protected Attributes inherited from ilXmlImporter
array $skip_entities = array()
 
ilImport $imp
 
string $install_id
 
string $install_url
 
string $schema_version
 
string $import_directory
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too. If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning folder xml importer

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

Definition at line 23 of file class.ilFolderImporter.php.

Member Function Documentation

◆ importXmlRepresentation()

ilFolderImporter::importXmlRepresentation ( string  $a_entity,
string  $a_id,
string  $a_xml,
ilImportMapping  $a_mapping 
)

Definition at line 32 of file class.ilFolderImporter.php.

References Vendor\Package\$e, $GLOBALS, ilImportMapping\addMapping(), ilObjectFactory\getInstanceByObjId(), ilObjectFactory\getInstanceByRefId(), and ilImportMapping\getMapping().

32  : void
33  {
34  if ($new_id = $a_mapping->getMapping('Services/Container', 'objs', $a_id)) {
35  $this->folder = ilObjectFactory::getInstanceByObjId((int) $new_id, false);
36  } elseif ($new_id = $a_mapping->getMapping('Services/Container', 'refs', '0')) {
37  $this->folder = ilObjectFactory::getInstanceByRefId((int) $new_id, false);
38  } elseif (!$this->folder instanceof ilObjFolder) {
39  $this->folder = new ilObjFolder();
40  $this->folder->create();
41  }
42 
43  try {
44  $parser = new ilFolderXmlParser($this->folder, $a_xml);
45  $parser->start();
46  $a_mapping->addMapping('Modules/Folder', 'fold', $a_id, (string) $this->folder->getId());
47  } catch (ilSaxParserException $e) {
48  $GLOBALS['ilLog']->write(__METHOD__ . ': Parsing failed with message, "' . $e->getMessage() . '".');
49  }
50  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
SaxParserException thrown by ilSaxParser if property throwException is set.
addMapping(string $a_comp, string $a_entity, string $a_old_id, string $a_new_id)
getMapping(string $a_comp, string $a_entity, string $a_old_id)
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
XML parser for folder xml.
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
+ Here is the call graph for this function:

◆ init()

ilFolderImporter::init ( )

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

28  : void
29  {
30  }

Field Documentation

◆ $folder

ilObject ilFolderImporter::$folder = null
private

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


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