ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilSessionExporter Class Reference

Exporter class for sessions. More...

+ Inheritance diagram for ilSessionExporter:
+ Collaboration diagram for ilSessionExporter:

Public Member Functions

 init ()
 
 getXmlExportTailDependencies (string $a_entity, string $a_target_release, array $a_ids)
 Get tail dependencies. More...
 
 getXmlRepresentation (string $a_entity, string $a_schema_version, string $a_id)
 
 getValidSchemaVersions (string $a_entity)
 Returns schema versions that the component can export to. More...
 
- 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

ilSessionDataSet $ds
 

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

Exporter class for sessions.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id

\

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

Member Function Documentation

◆ getActiveAdvMDRecords()

ilSessionExporter::getActiveAdvMDRecords ( int  $a_id)
protected

Definition at line 88 of file class.ilSessionExporter.php.

88 : array
89 {
90 $active = [];
91
92 foreach (ilAdvancedMDRecord::_getActivatedRecordsByObjectType('sess') as $record_obj) {
93 foreach ($record_obj->getAssignedObjectTypes() as $obj_info) {
94 if ($obj_info['obj_type'] == 'sess' && $obj_info['optional'] == 0) {
95 $active[] = $record_obj->getRecordId();
96 }
97 // local activation
98 if (
99 $obj_info['obj_type'] == 'sess' &&
100 $obj_info['optional'] == 1 &&
101 $a_id == $record_obj->getParentObject()
102 ) {
103 $active[] = $record_obj->getRecordId();
104 }
105 }
106 }
107 return $active;
108 }
static _getActivatedRecordsByObjectType(string $a_obj_type, string $a_sub_type="", bool $a_only_optional=false)
Get activated records by object type.

References ilAdvancedMDRecord\_getActivatedRecordsByObjectType().

Referenced by getXmlExportTailDependencies().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValidSchemaVersions()

ilSessionExporter::getValidSchemaVersions ( string  $a_entity)

Returns schema versions that the component can export to.

ILIAS chooses the first one, that has min/max constraints which fit to the target release. Please put the newest on top. Example: return array ( "4.1.0" => array( "namespace" => "http://www.ilias.de/Services/MetaData/md/4_1", "xsd_file" => "ilias_md_4_1.xsd", "min" => "4.1.0", "max" => "") );

Reimplemented from ilXmlExporter.

Definition at line 115 of file class.ilSessionExporter.php.

115 : array
116 {
117 return [
118 "4.1.0" => [
119 "namespace" => "http://www.ilias.de/Modules/Session/sess/4_1",
120 "xsd_file" => "ilias_sess_4_1.xsd",
121 "uses_dataset" => true,
122 "min" => "4.1.0",
123 "max" => "4.4.999"
124 ],
125 "5.0.0" => [
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 ],
132 "5.1.0" => [
133 "namespace" => "http://www.ilias.de/Modules/Session/sess/5_1",
134 "xsd_file" => "ilias_sess_5_1.xsd",
135 "uses_dataset" => true,
136 "min" => "5.1.0",
137 "max" => "5.3.999"
138 ],
139 "5.4.0" => [
140 "namespace" => "http://www.ilias.de/Modules/Session/sess/5_1",
141 "xsd_file" => "ilias_sess_5_1.xsd",
142 "uses_dataset" => true,
143 "min" => "5.4.0",
144 "max" => "5.4.99"
145 ],
146 "7.0" => [
147 "namespace" => "http://www.ilias.de/Modules/Session/sess/7",
148 "xsd_file" => "ilias_sess_7.xsd",
149 "uses_dataset" => true,
150 "min" => "7.0",
151 "max" => "8.99"
152 ],
153 "9.0" => [
154 "namespace" => "http://www.ilias.de/xml/Modules/Session/sess",
155 "xsd_file" => "ilias_sess_9.xsd",
156 "uses_dataset" => true,
157 "min" => "9.0",
158 "max" => ""
159 ]
160 ];
161 }

◆ getXmlExportTailDependencies()

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

Get tail dependencies.

Returns
array array of array with keys "component", entity", "ids"

Reimplemented from ilXmlExporter.

Definition at line 39 of file class.ilSessionExporter.php.

39 : array
40 {
41 $deps = [];
42
43 $advmd_ids = [];
44 foreach ($a_ids as $id) {
45 $rec_ids = $this->getActiveAdvMDRecords($id);
46 if (sizeof($rec_ids)) {
47 foreach ($rec_ids as $rec_id) {
48 $advmd_ids[] = $id . ":" . $rec_id;
49 }
50 }
51 }
52 if (sizeof($advmd_ids)) {
53 $deps[] = array(
54 "component" => "components/ILIAS/AdvancedMetaData",
55 "entity" => "advmd",
56 "ids" => $advmd_ids
57 );
58 }
59
60 $md_ids = [];
61 foreach ($a_ids as $sess_id) {
62 $md_ids[] = $sess_id . ":0:sess";
63 }
64 if ($md_ids) {
65 $deps[] =
66 array(
67 "component" => "components/ILIAS/MetaData",
68 "entity" => "md",
69 "ids" => $md_ids
70 );
71 }
72
73 // service settings
74 $deps[] = array(
75 "component" => "components/ILIAS/ILIASObject",
76 "entity" => "service_settings",
77 "ids" => $a_ids);
78
79 // tile image
80 $deps[] = array(
81 "component" => "components/ILIAS/ILIASObject",
82 "entity" => "tile",
83 "ids" => $a_ids);
84
85 return $deps;
86 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References $id, and getActiveAdvMDRecords().

+ Here is the call graph for this function:

◆ getXmlRepresentation()

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

Reimplemented from ilXmlExporter.

Definition at line 110 of file class.ilSessionExporter.php.

110 : string
111 {
112 return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, [$a_id], "", true, true);
113 }

◆ init()

ilSessionExporter::init ( )

Reimplemented from ilXmlExporter.

Definition at line 32 of file class.ilSessionExporter.php.

32 : void
33 {
34 $this->ds = new ilSessionDataSet();
35 $this->ds->initByExporter($this);
36 $this->ds->setDSPrefix("ds");
37 }
Session data set class.

Field Documentation

◆ $ds

ilSessionDataSet ilSessionExporter::$ds
private

Definition at line 30 of file class.ilSessionExporter.php.


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