ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilMediaPoolImporter.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once("./Services/Export/classes/class.ilXmlImporter.php");
5 
14 {
15 
19  public function init()
20  {
21  include_once("./Modules/MediaPool/classes/class.ilMediaPoolDataSet.php");
22  $this->ds = new ilMediaPoolDataSet();
23  $this->ds->setDSPrefix("ds");
24 
25  $this->config = $this->getImport()->getConfig("Modules/MediaPool");
26  if ($this->config->getTranslationImportMode()) {
27  $this->ds->setTranslationImportMode(
28  $this->config->getTranslationLM(),
29  $this->config->getTranslationLang()
30  );
31  $cop_config = $this->getImport()->getConfig("Services/COPage");
32  $cop_config->setUpdateIfExists(true);
33  $cop_config->setForceLanguage($this->config->getTranslationLang());
34  $cop_config->setReuseOriginallyExportedMedia(true);
35  $cop_config->setSkipInternalLinkResolve(true);
36 
37  $mob_config = $this->getImport()->getConfig("Services/MediaObjects");
38  $mob_config->setUsePreviousImportIds(true);
39  }
40  }
41 
42 
49  public function importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
50  {
51  include_once("./Services/DataSet/classes/class.ilDataSetImportParser.php");
53  $a_entity,
54  $this->getSchemaVersion(),
55  $a_xml,
56  $this->ds,
57  $a_mapping
58  );
59  }
60 
66  public function finalProcessing($a_mapping)
67  {
68  $pg_map = $a_mapping->getMappingsOfEntity("Modules/MediaPool", "pg");
69 
70  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
71  include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
72  foreach ($pg_map as $pg_id) {
73  $mep_id = ilMediaPoolItem::getPoolForItemId($pg_id);
74  $mep_id = current($mep_id);
75  ilMediaPoolPage::_writeParentId("mep", $pg_id, $mep_id);
76  }
77  }
78 }
static getPoolForItemId($a_id)
Get media pools for item id.
getSchemaVersion()
Get schema version.
importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
Import XML.
Manifest parser for ILIAS standard export files.
Importer class for media pools.
static _writeParentId($a_parent_type, $a_pg_id, $a_par_id)
Write parent id.
getImport()
Get import.
Media Pool Data set class.
$parser
Definition: BPMN2Parser.php:23
finalProcessing($a_mapping)
Final processing.
Xml importer class.