ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ilGroupExporter Class Reference
+ 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
ilExport $exp
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ __construct()

ilGroupExporter::__construct ( )

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

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

29  {
30  global $DIC;
31 
32  $this->logger = $DIC->logger()->grp();
33  }
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:

Member Function Documentation

◆ getActiveAdvMDRecords()

ilGroupExporter::getActiveAdvMDRecords ( int  $a_id)
protected

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

References ilAdvancedMDRecord\_getActivatedRecordsByObjectType().

Referenced by getXmlExportTailDependencies().

111  : array
112  {
113  $active = [];
114 
115  foreach (ilAdvancedMDRecord::_getActivatedRecordsByObjectType('grp') as $record_obj) {
116  foreach ($record_obj->getAssignedObjectTypes() as $obj_info) {
117  if ($obj_info['obj_type'] == 'grp' && $obj_info['optional'] == 0) {
118  $active[] = $record_obj->getRecordId();
119  }
120  // local activation
121  if (
122  $obj_info['obj_type'] == 'grp' &&
123  $obj_info['optional'] == 1 &&
124  $a_id == $record_obj->getParentObject()
125  ) {
126  $active[] = $record_obj->getRecordId();
127  }
128  }
129  }
130  return $active;
131  }
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 133 of file class.ilGroupExporter.php.

133  : array
134  {
135  return [
136  "11.0" => [
137  "namespace" => 'http://www.ilias.de/Modules/Group/grp/11',
138  "xsd_file" => 'ilias_grp_11_0.xsd',
139  "uses_dataset" => false,
140  "min" => "11.0",
141  "max" => ""
142  ],
143  "9.0" => [
144  "namespace" => 'http://www.ilias.de/Modules/Group/grp/9',
145  "xsd_file" => 'ilias_grp_9_0.xsd',
146  "uses_dataset" => false,
147  "min" => "9.0",
148  "max" => "10.99"
149  ],
150  "4.1.0" => [
151  "namespace" => "http://www.ilias.de/Modules/Group/grp/4_1",
152  "xsd_file" => "ilias_grp_4_1.xsd",
153  "uses_dataset" => false,
154  "min" => "4.1.0",
155  "max" => "4.4.999"
156  ],
157  "5.0.0" => [
158  "namespace" => "http://www.ilias.de/Modules/Group/grp/5_0",
159  "xsd_file" => "ilias_grp_5_0.xsd",
160  "uses_dataset" => false,
161  "min" => "5.0.0",
162  "max" => "5.9.999"
163  ]
164  ];
165  }

◆ getXmlExportHeadDependencies()

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

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

45  : array
46  {
47  // always trigger container because of co-page(s)
48  return array(
49  array(
50  'component' => 'components/ILIAS/Container',
51  'entity' => 'struct',
52  'ids' => $a_ids
53  )
54  );
55  }

◆ getXmlExportTailDependencies()

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

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

References $id, and getActiveAdvMDRecords().

57  : array
58  {
59  $deps = [];
60  $advmd_ids = [];
61  foreach ($a_ids as $id) {
62  $rec_ids = $this->getActiveAdvMDRecords($id);
63  foreach ($rec_ids as $rec_id) {
64  $advmd_ids[] = $id . ":" . $rec_id;
65  }
66  }
67 
68  if ($advmd_ids !== []) {
69  $deps[] = [
70  "component" => "components/ILIAS/AdvancedMetaData",
71  "entity" => "advmd",
72  "ids" => $advmd_ids
73  ];
74  }
75 
76  $md_ids = [];
77  foreach ($a_ids as $grp_id) {
78  $md_ids[] = $grp_id . ":0:grp";
79  }
80  if ($md_ids !== []) {
81  $deps[] =
82  array(
83  "component" => "components/ILIAS/MetaData",
84  "entity" => "md",
85  "ids" => $md_ids
86  );
87  }
88  return $deps;
89  }
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 94 of file class.ilGroupExporter.php.

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

94  : string
95  {
96  $refs = ilObject::_getAllReferences((int) $a_id);
97  $group_ref_id = end($refs);
98  $group = ilObjectFactory::getInstanceByRefId($group_ref_id, false);
99 
100  if (!$group instanceof ilObjGroup) {
101  $this->logger->warning($a_id . ' is not instance of type group');
102  return '';
103  }
104 
105  $writer = new ilGroupXMLWriter($group);
106  $writer->setMode(ilGroupXMLWriter::MODE_EXPORT);
107  $writer->start();
108  return $writer->getXML();
109  }
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
Class ilObjGroup.
+ Here is the call graph for this function:

◆ init()

ilGroupExporter::init ( )

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

38  : void
39  {
40  }

Field Documentation

◆ $logger

ilLogger ilGroupExporter::$logger
private

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


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