ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilContainerReferenceExporter.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once './Services/Export/classes/class.ilXmlExporter.php';
5 
13 {
22  public function getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
23  {
24  include_once './Services/Export/classes/class.ilExportOptions.php';
26 
27  $obj_id = end($a_ids);
28 
29 
30  $GLOBALS['ilLog']->write(__METHOD__ . ': ' . $obj_id);
31  if ($eo->getOption(ilExportOptions::KEY_ROOT) != $obj_id) {
32  return array();
33  }
34  if (count(ilExportOptions::getInstance()->getSubitemsForExport()) > 1) {
35  return array(
36  array(
37  'component' => 'Services/Container',
38  'entity' => 'struct',
39  'ids' => $a_ids
40  )
41  );
42  }
43  return array();
44  }
45 
46  abstract protected function initWriter(ilContainerReference $ref);
47 
48 
56  public function getXmlRepresentation($a_entity, $a_schema_version, $a_id)
57  {
58  $ref_ref_id = end(ilObject::_getAllReferences($a_id));
59  $ref = ilObjectFactory::getInstanceByRefId($ref_ref_id, false);
60 
61  if (!$ref instanceof ilContainerReference) {
62  $GLOBALS['ilLog']->write(__METHOD__ . $a_id . ' is not instance of type category!');
63  return '';
64  }
65  $writer = $this->initWriter($ref);
67  $writer->export(false);
68  return $writer->getXml();
69  }
70 
78  public function getValidSchemaVersions($a_entity)
79  {
80  return array(
81  "4.3.0" => array(
82  "namespace" => "http://www.ilias.de/Modules/CategoryReference/catr/4_3",
83  "xsd_file" => "ilias_catr_4_3.xsd",
84  "uses_dataset" => false,
85  "min" => "4.3.0",
86  "max" => "")
87  );
88  }
89 
93  public function init()
94  {
95  }
96 }
getValidSchemaVersions($a_entity)
Returns schema versions that the component can export to.
initWriter(ilContainerReference $ref)
static getInstance()
Get singelton instance.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static _getAllReferences($a_id)
get all reference ids of object
Xml Exporter class.
Create styles array
The data for the language used.
getXmlRepresentation($a_entity, $a_schema_version, $a_id)
Get xml.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
Get head dependencies.