ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilSessionExporter Class Reference

Exporter class for sessions. More...

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

Public Member Functions

 init ()
 Initialisation. More...
 
 getXmlExportTailDependencies ($a_entity, $a_target_release, $a_ids)
 Get tail dependencies. More...
 
 getXmlRepresentation ($a_entity, $a_schema_version, $a_id)
 Get xml representation. More...
 
 getValidSchemaVersions ($a_entity)
 Returns schema versions that the component can export to. More...
 
- Public Member Functions inherited from ilXmlExporter
 __construct ()
 Constructor. More...
 
 setExport (ilExport $a_exp)
 Set export object. More...
 
 getExport ()
 Get export. More...
 
 getXmlRepresentation ($a_entity, $a_schema_version, $a_id)
 Get xml representation. More...
 
 init ()
 
 setExportDirectories ($a_dir_relative, $a_dir_absolute)
 Export directories. More...
 
 getRelativeExportDirectory ()
 Get relative export directory. More...
 
 getAbsoluteExportDirectory ()
 Get absolute export directory. More...
 
 getXmlExportHeadDependencies ($a_entity, $a_target_release, $a_ids)
 Get head dependencies. More...
 
 getXmlExportTailDependencies ($a_entity, $a_target_release, $a_ids)
 Get tail dependencies. More...
 
 getValidSchemaVersions ($a_entity)
 Returns schema versions that the component can export to. More...
 
 determineSchemaVersion ($a_entity, $a_target_release)
 Determine schema version. More...
 

Protected Member Functions

 getActiveAdvMDRecords ($a_id)
 get activated adv md records More...
 

Private Attributes

 $ds
 

Additional Inherited Members

- Static Public Member Functions inherited from ilXmlExporter
static lookupExportDirectory ($a_obj_type, $a_obj_id, $a_export_type='xml', $a_entity="")
 export directory lookup More...
 
- Protected Attributes inherited from ilXmlExporter
 $dir_relative
 
 $dir_absolute
 
 $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 13 of file class.ilSessionExporter.php.

Member Function Documentation

◆ getActiveAdvMDRecords()

ilSessionExporter::getActiveAdvMDRecords (   $a_id)
protected

get activated adv md records

Parameters
type$a_id
Returns
type

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

90 {
91 $active = array();
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 }
static _getActivatedRecordsByObjectType($a_obj_type, $a_sub_type="", $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 (   $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.

Returns

Reimplemented from ilXmlExporter.

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

133 {
134 return array(
135 "4.1.0" => array(
136 "namespace" => "http://www.ilias.de/Modules/Session/sess/4_1",
137 "xsd_file" => "ilias_sess_4_1.xsd",
138 "uses_dataset" => true,
139 "min" => "4.1.0",
140 "max" => "4.4.999"),
141 "5.0.0" => array(
142 "namespace" => "http://www.ilias.de/Modules/Session/sess/5_0",
143 "xsd_file" => "ilias_sess_5_0.xsd",
144 "uses_dataset" => true,
145 "min" => "5.0.0",
146 "max" => "5.0.999"),
147 "5.1.0" => array(
148 "namespace" => "http://www.ilias.de/Modules/Session/sess/5_1",
149 "xsd_file" => "ilias_sess_5_1.xsd",
150 "uses_dataset" => true,
151 "min" => "5.1.0",
152 "max" => "5.3.999"),
153 "5.4.0" => array(
154 "namespace" => "http://www.ilias.de/Modules/Session/sess/5_1",
155 "xsd_file" => "ilias_sess_5_1.xsd",
156 "uses_dataset" => true,
157 "min" => "5.4.0",
158 "max" => ""),
159 );
160 }

◆ getXmlExportTailDependencies()

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

Get tail dependencies.

Parameters
type$a_entity
type$a_target_release
type$a_ids
Returns
string

Reimplemented from ilXmlExporter.

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

36 {
37 $deps = [];
38
39 $advmd_ids = array();
40 foreach ($a_ids as $id) {
41 $rec_ids = $this->getActiveAdvMDRecords($id);
42 if (sizeof($rec_ids)) {
43 foreach ($rec_ids as $rec_id) {
44 $advmd_ids[] = $id . ":" . $rec_id;
45 }
46 }
47 }
48 if (sizeof($advmd_ids)) {
49 $deps[] = array(
50 "component" => "Services/AdvancedMetaData",
51 "entity" => "advmd",
52 "ids" => $advmd_ids
53 );
54 }
55
56 $md_ids = array();
57 foreach ($a_ids as $sess_id) {
58 $md_ids[] = $sess_id . ":0:sess";
59 }
60 if ($md_ids) {
61 $deps[] =
62 array(
63 "component" => "Services/MetaData",
64 "entity" => "md",
65 "ids" => $md_ids
66 );
67 }
68
69 // service settings
70 $deps[] = array(
71 "component" => "Services/Object",
72 "entity" => "service_settings",
73 "ids" => $a_ids);
74
75 // tile image
76 $deps[] = array(
77 "component" => "Services/Object",
78 "entity" => "tile",
79 "ids" => $a_ids);
80
81 return $deps;
82 }
getActiveAdvMDRecords($a_id)
get activated adv md records

References getActiveAdvMDRecords().

+ Here is the call graph for this function:

◆ getXmlRepresentation()

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

Get xml representation.

Parameters
stringentity
stringschema version
stringid
Returns
string xml string

Reimplemented from ilXmlExporter.

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

121 {
122 return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, $a_id, "", true, true);
123 }

◆ init()

ilSessionExporter::init ( )

Initialisation.

Reimplemented from ilXmlExporter.

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

21 {
22 include_once("./Modules/Session/classes/class.ilSessionDataSet.php");
23 $this->ds = new ilSessionDataSet();
24 $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
25 $this->ds->setDSPrefix("ds");
26 }
Session data set class.

Field Documentation

◆ $ds

ilSessionExporter::$ds
private

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


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