4 include_once(
"./Services/Export/classes/class.ilXmlImporter.php");
30 include_once(
"./Services/COPage/classes/class.ilCOPageDataSet.php");
32 $this->ds->setDSPrefix(
"ds");
33 $this->config = $this->
getImport()->getConfig(
"Services/COPage");
47 $this->log->debug(
"entity: ".$a_entity.
", id: ".$a_id);
49 if ($a_entity ==
"pgtp")
51 include_once(
"./Services/DataSet/classes/class.ilDataSetImportParser.php");
53 $a_xml, $this->ds, $a_mapping);
56 if ($a_entity ==
"pg")
58 $pg_id = $a_mapping->getMapping(
"Services/COPage",
"pg", $a_id);
60 $this->log->debug(
"mapping id: ".$pg_id);
64 $id = explode(
":", $pg_id);
67 include_once(
"./Services/COPage/classes/class.ilPageObjectFactory.php");
69 while (substr($a_xml, 0, 11) ==
"<PageObject")
71 $l1 = strpos($a_xml,
">");
73 $page_tag =
"<?xml version='1.0'?> ".substr($a_xml, 0, $l1+1).
"</PageObject>";
74 $page_data = simplexml_load_string($page_tag);
75 $lstr = $page_data[
'Language'];
76 $p = strpos($a_xml,
"</PageObject>") + 13;
77 $next_xml =
"<PageObject>".substr($a_xml, $l1+1, $p - $l1 -1);
79 if ($this->config->getForceLanguage() !=
"")
81 $lstr = $this->config->getForceLanguage();
88 $next_xml = str_replace(
"&",
"&", $next_xml);
92 $page->setImportMode(
true);
93 $page->setXMLContent($next_xml);
94 $page->updateFromXML();
99 $new_page->setImportMode(
true);
100 $new_page->setId($id[1]);
101 if ($lstr !=
"" && $lstr !=
"-")
103 $new_page->setLanguage($lstr);
105 $new_page->setXMLContent($next_xml);
106 $new_page->setActive(
true);
108 if (isset($page_data[
"Active"]))
110 $new_page->setActive($page_data[
"Active"]);
112 $new_page->setActivationStart($page_data[
"ActivationStart"]);
113 $new_page->setActivationEnd($page_data[
"ActivationEnd"]);
114 $new_page->setShowActivationInfo($page_data[
"ShowActivationInfo"]);
115 $new_page->createFromXML();
118 $a_xml = substr($a_xml, $p);
123 $a_mapping->addMapping(
"Services/COPage",
"pgl", $a_id.
":".$lstr, $pg_id.
":".$lstr);
128 $this->log->debug(
"done");
138 $this->log->debug(
"start");
139 $pages = $a_mapping->getMappingsOfEntity(
"Services/COPage",
"pgl");
140 $media_objects = $a_mapping->getMappingsOfEntity(
"Services/MediaObjects",
"mob");
141 $file_objects = $a_mapping->getMappingsOfEntity(
"Modules/File",
"file");
143 $ref_mapping = $a_mapping->getMappingsOfEntity(
'Services/Container',
'refs');
147 foreach ($pages as $p)
149 $id = explode(
":", $p);
152 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
155 include_once(
"./Services/COPage/classes/class.ilPageObjectFactory.php");
159 $new_page->buildDom();
160 $med = $new_page->resolveMediaAliases($media_objects, $this->config->getReuseOriginallyExportedMedia());
161 $fil = $new_page->resolveFileItems($file_objects);
162 $res = $new_page->resolveResources($ref_mapping);
164 if (!$this->config->getSkipInternalLinkResolve())
166 $il = $new_page->resolveIntLinks();
167 $this->log->debug(
"resolve internal link for page ".$id[0].
"-".$id[1].
"-".$id[2]);
169 if ($med || $fil || $il ||
$res)
171 $new_page->update(
false,
true);
177 $this->log->debug(
"end");
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
getSchemaVersion()
Get schema version.
Manifest parser for ILIAS standard export files.
Importer class for pages.
finalProcessing($a_mapping)
Final processing.
importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
Import XML.
static getInstance($a_parent_type, $a_id=0, $a_old_nr=0, $a_lang="-")
Get page object instance.
static getLogger($a_component_id)
Get component logger.