ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 83 of file class.ilSessionExporter.php.

84 {
85 $active = array();
86
87 foreach (ilAdvancedMDRecord::_getActivatedRecordsByObjectType('sess') as $record_obj) {
88 foreach ($record_obj->getAssignedObjectTypes() as $obj_info) {
89 // global activation
90 if ($obj_info['obj_type'] == 'sess' && $obj_info['optional'] == 0) {
91 $active[] = $record_obj->getRecordId();
92 }
93 // local activation
94 if (
95 $obj_info['obj_type'] == 'sess' &&
96 $obj_info['optional'] == 1 &&
97 $a_id == $record_obj->getParentObject()
98 ) {
99 $active[] = $record_obj->getRecordId();
100 }
101 }
102 }
103 return $active;
104 }
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 127 of file class.ilSessionExporter.php.

128 {
129 return array(
130 "4.1.0" => array(
131 "namespace" => "http://www.ilias.de/Modules/Session/sess/4_1",
132 "xsd_file" => "ilias_sess_4_1.xsd",
133 "uses_dataset" => true,
134 "min" => "4.1.0",
135 "max" => "4.4.999"),
136 "5.0.0" => array(
137 "namespace" => "http://www.ilias.de/Modules/Session/sess/5_0",
138 "xsd_file" => "ilias_sess_5_0.xsd",
139 "uses_dataset" => true,
140 "min" => "5.0.0",
141 "max" => "5.0.999"),
142 "5.1.0" => array(
143 "namespace" => "http://www.ilias.de/Modules/Session/sess/5_1",
144 "xsd_file" => "ilias_sess_5_1.xsd",
145 "uses_dataset" => true,
146 "min" => "5.1.0",
147 "max" => "")
148 );
149 }

◆ 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 return $deps;
76 }
getActiveAdvMDRecords($a_id)
get activated adv md records
if(!array_key_exists('StateId', $_REQUEST)) $id

References $id, and 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 115 of file class.ilSessionExporter.php.

116 {
117 return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, $a_id, "", true, true);
118 }

◆ 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: