ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilMediaPoolExporter.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once("./Services/Export/classes/class.ilXmlExporter.php");
5 
14 {
15  private $ds;
19  private $config;
20 
24  public function init()
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  }
37 
46  public function getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
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  }
71 
72 
81  public function getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
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  }
111 
120  public function getXmlRepresentation($a_entity, $a_schema_version, $a_id)
121  {
122  return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, $a_id, "", true, true);
123  }
124 
132  public function getValidSchemaVersions($a_entity)
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  }
149 }
getXmlRepresentation($a_entity, $a_schema_version, $a_id)
Get xml representation.
getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
Get head dependencies.
if(!array_key_exists('StateId', $_REQUEST)) $id
static getAllMobIds($a_id)
static getIdsForType($a_id, $a_type)
Get all ids for type.
getValidSchemaVersions($a_entity)
Returns schema versions that the component can export to.
Xml Exporter class.
Media Pool Data set class.
Create styles array
The data for the language used.
Export2 class for media pools.
getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
Get tail dependencies.
getExport()
Get export.