ILIAS  release_7 Revision v7.30-3-g800a261c036
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) {
60 if (ilContainerStartObjectsPage::_exists("cstr", $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 // see #24888
80 if ($style_id > 0) {
81 $style_ids[] = $style_id;
82 }
83 }
84 if (sizeof($style_ids)) {
85 $res[] = array(
86 "component" => "Services/Style",
87 "entity" => "sty",
88 "ids" => $style_ids
89 );
90 }
91
92 // service settings
93 $res[] = array(
94 "component" => "Services/Object",
95 "entity" => "common",
96 "ids" => $a_ids);
97
98 // skill profiles
99 $res[] = array(
100 "component" => "Services/Skill",
101 "entity" => "skl_local_prof",
102 "ids" => $a_ids);
103
104 // news settings
105 $res[] = [
106 "component" => "Services/News",
107 "entity" => "news_settings",
108 "ids" => $a_ids
109 ];
110
111 return $res;
112 }
113
121 public function getXmlRepresentation($a_entity, $a_schema_version, $a_id)
122 {
123 global $DIC;
124
125 $log = $DIC->logger()->root();
126 if ($a_entity == 'struct') {
127 $log->debug(__METHOD__ . ': Received id = ' . $a_id);
129 $writer->write();
130 return $writer->xmlDumpMem(false);
131 }
132 }
133
141 public function getValidSchemaVersions($a_entity)
142 {
143 return array(
144 "4.1.0" => array(
145 "namespace" => "http://www.ilias.de/Modules/Folder/fold/4_1",
146 "xsd_file" => "ilias_fold_4_1.xsd",
147 "uses_dataset" => false,
148 "min" => "4.1.0",
149 "max" => "")
150 );
151 }
152}
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 getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
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.
global $DIC
Definition: goto.php:24
$log
Definition: result.php:15
foreach($_POST as $key=> $value) $res