ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilContainerImporter Class Reference

container xml importer More...

+ Inheritance diagram for ilContainerImporter:
+ Collaboration diagram for ilContainerImporter:

Public Member Functions

 init ()
 Init. More...
 
 importXmlRepresentation ($a_entity, $a_id, $a_xml, $a_mapping)
 Import XML. More...
 
 finalProcessing ($a_mapping)
 Final processing.
Parameters
arraymapping array
More...
 
- 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...
 

Protected Attributes

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

Detailed Description

container 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.ilContainerImporter.php.

Member Function Documentation

◆ finalProcessing()

ilContainerImporter::finalProcessing (   $a_mapping)

Final processing.

Parameters
arraymapping array

Reimplemented from ilXmlImporter.

Definition at line 47 of file class.ilContainerImporter.php.

48 {
49 // pages
50 include_once('./Services/COPage/classes/class.ilPageObject.php');
51 $page_map = $a_mapping->getMappingsOfEntity('Services/COPage', 'pg');
52 foreach ($page_map as $old_pg_id => $new_pg_id) {
53 $parts = explode(':', $old_pg_id);
54 $pg_type = $parts[0];
55 $old_obj_id = $parts[1];
56 $new_pg_id = array_pop(explode(':', $new_pg_id));
57 $new_obj_id = $a_mapping->getMapping('Services/Container', 'objs', $old_obj_id);
58 // see bug #22718, this missed a check for the pg type
59 if (in_array($pg_type, array("crs", "grp", "fold", "cont"))) {
60 if ($new_obj_id > 0) {
61 ilPageObject::_writeParentId($pg_type, $new_pg_id, $new_obj_id);
62 $this->cont_log->debug('write parent id, type: ' . $pg_type . ", page id: " . $new_pg_id . ", parent id: " . $new_obj_id);
63 }
64 }
65 }
66
67 // style
68 include_once('./Services/Style/Content/classes/class.ilObjStyleSheet.php');
69 $sty_map = $a_mapping->getMappingsOfEntity('Services/Style', 'sty');
70 foreach ($sty_map as $old_sty_id => $new_sty_id) {
71 if (is_array(ilContainerXmlParser::$style_map[$old_sty_id])) {
72 foreach (ilContainerXmlParser::$style_map[$old_sty_id] as $obj_id) {
73 ilObjStyleSheet::writeStyleUsage($obj_id, $new_sty_id);
74 }
75 }
76 }
77 }
static writeStyleUsage($a_obj_id, $a_style_id)
Write style usage.
static _writeParentId($a_parent_type, $a_pg_id, $a_par_id)
Write parent id.

References ilContainerXmlParser\$style_map, ilPageObject\_writeParentId(), and ilObjStyleSheet\writeStyleUsage().

+ Here is the call graph for this function:

◆ importXmlRepresentation()

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

Import XML.

Import xml representation.

Parameters
stringentity
stringtarget release
stringid
Returns
string xml string

Reimplemented from ilXmlImporter.

Definition at line 33 of file class.ilContainerImporter.php.

34 {
35 include_once './Services/Container/classes/class.ilContainerXmlParser.php';
36
37 $this->cont_log->debug('Import xml: ' . $a_xml);
38 $this->cont_log->debug('Using id: ' . $a_id);
39
40 $parser = new ilContainerXmlParser($a_mapping, trim($a_xml));
41 $parser->parse($a_id);
42 }
$parser
Definition: BPMN2Parser.php:23
XML parser for container structure.

References $parser.

◆ init()

ilContainerImporter::init ( )

Init.

Reimplemented from ilXmlImporter.

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

24 {
25 $this->cont_log = ilLoggerFactory::getLogger('cont');
26 }
static getLogger($a_component_id)
Get component logger.

References ilLoggerFactory\getLogger().

+ Here is the call graph for this function:

Field Documentation

◆ $cont_log

ilContainerImporter::$cont_log
protected

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


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