ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilGroupExporter Class Reference

Folder export. More...

+ Inheritance diagram for ilGroupExporter:
+ Collaboration diagram for ilGroupExporter:

Public Member Functions

 __construct ()
 
 init ()
 
 getXmlExportHeadDependencies (string $a_entity, string $a_target_release, array $a_ids)
 
 getXmlExportTailDependencies (string $a_entity, string $a_target_release, array $a_ids)
 
 getXmlRepresentation (string $a_entity, string $a_schema_version, string $a_id)
 
 getValidSchemaVersions (string $a_entity)
 
- Public Member Functions inherited from ilXmlExporter
 __construct ()
 
 setExport (ilExport $a_exp)
 
 getExport ()
 
 getXmlRepresentation (string $a_entity, string $a_schema_version, string $a_id)
 
 init ()
 
 setExportDirectories (string $a_dir_relative, string $a_dir_absolute)
 
 getRelativeExportDirectory ()
 
 getAbsoluteExportDirectory ()
 
 getXmlExportHeadDependencies (string $a_entity, string $a_target_release, array $a_ids)
 Get head dependencies. More...
 
 getXmlExportTailDependencies (string $a_entity, string $a_target_release, array $a_ids)
 Get tail dependencies. More...
 
 getValidSchemaVersions (string $a_entity)
 Returns schema versions that the component can export to. More...
 
 determineSchemaVersion (string $a_entity, string $a_target_release)
 

Protected Member Functions

 getActiveAdvMDRecords (int $a_id)
 

Private Attributes

ilLogger $logger
 

Additional Inherited Members

- Static Public Member Functions inherited from ilXmlExporter
static lookupExportDirectory (string $a_obj_type, int $a_obj_id, string $a_export_type='xml', string $a_entity="")
 
- Protected Attributes inherited from ilXmlExporter
string $dir_relative = ""
 
string $dir_absolute = ""
 
ilExport $exp
 

Detailed Description

Folder export.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 17 of file class.ilGroupExporter.php.

Constructor & Destructor Documentation

◆ __construct()

ilGroupExporter::__construct ( )

Definition at line 21 of file class.ilGroupExporter.php.

References $DIC, and ILIAS\Repository\logger().

