ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
class.ilGroupExporter.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
5include_once './Modules/Folder/classes/class.ilFolderXmlWriter.php';
6include_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
53 $GLOBALS['ilLog']->write(__METHOD__.': '.$obj_id);
54 if($eo->getOption(ilExportOptions::KEY_ROOT) != $obj_id)
55 {
56 return array();
57 }
58 if(count(ilExportOptions::getInstance()->getSubitemsForExport()) > 1)
59 {
60 return array(
61 array(
62 'component' => 'Services/Container',
63 'entity' => 'struct',
64 'ids' => $a_ids
65 )
66 );
67 }
68 return array();
69 }
70
71
79 public function getXmlRepresentation($a_entity, $a_schema_version, $a_id)
80 {
81 $group_ref_id = end(ilObject::_getAllReferences($a_id));
82 $group = ilObjectFactory::getInstanceByRefId($group_ref_id,false);
83
84 if(!$group instanceof ilObjGroup)
85 {
86 $GLOBALS['ilLog']->write(__METHOD__. $a_id . ' is not instance of type group');
87 return '';
88 }
89
90 include_once './Modules/Group/classes/class.ilGroupXMLWriter.php';
91 $this->writer = new ilGroupXMLWriter($group);
92 $this->writer->setMode(ilGroupXMLWriter::MODE_EXPORT);
93 $this->writer->start();
94 return $this->writer->getXML();
95 }
96
104 public function getValidSchemaVersions($a_entity)
105 {
106 return array (
107 "4.1.0" => array(
108 "namespace" => "http://www.ilias.de/Modules/Group/grp/4_1",
109 "xsd_file" => "ilias_grp_4_1.xsd",
110 "uses_dataset" => false,
111 "min" => "4.1.0",
112 "max" => "4.4.999"),
113 "5.0.0" => array(
114 "namespace" => "http://www.ilias.de/Modules/Group/grp/5_0",
115 "xsd_file" => "ilias_grp_5_0.xsd",
116 "uses_dataset" => false,
117 "min" => "5.0.0",
118 "max" => "")
119 );
120 }
121}
122?>
static getInstance()
Get singelton instance.
getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
Get head dependencies.
getValidSchemaVersions($a_entity)
Returns schema versions that the component can export to.
__construct()
Constructor.
getXmlRepresentation($a_entity, $a_schema_version, $a_id)
Get xml.
Class ilObjGroup.
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['ct_recipient']