ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilContainerExporter.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4
5include_once './Services/Container/classes/class.ilContainerXmlWriter.php';
6include_once './Services/Export/classes/class.ilXmlExporter.php';
7
18{
19 private $writer = null;
20
24 public function __construct()
25 {
26 }
27
32 public function init()
33 {
34 }
35
36 public function getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
37 {
38 if ($a_entity != 'struct') {
39 return;
40 }
41
42
43 $res = array();
44
45 // pages
46
47 $pg_ids = array();
48
49 // container pages
50 include_once("./Services/Container/classes/class.ilContainerPage.php");
51 foreach ($a_ids as $id) {
52 if (ilContainerPage::_exists("cont", $id)) {
53 $pg_ids[] = "cont:" . $id;
54 }
55 }
56
57 // container start objects pages
58 include_once("./Services/Container/classes/class.ilContainerStartObjectsPage.php");
59 foreach ($a_ids as $id) {
61 $pg_ids[] = "cstr:" . $id;
62 }
63 }
64
65 if (sizeof($pg_ids)) {
66 $res[] = array(
67 "component" => "Services/COPage",
68 "entity" => "pg",
69 "ids" => $pg_ids
70 );
71 }
72
73 // style
74 $style_ids = array();
75 foreach ($a_ids as $id) {
76 include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
78 if ($style_id > 0) {
79 $style_ids[] = $style_id;
80 }
81 }
82 if (sizeof($style_ids)) {
83 $res[] = array(
84 "component" => "Services/Style",
85 "entity" => "sty",
86 "ids" => $style_ids
87 );
88 }
89
90 return $res;
91 }
92
100 public function getXmlRepresentation($a_entity, $a_schema_version, $a_id)
101 {
102 if ($a_entity == 'struct') {
103 $GLOBALS['ilLog']->write(__METHOD__ . ': Received id = ' . $a_id);
105 $writer->write();
106 return $writer->xmlDumpMem(false);
107 }
108 }
109
117 public function getValidSchemaVersions($a_entity)
118 {
119 return array(
120 "4.1.0" => array(
121 "namespace" => "http://www.ilias.de/Modules/Folder/fold/4_1",
122 "xsd_file" => "ilias_fold_4_1.xsd",
123 "uses_dataset" => false,
124 "min" => "4.1.0",
125 "max" => "")
126 );
127 }
128}
An exception for terminatinating execution or to throw for unit testing.
container structure export
getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
Get tail dependencies.
getValidSchemaVersions($a_entity)
Returns schema versions that the component can export to.
getXmlRepresentation($a_entity, $a_schema_version, $a_id)
Get xml.
XML writer for container structure.
static lookupObjectStyle($a_obj_id)
Lookup object style.
static _getAllReferences($a_id)
get all reference ids of object
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
Xml Exporter class.
if(!array_key_exists('StateId', $_REQUEST)) $id
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
foreach($_POST as $key=> $value) $res