ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 
5 include_once './Modules/Folder/classes/class.ilFolderXmlWriter.php';
6 include_once './Services/Export/classes/class.ilXmlExporter.php';
7 
18 {
19  private $writer = null;
20 
24  public function __construct()
25  {
26  }
27 
32  public function init()
33  {
34  }
35 
44  public function getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
45  {
46  // always trigger container because of co-page(s)
47  return array(
48  array(
49  'component' => 'Services/Container',
50  'entity' => 'struct',
51  'ids' => $a_ids
52  )
53  );
54  }
55 
56 
64  public function getXmlRepresentation($a_entity, $a_schema_version, $a_id)
65  {
66  $group_ref_id = end(ilObject::_getAllReferences($a_id));
67  $group = ilObjectFactory::getInstanceByRefId($group_ref_id, false);
68 
69  if (!$group instanceof ilObjGroup) {
70  $GLOBALS['DIC']->logger()->grp()->warning($a_id . ' is not instance of type group');
71  return '';
72  }
73 
74  include_once './Modules/Group/classes/class.ilGroupXMLWriter.php';
75  $this->writer = new ilGroupXMLWriter($group);
76  $this->writer->setMode(ilGroupXMLWriter::MODE_EXPORT);
77  $this->writer->start();
78  return $this->writer->getXML();
79  }
80 
88  public function getValidSchemaVersions($a_entity)
89  {
90  return array(
91  "4.1.0" => array(
92  "namespace" => "http://www.ilias.de/Modules/Group/grp/4_1",
93  "xsd_file" => "ilias_grp_4_1.xsd",
94  "uses_dataset" => false,
95  "min" => "4.1.0",
96  "max" => "4.4.999"),
97  "5.0.0" => array(
98  "namespace" => "http://www.ilias.de/Modules/Group/grp/5_0",
99  "xsd_file" => "ilias_grp_5_0.xsd",
100  "uses_dataset" => false,
101  "min" => "5.0.0",
102  "max" => "")
103  );
104  }
105 }
getValidSchemaVersions($a_entity)
Returns schema versions that the component can export to.
getXmlRepresentation($a_entity, $a_schema_version, $a_id)
Get xml.
getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
Get head dependencies.
static _getAllReferences($a_id)
get all reference ids of object
Xml Exporter class.
XML writer class.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
Class ilObjGroup.
__construct()
Constructor.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.