ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilFolderExporter.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 './Modules/Folder/classes/class.ilFolderXmlWriter.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
45 public function getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
46 {
47 // always trigger container because of co-page(s)
48 return array(
49 array(
50 'component' => 'Services/Container',
51 'entity' => 'struct',
52 'ids' => $a_ids
53 )
54 );
55
56 /*
57 include_once './Services/Export/classes/class.ilExportOptions.php';
58 $eo = ilExportOptions::getInstance();
59
60 $obj_id = end($a_ids);
61
62 if($eo->getOption(ilExportOptions::KEY_ROOT) != $obj_id)
63 {
64 return array();
65 }
66 if(count(ilExportOptions::getInstance()->getSubitemsForExport()) > 1)
67 {
68 return array(
69 array(
70 'component' => 'Services/Container',
71 'entity' => 'struct',
72 'ids' => $a_ids
73 )
74 );
75 }
76 return array();
77 */
78 }
79
80
88 public function getXmlRepresentation($a_entity, $a_schema_version, $a_id)
89 {
90 try
91 {
92 $this->writer = new ilFolderXmlWriter(false);
93 $this->writer->setObjId($a_id);
94 $this->writer->write();
95 return $this->writer->xmlDumpMem(false);
96
97 }
98 catch(UnexpectedValueException $e)
99 {
100 $GLOBALS['ilLog']->write("Caught error: ".$e->getMessage());
101 return '';
102 }
103 }
104
112 public function getValidSchemaVersions($a_entity)
113 {
114 return array (
115 "4.1.0" => array(
116 "namespace" => "http://www.ilias.de/Modules/Folder/fold/4_1",
117 "xsd_file" => "ilias_fold_4_1.xsd",
118 "uses_dataset" => false,
119 "min" => "4.1.0",
120 "max" => "")
121 );
122 }
123}
124?>
getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
Get head dependencies.
getXmlRepresentation($a_entity, $a_schema_version, $a_id)
Get xml.
getValidSchemaVersions($a_entity)
Returns schema versions that the component can export to.
XML writer for folders.
Xml Exporter class.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276