ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
5 include_once './Modules/Folder/classes/class.ilFolderXmlWriter.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 
44  public function getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
45  {
46  // always trigger container because of co-page(s)
47  return array(
48  array(
49  'component' => 'Services/Container',
50  'entity' => 'struct',
51  'ids' => $a_ids
52  )
53  );
54 
55  /*
56  include_once './Services/Export/classes/class.ilExportOptions.php';
57  $eo = ilExportOptions::getInstance();
58 
59  $obj_id = end($a_ids);
60 
61  if($eo->getOption(ilExportOptions::KEY_ROOT) != $obj_id)
62  {
63  return array();
64  }
65  if(count(ilExportOptions::getInstance()->getSubitemsForExport()) > 1)
66  {
67  return array(
68  array(
69  'component' => 'Services/Container',
70  'entity' => 'struct',
71  'ids' => $a_ids
72  )
73  );
74  }
75  return array();
76  */
77  }
78 
79 
87  public function getXmlRepresentation($a_entity, $a_schema_version, $a_id)
88  {
89  try {
90  $this->writer = new ilFolderXmlWriter(false);
91  $this->writer->setObjId($a_id);
92  $this->writer->write();
93  return $this->writer->xmlDumpMem(false);
94  } catch (UnexpectedValueException $e) {
95  $GLOBALS['ilLog']->write("Caught error: " . $e->getMessage());
96  return '';
97  }
98  }
99 
107  public function getValidSchemaVersions($a_entity)
108  {
109  return array(
110  "4.1.0" => array(
111  "namespace" => "http://www.ilias.de/Modules/Folder/fold/4_1",
112  "xsd_file" => "ilias_fold_4_1.xsd",
113  "uses_dataset" => false,
114  "min" => "4.1.0",
115  "max" => "")
116  );
117  }
118 }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Xml Exporter class.
XML writer for folders.
getValidSchemaVersions($a_entity)
Returns schema versions that the component can export to.
getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
Get head dependencies.
Create styles array
The data for the language used.
__construct()
Constructor.
getXmlRepresentation($a_entity, $a_schema_version, $a_id)
Get xml.