ILIAS  release_8 Revision v8.23
ilMediaPoolExporter Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 init ()
 
 getXmlExportHeadDependencies (string $a_entity, string $a_target_release, array $a_ids)
 
 getXmlExportTailDependencies (string $a_entity, string $a_target_release, array $a_ids)
 
 getXmlRepresentation (string $a_entity, string $a_schema_version, string $a_id)
 
 getValidSchemaVersions (string $a_entity)
 
- Public Member Functions inherited from ilXmlExporter
 __construct ()
 
 setExport (ilExport $a_exp)
 
 getExport ()
 
 getXmlRepresentation (string $a_entity, string $a_schema_version, string $a_id)
 
 init ()
 
 setExportDirectories (string $a_dir_relative, string $a_dir_absolute)
 
 getRelativeExportDirectory ()
 
 getAbsoluteExportDirectory ()
 
 getXmlExportHeadDependencies (string $a_entity, string $a_target_release, array $a_ids)
 Get head dependencies. More...
 
 getXmlExportTailDependencies (string $a_entity, string $a_target_release, array $a_ids)
 Get tail dependencies. More...
 
 getValidSchemaVersions (string $a_entity)
 Returns schema versions that the component can export to. More...
 
 determineSchemaVersion (string $a_entity, string $a_target_release)
 

Private Attributes

ilMediaPoolDataSet $ds
 
ilExportConfig $config
 

Additional Inherited Members

- Static Public Member Functions inherited from ilXmlExporter
static lookupExportDirectory (string $a_obj_type, int $a_obj_id, string $a_export_type='xml', string $a_entity="")
 
- Protected Attributes inherited from ilXmlExporter
string $dir_relative = ""
 
string $dir_absolute = ""
 
ilExport $exp
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Export2 class for media pools

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Member Function Documentation

◆ getValidSchemaVersions()

ilMediaPoolExporter::getValidSchemaVersions ( string  $a_entity)

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

116  : array
117  {
118  return array(
119  "5.1.0" => array(
120  "namespace" => "https://www.ilias.de/Modules/MediaPool/mep/5_1",
121  "xsd_file" => "ilias_mep_5_1.xsd",
122  "uses_dataset" => true,
123  "min" => "5.1.0",
124  "max" => ""),
125  "4.1.0" => array(
126  "namespace" => "https://www.ilias.de/Modules/MediaPool/mep/4_1",
127  "xsd_file" => "ilias_mep_4_1.xsd",
128  "uses_dataset" => true,
129  "min" => "4.1.0",
130  "max" => "")
131  );
132  }

◆ getXmlExportHeadDependencies()

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

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

References $id, and ilObjMediaPool\getAllMobIds().

46  : array {
47  $mob_ids = array();
48 
49  foreach ($a_ids as $id) {
50  $m_ids = ilObjMediaPool::getAllMobIds($id);
51  foreach ($m_ids as $m) {
52  $mob_ids[] = $m;
53  }
54  }
55 
56  if ($this->config->getMasterLanguageOnly()) {
57  return array();
58  }
59 
60  return array(
61  array(
62  "component" => "Services/MediaObjects",
63  "entity" => "mob",
64  "ids" => $mob_ids)
65  );
66  }
static getAllMobIds(int $a_id)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ getXmlExportTailDependencies()

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

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

References $id, and ilMediaPoolItem\getIdsForType().

72  : array {
73  $pg_ids = array();
74 
75  foreach ($a_ids as $id) {
76  $pages = ilMediaPoolItem::getIdsForType($id, "pg");
77  foreach ($pages as $p) {
78  $pg_ids[] = "mep:" . $p;
79  }
80  }
81 
82  $deps = array(
83  array(
84  "component" => "Services/COPage",
85  "entity" => "pg",
86  "ids" => $pg_ids)
87  );
88 
89  if (!$this->config->getMasterLanguageOnly()) {
90  $deps[] = array(
91  "component" => "Services/Object",
92  "entity" => "transl",
93  "ids" => $a_ids);
94  $deps[] = array(
95  "component" => "Services/Object",
96  "entity" => "transl_entry",
97  "ids" => $a_ids);
98  }
99 
100  $deps[] = array(
101  "component" => "Services/Object",
102  "entity" => "tile",
103  "ids" => $a_ids);
104 
105  return $deps;
106  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static getIdsForType(int $a_id, string $a_type)
Get all ids for type.
+ Here is the call graph for this function:

◆ getXmlRepresentation()

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

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

112  : string {
113  return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, [$a_id], "", true, true);
114  }

◆ init()

ilMediaPoolExporter::init ( )

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

References ilXmlExporter\getExport().

29  : void
30  {
31  $this->ds = new ilMediaPoolDataSet();
32  $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
33  $this->ds->setDSPrefix("ds");
34  $this->config = $this->getExport()->getConfig("Modules/MediaPool");
35  if ($this->config->getMasterLanguageOnly()) {
36  $conf = $this->getExport()->getConfig("Services/COPage");
37  $conf->setMasterLanguageOnly(true, $this->config->getIncludeMedia());
38  $this->ds->setMasterLanguageOnly(true);
39  }
40  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

Field Documentation

◆ $config

ilExportConfig ilMediaPoolExporter::$config
private

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

◆ $ds

ilMediaPoolDataSet ilMediaPoolExporter::$ds
private

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


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