ILIAS  release_8 Revision v8.23
ilGroupImporter Class Reference

folder xml importer More...

+ Inheritance diagram for ilGroupImporter:
+ Collaboration diagram for ilGroupImporter:

Public Member Functions

 __construct ()
 
 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

ilObjGroup $group = 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

folder xml importer

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

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

Constructor & Destructor Documentation

◆ __construct()

ilGroupImporter::__construct ( )

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

20  {
21  }

Member Function Documentation

◆ importXmlRepresentation()

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

Definition at line 30 of file class.ilGroupImporter.php.

References Vendor\Package\$e, $GLOBALS, $ref_id, ilGroupXMLParser\$UPDATE, ilObject\_getAllReferences(), ilImportMapping\addMapping(), ilObjectFactory\getInstanceByRefId(), and ilImportMapping\getMapping().

35  : void {
36  if ($new_id = $a_mapping->getMapping('Services/Container', 'objs', $a_id)) {
37  $refs = ilObject::_getAllReferences((int) $new_id);
38  $ref_id = end($refs);
39  $this->group = ilObjectFactory::getInstanceByRefId((int) $ref_id, false);
40  } elseif ($new_id = $a_mapping->getMapping('Services/Container', 'refs', "0")) {
41  $this->group = ilObjectFactory::getInstanceByRefId((int) $new_id, false);
42  } elseif (!$this->group instanceof ilObjGroup) {
43  $this->group = new ilObjGroup();
44  $this->group->create();
45  }
46  try {
47  $parser = new ilGroupXMLParser($this->group, $a_xml, 0);
48  $parser->setMode(ilGroupXMLParser::$UPDATE);
49 
50  // avoid duplicate MD sets
51  $this->group->deleteMetaData();
52 
53  $parser->startParsing();
54  $a_mapping->addMapping('Modules/Group', 'grp', $a_id, (string) $this->group->getId());
56  $GLOBALS['DIC']->logger()->grp()->warning('Parsing failed with message, "' . $e->getMessage() . '".');
57  }
58  }
static _getAllReferences(int $id)
get all reference ids for object ID
SaxParserException thrown by ilSaxParser if property throwException is set.
addMapping(string $a_comp, string $a_entity, string $a_old_id, string $a_new_id)
$ref_id
Definition: ltiauth.php:67
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
Group Import Parser.
Class ilObjGroup.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ init()

ilGroupImporter::init ( )

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

23  : void
24  {
25  }

Field Documentation

◆ $group

ilObjGroup ilGroupImporter::$group = null
private

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


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