ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
4include_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?>
getXmlRepresentation($a_entity, $a_schema_version, $a_id)
Get xml.
getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
Get head dependencies.
getValidSchemaVersions($a_entity)
Returns schema versions that the component can export to.
initWriter(ilContainerReference $ref)
static getInstance()
Get singelton instance.
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
static _getAllReferences($a_id)
get all reference ids of object
Xml Exporter class.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276