ILIAS  release_8 Revision v8.24
class.ilSessionExporter.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
30{
32
33 public function init(): void
34 {
35 $this->ds = new ilSessionDataSet();
36 $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
37 $this->ds->setDSPrefix("ds");
38 }
39
40 public function getXmlExportTailDependencies(string $a_entity, string $a_target_release, array $a_ids): array
41 {
42 $deps = [];
43
44 $advmd_ids = [];
45 foreach ($a_ids as $id) {
46 $rec_ids = $this->getActiveAdvMDRecords($id);
47 if (sizeof($rec_ids)) {
48 foreach ($rec_ids as $rec_id) {
49 $advmd_ids[] = $id . ":" . $rec_id;
50 }
51 }
52 }
53 if (sizeof($advmd_ids)) {
54 $deps[] = array(
55 "component" => "Services/AdvancedMetaData",
56 "entity" => "advmd",
57 "ids" => $advmd_ids
58 );
59 }
60
61 $md_ids = [];
62 foreach ($a_ids as $sess_id) {
63 $md_ids[] = $sess_id . ":0:sess";
64 }
65 if ($md_ids) {
66 $deps[] =
67 array(
68 "component" => "Services/MetaData",
69 "entity" => "md",
70 "ids" => $md_ids
71 );
72 }
73
74 // service settings
75 $deps[] = array(
76 "component" => "Services/Object",
77 "entity" => "service_settings",
78 "ids" => $a_ids);
79
80 // tile image
81 $deps[] = array(
82 "component" => "Services/Object",
83 "entity" => "tile",
84 "ids" => $a_ids);
85
86 return $deps;
87 }
88
89 protected function getActiveAdvMDRecords(int $a_id): array
90 {
91 $active = [];
92
93 foreach (ilAdvancedMDRecord::_getActivatedRecordsByObjectType('sess') as $record_obj) {
94 foreach ($record_obj->getAssignedObjectTypes() as $obj_info) {
95 if ($obj_info['obj_type'] == 'sess' && $obj_info['optional'] == 0) {
96 $active[] = $record_obj->getRecordId();
97 }
98 // local activation
99 if (
100 $obj_info['obj_type'] == 'sess' &&
101 $obj_info['optional'] == 1 &&
102 $a_id == $record_obj->getParentObject()
103 ) {
104 $active[] = $record_obj->getRecordId();
105 }
106 }
107 }
108 return $active;
109 }
110
111 public function getXmlRepresentation(string $a_entity, string $a_schema_version, string $a_id): string
112 {
113 return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, [$a_id], "", true, true);
114 }
115
116 public function getValidSchemaVersions(string $a_entity): array
117 {
118 return array(
119 "4.1.0" => array(
120 "namespace" => "http://www.ilias.de/Modules/Session/sess/4_1",
121 "xsd_file" => "ilias_sess_4_1.xsd",
122 "uses_dataset" => true,
123 "min" => "4.1.0",
124 "max" => "4.4.999"),
125 "5.0.0" => array(
126 "namespace" => "http://www.ilias.de/Modules/Session/sess/5_0",
127 "xsd_file" => "ilias_sess_5_0.xsd",
128 "uses_dataset" => true,
129 "min" => "5.0.0",
130 "max" => "5.0.999"),
131 "5.1.0" => array(
132 "namespace" => "http://www.ilias.de/Modules/Session/sess/5_1",
133 "xsd_file" => "ilias_sess_5_1.xsd",
134 "uses_dataset" => true,
135 "min" => "5.1.0",
136 "max" => "5.3.999"),
137 "5.4.0" => array(
138 "namespace" => "http://www.ilias.de/Modules/Session/sess/5_1",
139 "xsd_file" => "ilias_sess_5_1.xsd",
140 "uses_dataset" => true,
141 "min" => "5.4.0",
142 "max" => "5.4.999"),
143 "7.0" => array(
144 "namespace" => "http://www.ilias.de/Modules/Session/sess/7",
145 "xsd_file" => "ilias_sess_7.xsd",
146 "uses_dataset" => true,
147 "min" => "7.0",
148 "max" => ""),
149 );
150 }
151}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static _getActivatedRecordsByObjectType(string $a_obj_type, string $a_sub_type="", bool $a_only_optional=false)
Get activated records by object type.
Session data set class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getValidSchemaVersions(string $a_entity)
Returns schema versions that the component can export to.
getXmlExportTailDependencies(string $a_entity, string $a_target_release, array $a_ids)
Get tail dependencies.
getXmlRepresentation(string $a_entity, string $a_schema_version, string $a_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...