ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
 

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

Reimplemented from ilXmlExporter.

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

136 {
137 return array (
138 "5.1.0" => array(
139 "namespace" => "http://www.ilias.de/Modules/MediaPool/mep/5_1",
140 "xsd_file" => "ilias_mep_5_1.xsd",
141 "uses_dataset" => true,
142 "min" => "5.1.0",
143 "max" => ""),
144 "4.1.0" => array(
145 "namespace" => "http://www.ilias.de/Modules/MediaPool/mep/4_1",
146 "xsd_file" => "ilias_mep_4_1.xsd",
147 "uses_dataset" => true,
148 "min" => "4.1.0",
149 "max" => "")
150 );
151 }

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

Reimplemented from ilXmlExporter.

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

44 {
45 include_once("./Modules/MediaPool/classes/class.ilObjMediaPool.php");
46 include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
47 $pg_ids = array();
48 $mob_ids = array();
49
50 foreach ($a_ids as $id)
51 {
52 $m_ids = ilObjMediaPool::getAllMobIds($id);
53 foreach ($m_ids as $m)
54 {
55 $mob_ids[] = $m;
56 }
57 }
58
59 if ($this->config->getMasterLanguageOnly())
60 {
61 return array();
62 }
63
64 return array (
65 array(
66 "component" => "Services/MediaObjects",
67 "entity" => "mob",
68 "ids" => $mob_ids)
69 );
70 }
getAllMobIds($a_id)
Get all media object ids.

References ilObjMediaPool\getAllMobIds().

+ 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"

Reimplemented from ilXmlExporter.

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

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 {
90 $pages = ilMediaPoolItem::getIdsForType($id, "pg");
91 foreach ($pages as $p)
92 {
93 $pg_ids[] = "mep:".$p;
94 }
95 }
96
97 $deps = array (
98 array(
99 "component" => "Services/COPage",
100 "entity" => "pg",
101 "ids" => $pg_ids)
102 );
103
104 if (!$this->config->getMasterLanguageOnly())
105 {
106 $deps[] = array(
107 "component" => "Services/Object",
108 "entity" => "transl",
109 "ids" => $a_ids);
110 }
111
112 return $deps;
113 }
static getIdsForType($a_id, $a_type)
Get all ids for type.

References ilMediaPoolItem\getIdsForType().

+ 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

Reimplemented from ilXmlExporter.

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

124 {
125 return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, $a_id, "", true, true);
126 }

◆ init()

ilMediaPoolExporter::init ( )

Initialisation.

Reimplemented from ilXmlExporter.

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

21 {
22 include_once("./Modules/MediaPool/classes/class.ilMediaPoolDataSet.php");
23 $this->ds = new ilMediaPoolDataSet();
24 $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
25 $this->ds->setDSPrefix("ds");
26 $this->config = $this->getExport()->getConfig("Modules/MediaPool");
27 if ($this->config->getMasterLanguageOnly())
28 {
29 $conf = $this->getExport()->getConfig("Services/COPage");
30 $conf->setMasterLanguageOnly(true);
31 $this->ds->setMasterLanguageOnly(true);
32 }
33 }
Media Pool Data set class.
getExport()
Get export.

References ilXmlExporter\getExport().

+ Here is the call graph for this function:

Field Documentation

◆ $ds

ilMediaPoolExporter::$ds
private

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


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