ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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("Modules/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("Services/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("Services/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("Modules/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...
static getPoolForItemId(int $a_id)
importXmlRepresentation(string $a_entity, string $a_id, string $a_xml, ilImportMapping $a_mapping)
static _writeParentId(string $a_parent_type, int $a_pg_id, int $a_par_id)
Manifest parser for ILIAS standard export files.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getMappingsOfEntity(string $a_comp, string $a_entity)
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...