ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 
5 include_once './Services/Container/classes/class.ilContainerXmlWriter.php';
6 include_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");
77  $style_id = ilObjStyleSheet::lookupObjectStyle($id);
78  // see #24888
79  $style_id = ilObjStyleSheet::getEffectiveContentStyleId($style_id);
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  // news settings
99  $res[] = [
100  "component" => "Services/News",
101  "entity" => "news_settings",
102  "ids" => $a_ids
103  ];
104 
105  return $res;
106  }
107 
115  public function getXmlRepresentation($a_entity, $a_schema_version, $a_id)
116  {
117  global $DIC;
118 
119  $log = $DIC->logger()->root();
120  if ($a_entity == 'struct') {
121  $log->debug(__METHOD__ . ': Received id = ' . $a_id);
123  $writer->write();
124  return $writer->xmlDumpMem(false);
125  }
126  }
127 
135  public function getValidSchemaVersions($a_entity)
136  {
137  return array(
138  "4.1.0" => array(
139  "namespace" => "http://www.ilias.de/Modules/Folder/fold/4_1",
140  "xsd_file" => "ilias_fold_4_1.xsd",
141  "uses_dataset" => false,
142  "min" => "4.1.0",
143  "max" => "")
144  );
145  }
146 }
container structure export
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
getValidSchemaVersions($a_entity)
Returns schema versions that the component can export to.
global $DIC
Definition: saml.php:7
if(!array_key_exists('StateId', $_REQUEST)) $id
$log
Definition: sabredav.php:21
static lookupObjectStyle($a_obj_id)
Lookup object style.
static _getAllReferences($a_id)
get all reference ids of object
Xml Exporter class.
foreach($_POST as $key=> $value) $res
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
XML writer for container structure.
getXmlRepresentation($a_entity, $a_schema_version, $a_id)
Get xml.
getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)