ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 }
28
33 public function init()
34 {
35 }
36
37 public function getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
38 {
39 if($a_entity != 'struct')
40 {
41 return;
42 }
43
44
45 $res = array();
46
47 // pages
48
49 $pg_ids = array();
50
51 // container pages
52 include_once("./Services/Container/classes/class.ilContainerPage.php");
53 foreach($a_ids as $id)
54 {
55 if(ilContainerPage::_exists("cont", $id))
56 {
57 $pg_ids[] = "cont:".$id;
58 }
59 }
60
61 // container start objects pages
62 include_once("./Services/Container/classes/class.ilContainerStartObjectsPage.php");
63 foreach($a_ids as $id)
64 {
66 {
67 $pg_ids[] = "cstr:".$id;
68 }
69 }
70
71 if(sizeof($pg_ids))
72 {
73 $res[] = array(
74 "component" => "Services/COPage",
75 "entity" => "pg",
76 "ids" => $pg_ids
77 );
78 }
79
80 // style
81 $style_ids = array();
82 foreach($a_ids as $id)
83 {
84 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
85 $style_id = ilObjStyleSheet::lookupObjectStyle($id);
86 if($style_id > 0)
87 {
88 $style_ids[] = $style_id;
89 }
90 }
91 if(sizeof($style_ids))
92 {
93 $res[] = array(
94 "component" => "Services/Style",
95 "entity" => "sty",
96 "ids" => $style_ids
97 );
98 }
99
100 return $res;
101 }
102
110 public function getXmlRepresentation($a_entity, $a_schema_version, $a_id)
111 {
112 if($a_entity == 'struct')
113 {
114 $GLOBALS['ilLog']->write(__METHOD__.': Received id = '.$a_id);
116 $writer->write();
117 return $writer->xmlDumpMem(false);
118 }
119 }
120
128 public function getValidSchemaVersions($a_entity)
129 {
130 return array (
131 "4.1.0" => array(
132 "namespace" => "http://www.ilias.de/Modules/Folder/fold/4_1",
133 "xsd_file" => "ilias_fold_4_1.xsd",
134 "uses_dataset" => false,
135 "min" => "4.1.0",
136 "max" => "")
137 );
138 }
139}
140?>
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.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276