19declare(strict_types=1);
37 $local_dic = TestDIC::dic();
38 $this->session = $local_dic[
'exportimport.session'];
39 $this->importer = $local_dic[
'exportimport.importer'];
44 public function init(): void
47 $co_config = $this->imp->getConfig(
'components/ILIAS/COPage');
48 $co_config->setUpdateIfExists(
true);
50 $this->legacy_importer->setImport($this->
getImport());
52 $this->legacy_importer->init();
62 $session = $this->session->getSession();
64 $this->legacy_importer->setInstallId($this->
getInstallId());
65 $this->legacy_importer->setInstallUrl($this->
getInstallUrl());
68 $this->legacy_importer->importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping);
72 $result = $this->importer->import(
73 XmlDeserializer::fromString($a_xml),
84 $session = $this->session->getSession();
85 if ($session->isLegacyImport()) {
86 $this->legacy_importer->finalProcessing($a_mapping);
90 $this->importer->finalize($a_mapping);
91 $this->finalizeTaxonomyUsage($a_mapping);
98 foreach ($tst_mappings as $old => $new) {
99 if ($old ===
'new_id' || (
int) $old <= 0) {
104 'components/ILIAS/Taxonomy',
109 if ($new_tax_ids !==
null) {
110 $tax_ids = explode(
':', $new_tax_ids);
111 foreach ($tax_ids as $tid) {
Persists the import stage index and session across HTTP requests using \ilSession.
setSession(ImportSession $session)
Orchestrates denormalization and persistence of a test import and its related resources.
getMapping(string $a_comp, string $a_entity, string $a_old_id)
getMappingsOfEntity(string $a_comp, string $a_entity)
static saveUsage(int $a_tax_id, int $a_obj_id)
readonly TestImporter $importer
finalizeTaxonomyUsage(ilImportMapping $a_mapping)
finalProcessing(ilImportMapping $a_mapping)
readonly ImportSessionRepository $session
importXmlRepresentation(string $a_entity, string $a_id, string $a_xml, ilImportMapping $a_mapping)
readonly ilTestLegacyImporter $legacy_importer
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc