ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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
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 29 of file class.ilGroupExporter.php.

Constructor & Destructor Documentation

◆ __construct()

ilGroupExporter::__construct ( )

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

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

34  {
35  global $DIC;
36 
37  $this->logger = $DIC->logger()->grp();
38  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ getActiveAdvMDRecords()

ilGroupExporter::getActiveAdvMDRecords ( int  $a_id)
protected

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

References ilAdvancedMDRecord\_getActivatedRecordsByObjectType().

Referenced by getXmlExportTailDependencies().

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

142  : array
143  {
144  return [
145  "9.0" => [
146  "namespace" => 'http://www.ilias.de/Modules/Group/grp/9',
147  "xsd_file" => 'ilias_grp_9_0.xsd',
148  "uses_dataset" => false,
149  "min" => "9.0",
150  "max" => "9.99"
151  ],
152  "4.1.0" => [
153  "namespace" => "http://www.ilias.de/Modules/Group/grp/4_1",
154  "xsd_file" => "ilias_grp_4_1.xsd",
155  "uses_dataset" => false,
156  "min" => "4.1.0",
157  "max" => "4.4.999"
158  ],
159  "5.0.0" => [
160  "namespace" => "http://www.ilias.de/Modules/Group/grp/5_0",
161  "xsd_file" => "ilias_grp_5_0.xsd",
162  "uses_dataset" => false,
163  "min" => "5.0.0",
164  "max" => ""
165  ]
166  ];
167  }

◆ getXmlExportHeadDependencies()

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

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

50  : array
51  {
52  // always trigger container because of co-page(s)
53  return array(
54  array(
55  'component' => 'components/ILIAS/Container',
56  'entity' => 'struct',
57  'ids' => $a_ids
58  )
59  );
60  }

◆ getXmlExportTailDependencies()

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

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

References $id, and getActiveAdvMDRecords().

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

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

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

◆ init()

ilGroupExporter::init ( )

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

43  : void
44  {
45  }

Field Documentation

◆ $logger

ilLogger ilGroupExporter::$logger
private

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


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