ILIAS  release_4-4 Revision
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  }
28 
33  public function init()
34  {
35  }
36 
45  public function getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
46  {
47  include_once './Services/Export/classes/class.ilExportOptions.php';
49 
50  $obj_id = end($a_ids);
51 
52  if($eo->getOption(ilExportOptions::KEY_ROOT) != $obj_id)
53  {
54  return array();
55  }
56  if(count(ilExportOptions::getInstance()->getSubitemsForExport()) > 1)
57  {
58  return array(
59  array(
60  'component' => 'Services/Container',
61  'entity' => 'struct',
62  'ids' => $a_ids
63  )
64  );
65  }
66  return array();
67  }
68 
69 
77  public function getXmlRepresentation($a_entity, $a_schema_version, $a_id)
78  {
79  try
80  {
81  $this->writer = new ilFolderXmlWriter(false);
82  $this->writer->setObjId($a_id);
83  $this->writer->write();
84  return $this->writer->xmlDumpMem(false);
85 
86  }
87  catch(UnexpectedValueException $e)
88  {
89  $GLOBALS['ilLog']->write("Caught error: ".$e->getMessage());
90  return '';
91  }
92  }
93 
101  public function getValidSchemaVersions($a_entity)
102  {
103  return array (
104  "4.1.0" => array(
105  "namespace" => "http://www.ilias.de/Modules/Folder/fold/4_1",
106  "xsd_file" => "ilias_fold_4_1.xsd",
107  "uses_dataset" => false,
108  "min" => "4.1.0",
109  "max" => "")
110  );
111  }
112 }
113 ?>
static getInstance()
Get singelton instance.
Xml Exporter class.
XML writer for folders.
getValidSchemaVersions($a_entity)
Returns schema versions that the component can export to.
$GLOBALS['ct_recipient']
getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
Get head dependencies.
__construct()
Constructor.
getXmlRepresentation($a_entity, $a_schema_version, $a_id)
Get xml.