ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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
4include_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 }
27
36 function getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
37 {
38 include_once("./Modules/MediaPool/classes/class.ilObjMediaPool.php");
39 include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
40 $pg_ids = array();
41 $mob_ids = array();
42
43 foreach ($a_ids as $id)
44 {
45 $m_ids = ilObjMediaPool::getAllMobIds($id);
46 foreach ($m_ids as $m)
47 {
48 $mob_ids[] = $m;
49 }
50 }
51
52 return array (
53 array(
54 "component" => "Services/MediaObjects",
55 "entity" => "mob",
56 "ids" => $mob_ids)
57 );
58 }
59
60
69 function getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
70 {
71 include_once("./Modules/MediaPool/classes/class.ilObjMediaPool.php");
72 include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
73 $pg_ids = array();
74 $mob_ids = array();
75
76 foreach ($a_ids as $id)
77 {
78 $pages = ilMediaPoolItem::getIdsForType($id, "pg");
79 foreach ($pages as $p)
80 {
81 $pg_ids[] = "mep:".$p;
82 }
83 }
84
85 return array (
86 array(
87 "component" => "Services/COPage",
88 "entity" => "pg",
89 "ids" => $pg_ids)
90 );
91 }
92
101 public function getXmlRepresentation($a_entity, $a_schema_version, $a_id)
102 {
103 return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, $a_id, "", true, true);
104 }
105
113 function getValidSchemaVersions($a_entity)
114 {
115 return array (
116 "4.1.0" => array(
117 "namespace" => "http://www.ilias.de/Modules/MediaPool/mep/4_1",
118 "xsd_file" => "ilias_mep_4_1.xsd",
119 "uses_dataset" => true,
120 "min" => "4.1.0",
121 "max" => "")
122 );
123 }
124
125}
126
127?>
Media Pool Data set class.
Export2 class for media pools.
getXmlRepresentation($a_entity, $a_schema_version, $a_id)
Get xml representation.
getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
Get tail dependencies.
getValidSchemaVersions($a_entity)
Returns schema versions that the component can export to.
getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
Get head dependencies.
static getIdsForType($a_id, $a_type)
Get all ids for type.
getAllMobIds($a_id)
Get all media object ids.
Xml Exporter class.