ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 // always trigger container because of co-page(s)
48 return array(
49 array(
50 'component' => 'Services/Container',
51 'entity' => 'struct',
52 'ids' => $a_ids
53 )
54 );
55
56 /*
57 include_once './Services/Export/classes/class.ilExportOptions.php';
58 $eo = ilExportOptions::getInstance();
59
60 $obj_id = end($a_ids);
61
62
63 $GLOBALS['ilLog']->write(__METHOD__.': '.$obj_id);
64 if($eo->getOption(ilExportOptions::KEY_ROOT) != $obj_id)
65 {
66 return array();
67 }
68 if(count(ilExportOptions::getInstance()->getSubitemsForExport()) > 1)
69 {
70 return array(
71 array(
72 'component' => 'Services/Container',
73 'entity' => 'struct',
74 'ids' => $a_ids
75 )
76 );
77 }
78 return array();
79 */
80 }
81
82
90 public function getXmlRepresentation($a_entity, $a_schema_version, $a_id)
91 {
92 $group_ref_id = end(ilObject::_getAllReferences($a_id));
93 $group = ilObjectFactory::getInstanceByRefId($group_ref_id,false);
94
95 if(!$group instanceof ilObjGroup)
96 {
97 $GLOBALS['ilLog']->write(__METHOD__. $a_id . ' is not instance of type group');
98 return '';
99 }
100
101 include_once './Modules/Group/classes/class.ilGroupXMLWriter.php';
102 $this->writer = new ilGroupXMLWriter($group);
103 $this->writer->setMode(ilGroupXMLWriter::MODE_EXPORT);
104 $this->writer->start();
105 return $this->writer->getXML();
106 }
107
115 public function getValidSchemaVersions($a_entity)
116 {
117 return array (
118 "4.1.0" => array(
119 "namespace" => "http://www.ilias.de/Modules/Group/grp/4_1",
120 "xsd_file" => "ilias_grp_4_1.xsd",
121 "uses_dataset" => false,
122 "min" => "4.1.0",
123 "max" => "4.4.999"),
124 "5.0.0" => array(
125 "namespace" => "http://www.ilias.de/Modules/Group/grp/5_0",
126 "xsd_file" => "ilias_grp_5_0.xsd",
127 "uses_dataset" => false,
128 "min" => "5.0.0",
129 "max" => "")
130 );
131 }
132}
133?>
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['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276