ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  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  {
28  $this->ds->setTranslationImportMode(
29  $this->config->getTranslationLM(),
30  $this->config->getTranslationLang());
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 
43 
50  function importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
51  {
52  include_once("./Services/DataSet/classes/class.ilDataSetImportParser.php");
53  $parser = new ilDataSetImportParser($a_entity, $this->getSchemaVersion(),
54  $a_xml, $this->ds, $a_mapping);
55  }
56 
62  function finalProcessing($a_mapping)
63  {
64  $pg_map = $a_mapping->getMappingsOfEntity("Modules/MediaPool", "pg");
65 
66  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
67  include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
68  foreach ($pg_map as $pg_id)
69  {
70  $mep_id = ilMediaPoolItem::getPoolForItemId($pg_id);
71  $mep_id = current($mep_id);
72  ilMediaPoolPage::_writeParentId("mep", $pg_id, $mep_id);
73  }
74  }
75 
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:24
finalProcessing($a_mapping)
Final processing.
Xml importer class.