ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilMediaPoolExporter Class Reference

Export2 class for media pools. More...

+ Inheritance diagram for ilMediaPoolExporter:
+ Collaboration diagram for ilMediaPoolExporter:

Public Member Functions

 init ()
 Initialisation. 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...
 
 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...
 

Private Attributes

 $ds
 
 $config
 

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

Export2 class for media pools.

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.ilMediaPoolExporter.php.

Member Function Documentation

◆ getValidSchemaVersions()

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

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

References array.

133  {
134  return array(
135  "5.1.0" => array(
136  "namespace" => "http://www.ilias.de/Modules/MediaPool/mep/5_1",
137  "xsd_file" => "ilias_mep_5_1.xsd",
138  "uses_dataset" => true,
139  "min" => "5.1.0",
140  "max" => ""),
141  "4.1.0" => array(
142  "namespace" => "http://www.ilias.de/Modules/MediaPool/mep/4_1",
143  "xsd_file" => "ilias_mep_4_1.xsd",
144  "uses_dataset" => true,
145  "min" => "4.1.0",
146  "max" => "")
147  );
148  }
Create styles array
The data for the language used.

◆ getXmlExportHeadDependencies()

ilMediaPoolExporter::getXmlExportHeadDependencies (   $a_entity,
  $a_target_release,
  $a_ids 
)

Get head dependencies.

Parameters
stringentity
stringtarget release
arrayids
Returns
array array of array with keys "component", entity", "ids"

Definition at line 46 of file class.ilMediaPoolExporter.php.

References $id, $m, array, and ilObjMediaPool\getAllMobIds().

47  {
48  include_once("./Modules/MediaPool/classes/class.ilObjMediaPool.php");
49  include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
50  $pg_ids = array();
51  $mob_ids = array();
52 
53  foreach ($a_ids as $id) {
54  $m_ids = ilObjMediaPool::getAllMobIds($id);
55  foreach ($m_ids as $m) {
56  $mob_ids[] = $m;
57  }
58  }
59 
60  if ($this->config->getMasterLanguageOnly()) {
61  return array();
62  }
63 
64  return array(
65  array(
66  "component" => "Services/MediaObjects",
67  "entity" => "mob",
68  "ids" => $mob_ids)
69  );
70  }
if(!array_key_exists('StateId', $_REQUEST)) $id
static getAllMobIds($a_id)
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ getXmlExportTailDependencies()

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

Get tail dependencies.

Parameters
stringentity
stringtarget release
arrayids
Returns
array array of array with keys "component", entity", "ids"

Definition at line 81 of file class.ilMediaPoolExporter.php.

References $id, array, and ilMediaPoolItem\getIdsForType().

82  {
83  include_once("./Modules/MediaPool/classes/class.ilObjMediaPool.php");
84  include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
85  $pg_ids = array();
86  $mob_ids = array();
87 
88  foreach ($a_ids as $id) {
89  $pages = ilMediaPoolItem::getIdsForType($id, "pg");
90  foreach ($pages as $p) {
91  $pg_ids[] = "mep:" . $p;
92  }
93  }
94 
95  $deps = array(
96  array(
97  "component" => "Services/COPage",
98  "entity" => "pg",
99  "ids" => $pg_ids)
100  );
101 
102  if (!$this->config->getMasterLanguageOnly()) {
103  $deps[] = array(
104  "component" => "Services/Object",
105  "entity" => "transl",
106  "ids" => $a_ids);
107  }
108 
109  return $deps;
110  }
if(!array_key_exists('StateId', $_REQUEST)) $id
static getIdsForType($a_id, $a_type)
Get all ids for type.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ getXmlRepresentation()

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

Get xml representation.

Parameters
stringentity
stringschema version
stringid
Returns
string xml string

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

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

◆ init()

ilMediaPoolExporter::init ( )

Initialisation.

Definition at line 24 of file class.ilMediaPoolExporter.php.

References ilXmlExporter\getExport().

25  {
26  include_once("./Modules/MediaPool/classes/class.ilMediaPoolDataSet.php");
27  $this->ds = new ilMediaPoolDataSet();
28  $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
29  $this->ds->setDSPrefix("ds");
30  $this->config = $this->getExport()->getConfig("Modules/MediaPool");
31  if ($this->config->getMasterLanguageOnly()) {
32  $conf = $this->getExport()->getConfig("Services/COPage");
33  $conf->setMasterLanguageOnly(true, $this->config->getIncludeMedia());
34  $this->ds->setMasterLanguageOnly(true);
35  }
36  }
Media Pool Data set class.
getExport()
Get export.
+ Here is the call graph for this function:

Field Documentation

◆ $config

ilMediaPoolExporter::$config
private

Definition at line 19 of file class.ilMediaPoolExporter.php.

◆ $ds

ilMediaPoolExporter::$ds
private

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


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