48 public function init(): void
52 $component_repository = $DIC[
"component.repository"];
55 $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
56 $this->ds->setDSPrefix(
"ds");
57 $this->config = $this->
getExport()->getConfig(
"Services/COPage");
58 if ($this->config->getMasterLanguageOnly()) {
59 $this->ds->setMasterLanguageOnly(
true);
63 foreach ($component_repository->getPluginSlotById(
"pgcp")->getActivePlugins() as
$plugin) {
64 $plugin_name =
$plugin->getName();
65 if (
$plugin->supportsExport()) {
66 require_once(
'Customizing/global/plugins/Services/COPage/PageComponent/' 67 . $plugin_name .
'/classes/class.il' . $plugin_name .
'Exporter.php');
69 $this->plugin_dependencies[$plugin_name] = array(
70 "component" =>
"Plugins/" . $plugin_name,
80 string $a_target_release,
83 if ($a_entity ==
"pg") {
87 foreach ($a_ids as $pg_id) {
88 $pg_id = explode(
":", $pg_id);
90 $lang = ($this->config->getMasterLanguageOnly())
95 if ($this->config->getIncludeMedia()) {
97 foreach ($mids as $mid) {
105 $files = ilObjFile::_getFilesOfObject($pg_id[0] .
":pg", $pg_id[1], 0,
$lang);
106 foreach ($files as $file) {
115 "component" =>
"Services/MediaObjects",
119 "component" =>
"Modules/File",
130 string $a_target_release,
133 if ($a_entity ==
"pgtp") {
135 foreach ($a_ids as
$id) {
136 $pg_ids[] =
"stys:" .
$id;
141 "component" =>
"Services/COPage",
147 if (!empty($this->plugin_dependencies)) {
149 return array_values($this->plugin_dependencies);
157 string $a_schema_version,
160 if ($a_entity ==
"pg") {
161 $id = explode(
":", $a_id);
164 if (!$this->config->getMasterLanguageOnly()) {
166 foreach ($trans as $t) {
174 foreach ($langs as $l) {
176 $page_object->buildDom();
178 $this->extractPluginProperties($page_object);
179 $pxml = $page_object->getXMLFromDom(
false,
false,
false,
"",
true);
180 $pxml = str_replace(
"&",
"&", $pxml);
181 $a_media = ($this->config->getIncludeMedia())
183 :
'WithoutMedia="1"';
184 $xml .=
'<PageObject Language="' . $l .
'" Active="' . $page_object->getActive() .
'" ActivationStart="' . $page_object->getActivationStart() .
'" ActivationEnd="' .
185 $page_object->getActivationEnd() .
'" ShowActivationInfo="' . $page_object->getShowActivationInfo() .
'" ' . $a_media .
'>';
187 $xml .=
"</PageObject>";
188 $page_object->freeDom();
193 if ($a_entity ==
"pgtp") {
194 return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, [$a_id],
"",
true,
true);
202 if ($a_entity ==
"pg") {
205 "namespace" =>
"https://www.ilias.de/Services/COPage/pg/4_2",
206 "xsd_file" =>
"ilias_pg_4_2.xsd",
210 "namespace" =>
"https://www.ilias.de/Services/COPage/pg/4_1",
211 "xsd_file" =>
"ilias_pg_4_1.xsd",
216 if ($a_entity ==
"pgtp") {
219 "namespace" =>
"https://www.ilias.de/Services/COPage/pgtp/4_1",
220 "xsd_file" =>
"ilias_pgtp_4_1.xsd",
221 "uses_dataset" =>
true,
237 protected function extractPluginProperties(
240 if (empty($this->plugin_dependencies)) {
245 $domdoc = $a_page->getDomDoc();
247 $nodes = $xpath->query(
"//PageContent[child::Plugged]");
250 foreach ($nodes as $pcnode) {
252 $pc_id = $pcnode->getAttribute(
'PCID');
253 $plnode = $pcnode->childNodes->item(0);
254 $plugin_name = $plnode->getAttribute(
'PluginName');
255 $plugin_version = $plnode->getAttribute(
'PluginVersion');
258 if (isset($this->plugin_dependencies[$plugin_name])) {
261 .
':' . $a_page->
getId()
265 $properties = array();
267 foreach ($plnode->childNodes as $child) {
268 $properties[$child->getAttribute(
'Name')] = $child->nodeValue;
276 $this->plugin_dependencies[$plugin_name][
'ids'][] =
$id;
getXmlRepresentation(string $a_entity, string $a_schema_version, string $a_id)
buildDom(bool $a_force=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static lookupTranslations(string $a_parent_type, int $a_id)
Lookup translations.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getValidSchemaVersions(string $a_entity)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static setPCVersion(string $a_id, string $a_version)
Set the version of a plugged page content This method is used by ilCOPageExporter to provide the vers...
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
getXmlExportHeadDependencies(string $a_entity, string $a_target_release, array $a_ids)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
getXmlExportTailDependencies(string $a_entity, string $a_target_release, array $a_ids)
static _lookupType(int $id, bool $reference=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstance(string $a_parent_type, int $a_id=0, int $a_old_nr=0, string $a_lang="-")
Get page object instance.
array $plugin_dependencies
static setPCProperties(string $a_id, array $a_properties)
Set the properties of a plugged page content This method is used by ilCOPageExporter to provide the p...