ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
class.ilContainerExporter.php
Go to the documentation of this file.
1<?php
2
25{
26 protected \ILIAS\Style\Content\DomainService $content_style_domain;
27
28 public function __construct()
29 {
30 global $DIC;
31 $this->content_style_domain = $DIC->contentStyle()
32 ->domain();
33 }
34
35 public function init(): void
36 {
37 }
38
39 public function getXmlExportTailDependencies(string $a_entity, string $a_target_release, array $a_ids): array
40 {
41 if ($a_entity !== 'struct') {
42 return [];
43 }
44
45
46 $res = [];
47
48 // pages
49
50 $pg_ids = [];
51
52 // container pages
53 foreach ($a_ids as $id) {
54 if (ilContainerPage::_exists("cont", (int) $id)) {
55 $pg_ids[] = "cont:" . $id;
56 }
57 }
58
59 // container start objects pages
60 foreach ($a_ids as $id) {
61 if (ilContainerStartObjectsPage::_exists("cstr", (int) $id)) {
62 $pg_ids[] = "cstr:" . $id;
63 }
64 }
65
66 if (count($pg_ids)) {
67 $res[] = [
68 "component" => "components/ILIAS/COPage",
69 "entity" => "pg",
70 "ids" => $pg_ids
71 ];
72 }
73
74 // style
75 $style_ids = [];
76 foreach ($a_ids as $id) {
77 // see #24888
78 $style = $this->content_style_domain->styleForObjId((int) $id);
79 $style_id = $style->getExportStyleId();
80 if ($style_id > 0) {
81 $style_ids[] = $style_id;
82 }
83 }
84 if (count($style_ids)) {
85 $res[] = [
86 "component" => "components/ILIAS/Style",
87 "entity" => "sty",
88 "ids" => $style_ids
89 ];
90 }
91
92 // service settings
93 $res[] = [
94 "component" => "components/ILIAS/ILIASObject",
95 "entity" => "common",
96 "ids" => $a_ids
97 ];
98
99 // skill profiles
100 $res[] = [
101 "component" => "components/ILIAS/Skill",
102 "entity" => "skl_local_prof",
103 "ids" => $a_ids
104 ];
105
106 // news settings
107 $res[] = [
108 "component" => "components/ILIAS/News",
109 "entity" => "news_settings",
110 "ids" => $a_ids
111 ];
112
113 // conditions settings
114 $res[] = [
115 "component" => "components/ILIAS/Conditions",
116 "entity" => "cond",
117 "ids" => $a_ids
118 ];
119
120 return $res;
121 }
122
123 public function getXmlRepresentation(string $a_entity, string $a_schema_version, string $a_id): string
124 {
125 global $DIC;
126
127 $log = $DIC->logger()->root();
128 if ($a_entity === 'struct') {
129 $log->debug(__METHOD__ . ': Received id = ' . $a_id);
130 $ref_ids = ilObject::_getAllReferences((int) $a_id);
131 $writer = new ilContainerXmlWriter(end($ref_ids));
132 $writer->write();
133 return $writer->xmlDumpMem(false);
134 }
135 return "";
136 }
137
144 public function getValidSchemaVersions(string $a_entity): array
145 {
146 return [
147 "4.1.0" => [
148 "namespace" => "https://www.ilias.de/Modules/Folder/fold/4_1",
149 "xsd_file" => "ilias_fold_4_1.xsd",
150 "uses_dataset" => false,
151 "min" => "4.1.0",
152 "max" => ""
153 ]
154 ];
155 }
156}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS Style Content DomainService $content_style_domain
getXmlExportTailDependencies(string $a_entity, string $a_target_release, array $a_ids)
Get tail dependencies.
getValidSchemaVersions(string $a_entity)
Returns schema versions that the component can export to.
getXmlRepresentation(string $a_entity, string $a_schema_version, string $a_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getAllReferences(int $id)
get all reference ids for object ID
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
Xml Exporter class.
$log
Definition: ltiresult.php:34
$res
Definition: ltiservices.php:69
global $DIC
Definition: shib_login.php:26