ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5
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;
16 
20  function init()
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  }
34 
43  function getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
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  }
71 
72 
81  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  {
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  }
114 
123  public function getXmlRepresentation($a_entity, $a_schema_version, $a_id)
124  {
125  return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, $a_id, "", true, true);
126  }
127 
135  function getValidSchemaVersions($a_entity)
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  }
152 
153 }
154 
155 ?>
getXmlRepresentation($a_entity, $a_schema_version, $a_id)
Get xml representation.
getAllMobIds($a_id)
Get all media object ids.
getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
Get head dependencies.
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.
Export2 class for media pools.
getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
Get tail dependencies.
getExport()
Get export.