ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 global $DIC;
25
26 $log = $DIC->logger()->root();
27
28 include_once './Services/Export/classes/class.ilExportOptions.php';
30
31 $obj_id = end($a_ids);
32
33 $log->debug(__METHOD__ . ': ' . $obj_id);
34 if ($eo->getOption(ilExportOptions::KEY_ROOT) != $obj_id) {
35 return array();
36 }
37 if (count(ilExportOptions::getInstance()->getSubitemsForExport()) > 1) {
38 return array(
39 array(
40 'component' => 'Services/Container',
41 'entity' => 'struct',
42 'ids' => $a_ids
43 )
44 );
45 }
46 return array();
47 }
48
49 abstract protected function initWriter(ilContainerReference $ref);
50
51
59 public function getXmlRepresentation($a_entity, $a_schema_version, $a_id)
60 {
61 global $DIC;
62
63 $log = $DIC->logger()->root();
64
65 $ref_ref_id = end(ilObject::_getAllReferences($a_id));
66 $ref = ilObjectFactory::getInstanceByRefId($ref_ref_id, false);
67
68 if (!$ref instanceof ilContainerReference) {
69 $log->debug(__METHOD__ . $a_id . ' is not instance of type category!');
70 return '';
71 }
72 $writer = $this->initWriter($ref);
74 $writer->export(false);
75 return $writer->getXml();
76 }
77
85 public function getValidSchemaVersions($a_entity)
86 {
87 return array(
88 "4.3.0" => array(
89 "namespace" => "http://www.ilias.de/Modules/CategoryReference/catr/4_3",
90 "xsd_file" => "ilias_catr_4_3.xsd",
91 "uses_dataset" => false,
92 "min" => "4.3.0",
93 "max" => "")
94 );
95 }
96
100 public function init()
101 {
102 }
103}
An exception for terminatinating execution or to throw for unit testing.
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.
static 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.
$log
Definition: result.php:15
$DIC
Definition: xapitoken.php:46