ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilContainerImporter.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("./Services/Export/classes/class.ilXmlImporter.php");
5
16{
17
18
19 public function init()
20 {
21 }
22
29 function importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
30 {
31 include_once './Services/Container/classes/class.ilContainerXmlParser.php';
32
37 $log->debug('Import xml: '. $a_xml);
38 $log->debug('Using id: ' . $a_id);
39
40 $parser = new ilContainerXmlParser($a_mapping,trim($a_xml));
41 $parser->parse($a_id);
42 }
43
44 function finalProcessing($a_mapping)
45 {
46 // pages
47 include_once('./Services/COPage/classes/class.ilPageObject.php');
48 $page_map = $a_mapping->getMappingsOfEntity('Services/COPage', 'pg');
49 foreach ($page_map as $old_pg_id => $new_pg_id)
50 {
51 $parts = explode(':', $old_pg_id);
52 $pg_type = $parts[0];
53 $old_obj_id = $parts[1];
54 $new_pg_id = array_pop(explode(':', $new_pg_id));
55 $new_obj_id = $a_mapping->getMapping('Services/Container', 'objs', $old_obj_id);
56 ilPageObject::_writeParentId($pg_type, $new_pg_id, $new_obj_id);
57 }
58
59 // style
60 include_once('./Services/Style/classes/class.ilObjStyleSheet.php');
61 $sty_map = $a_mapping->getMappingsOfEntity('Services/Style', 'sty');
62 foreach ($sty_map as $old_sty_id => $new_sty_id)
63 {
64 if(is_array(ilContainerXmlParser::$style_map[$old_sty_id]))
65 {
66 foreach(ilContainerXmlParser::$style_map[$old_sty_id] as $obj_id)
67 {
68 ilObjStyleSheet::writeStyleUsage($obj_id, $new_sty_id);
69 }
70 }
71 }
72 }
73}
74?>
container xml importer
finalProcessing($a_mapping)
Final processing.
XML parser for container structure.
static getLogger($a_component_id)
Get component logger.
static writeStyleUsage($a_obj_id, $a_style_id)
Write style usage.
_writeParentId($a_parent_type, $a_pg_id, $a_par_id)
Write parent id.
Xml importer class.
importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
Import xml representation.