ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilMediaPoolImporter.php
Go to the documentation of this file.
1<?php
2
25{
28
29 public function init(): void
30 {
31 $this->ds = new ilMediaPoolDataSet();
32 $this->ds->setDSPrefix("ds");
33
34 $this->config = $this->getImport()->getConfig("components/ILIAS/MediaPool");
35 if ($this->config->getTranslationImportMode()) {
36 $this->ds->setTranslationImportMode(
37 $this->config->getTranslationMep(),
38 $this->config->getTranslationLang()
39 );
40 $cop_config = $this->getImport()->getConfig("components/ILIAS/COPage");
41 $cop_config->setUpdateIfExists(true);
42 $cop_config->setForceLanguage($this->config->getTranslationLang());
43 $cop_config->setReuseOriginallyExportedMedia(true);
44 $cop_config->setSkipInternalLinkResolve(true);
45
46 $mob_config = $this->getImport()->getConfig("components/ILIAS/MediaObjects");
47 $mob_config->setUsePreviousImportIds(true);
48 }
49 }
50
51 public function importXmlRepresentation(
52 string $a_entity,
53 string $a_id,
54 string $a_xml,
55 ilImportMapping $a_mapping
56 ): void {
57 $parser = new ilDataSetImportParser(
58 $a_entity,
59 $this->getSchemaVersion(),
60 $a_xml,
61 $this->ds,
62 $a_mapping
63 );
64 }
65
66 public function finalProcessing(
67 ilImportMapping $a_mapping
68 ): void {
69 $pg_map = $a_mapping->getMappingsOfEntity("components/ILIAS/MediaPool", "pg");
70
71 foreach ($pg_map as $pg_id) {
72 $mep_id = ilMediaPoolItem::getPoolForItemId($pg_id);
73 $mep_id = current($mep_id);
74 ilMediaPoolPage::_writeParentId("mep", $pg_id, $mep_id);
75 }
76 }
77}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Import configuration class parent class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
finalProcessing(ilImportMapping $a_mapping)
importXmlRepresentation(string $a_entity, string $a_id, string $a_xml, ilImportMapping $a_mapping)
static getPoolForItemId(int $a_id)
static _writeParentId(string $a_parent_type, int $a_pg_id, int $a_par_id)
Xml importer class.