ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
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  {
33  return array();
34  }
35  if(count(ilExportOptions::getInstance()->getSubitemsForExport()) > 1)
36  {
37  return array(
38  array(
39  'component' => 'Services/Container',
40  'entity' => 'struct',
41  'ids' => $a_ids
42  )
43  );
44  }
45  return array();
46  }
47 
48  abstract protected function initWriter(ilContainerReference $ref);
49 
50 
58  public function getXmlRepresentation($a_entity, $a_schema_version, $a_id)
59  {
60  $ref_ref_id = end(ilObject::_getAllReferences($a_id));
61  $ref = ilObjectFactory::getInstanceByRefId($ref_ref_id,false);
62 
63  if(!$ref instanceof ilContainerReference)
64  {
65  $GLOBALS['ilLog']->write(__METHOD__. $a_id . ' is not instance of type category!');
66  return '';
67  }
68  $writer = $this->initWriter($ref);
70  $writer->export(false);
71  return $writer->getXml();
72  }
73 
81  public function getValidSchemaVersions($a_entity)
82  {
83  return array (
84  "4.3.0" => array(
85  "namespace" => "http://www.ilias.de/Modules/CategoryReference/catr/4_3",
86  "xsd_file" => "ilias_catr_4_3.xsd",
87  "uses_dataset" => false,
88  "min" => "4.3.0",
89  "max" => "")
90  );
91  }
92 
96  public function init() {
97 
98  }
99 
100 }
101 ?>