22  {
23  global $DIC;
24 
25  $this->logger = $DIC->logger()->grp();
26  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ getActiveAdvMDRecords()

ilGroupExporter::getActiveAdvMDRecords ( int  $a_id)
protected

Definition at line 104 of file class.ilGroupExporter.php.

References ilAdvancedMDRecord\_getActivatedRecordsByObjectType().

Referenced by getXmlExportTailDependencies().

104  : array
105  {
106  $active = [];
107 
108  foreach (ilAdvancedMDRecord::_getActivatedRecordsByObjectType('grp') as $record_obj) {
109  foreach ($record_obj->getAssignedObjectTypes() as $obj_info) {
110  if ($obj_info['obj_type'] == 'grp' && $obj_info['optional'] == 0) {
111  $active[] = $record_obj->getRecordId();
112  }
113  // local activation
114  if (
115  $obj_info['obj_type'] == 'grp' &&
116  $obj_info['optional'] == 1 &&
117  $a_id == $record_obj->getParentObject()
118  ) {
119  $active[] = $record_obj->getRecordId();
120  }
121  }
122  }
123  return $active;
124  }
static _getActivatedRecordsByObjectType(string $a_obj_type, string $a_sub_type="", bool $a_only_optional=false)
Get activated records by object type.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValidSchemaVersions()

ilGroupExporter::getValidSchemaVersions ( string  $a_entity)

Definition at line 130 of file class.ilGroupExporter.php.

130  : array
131  {
132  return [
133  "9.0" => [
134  "namespace" => 'http://www.ilias.de/Modules/Group/grp/9',
135  "xsd_file" => 'ilias_grp_9_0.xsd',
136  "uses_dataset" => false,
137  "min" => "9.0",
138  "max" => "9.99"
139  ],
140  "4.1.0" => [
141  "namespace" => "http://www.ilias.de/Modules/Group/grp/4_1",
142  "xsd_file" => "ilias_grp_4_1.xsd",
143  "uses_dataset" => false,
144  "min" => "4.1.0",
145  "max" => "4.4.999"
146  ],
147  "5.0.0" => [
148  "namespace" => "http://www.ilias.de/Modules/Group/grp/5_0",
149  "xsd_file" => "ilias_grp_5_0.xsd",
150  "uses_dataset" => false,
151  "min" => "5.0.0",
152  "max" => ""
153  ]
154  ];
155  }

◆ getXmlExportHeadDependencies()

ilGroupExporter::getXmlExportHeadDependencies ( string  $a_entity,
string  $a_target_release,
array  $a_ids 
)

Definition at line 38 of file class.ilGroupExporter.php.

38  : array
39  {
40  // always trigger container because of co-page(s)
41  return array(
42  array(
43  'component' => 'Services/Container',
44  'entity' => 'struct',
45  'ids' => $a_ids
46  )
47  );
48  }

◆ getXmlExportTailDependencies()

ilGroupExporter::getXmlExportTailDependencies ( string  $a_entity,
string  $a_target_release,
array  $a_ids 
)

Definition at line 50 of file class.ilGroupExporter.php.

References $id, and getActiveAdvMDRecords().

50  : array
51  {
52  $deps = [];
53  $advmd_ids = [];
54  foreach ($a_ids as $id) {
55  $rec_ids = $this->getActiveAdvMDRecords($id);
56  foreach ($rec_ids as $rec_id) {
57  $advmd_ids[] = $id . ":" . $rec_id;
58  }
59  }
60 
61  if ($advmd_ids !== []) {
62  $deps[] = [
63  "component" => "Services/AdvancedMetaData",
64  "entity" => "advmd",
65  "ids" => $advmd_ids
66  ];
67  }
68 
69  $md_ids = [];
70  foreach ($a_ids as $grp_id) {
71  $md_ids[] = $grp_id . ":0:grp";
72  }
73  if ($md_ids !== []) {
74  $deps[] =
75  array(
76  "component" => "Services/MetaData",
77  "entity" => "md",
78  "ids" => $md_ids
79  );
80  }
81  return $deps;
82  }
getActiveAdvMDRecords(int $a_id)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ getXmlRepresentation()

ilGroupExporter::getXmlRepresentation ( string  $a_entity,
string  $a_schema_version,
string  $a_id 
)

Definition at line 87 of file class.ilGroupExporter.php.

References ilObject\_getAllReferences(), ilObjectFactory\getInstanceByRefId(), ILIAS\Repository\logger(), and ilGroupXMLWriter\MODE_EXPORT.

87  : string
88  {
89  $refs = ilObject::_getAllReferences((int) $a_id);
90  $group_ref_id = end($refs);
91  $group = ilObjectFactory::getInstanceByRefId($group_ref_id, false);
92 
93  if (!$group instanceof ilObjGroup) {
94  $this->logger->warning($a_id . ' is not instance of type group');
95  return '';
96  }
97 
98  $writer = new ilGroupXMLWriter($group);
99  $writer->setMode(ilGroupXMLWriter::MODE_EXPORT);
100  $writer->start();
101  return $writer->getXML();
102  }
static _getAllReferences(int $id)
get all reference ids for object ID
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilObjGroup.
+ Here is the call graph for this function:

◆ init()

ilGroupExporter::init ( )

Definition at line 31 of file class.ilGroupExporter.php.

31  : void
32  {
33  }

Field Documentation

◆ $logger

ilLogger ilGroupExporter::$logger
private

Definition at line 19 of file class.ilGroupExporter.php.


The documentation for this class was generated from the following file: