48 public function init(): void
52 $component_repository = $DIC[
"component.repository"];
55 $this->ds->initByExporter($this);
56 $this->ds->setDSPrefix(
"ds");
58 $config = $this->
getExport()->getExportConfigs()->getElementByComponent(
'components/ILIAS/COPage');
60 if ($this->config->getMasterLanguageOnly()) {
65 foreach ($component_repository->getPluginSlotById(
"pgcp")->getActivePlugins() as
$plugin) {
66 $plugin_name =
$plugin->getName();
67 if (
$plugin->supportsExport()) {
68 $this->plugin_dependencies[$plugin_name] = array(
69 "component" =>
"Plugins/" . $plugin_name,
79 string $a_target_release,
82 if ($a_entity ==
"pg") {
86 foreach ($a_ids as $pg_id) {
87 $pg_id = explode(
":", $pg_id);
89 $lang = ($this->config->getMasterLanguageOnly())
94 if ($this->config->getIncludeMedia()) {
96 foreach ($mids as $mid) {
104 $files = ilObjFile::_getFilesOfObject($pg_id[0] .
":pg", $pg_id[1], 0,
$lang);
105 foreach ($files as $file) {
114 "component" =>
"components/ILIAS/MediaObjects",
118 "component" =>
"components/ILIAS/File",
129 string $a_target_release,
132 if ($a_entity ==
"pgtp") {
134 foreach ($a_ids as
$id) {
135 $pg_ids[] =
"stys:" .
$id;
140 "component" =>
"components/ILIAS/COPage",
146 if (!empty($this->plugin_dependencies)) {
148 return array_values($this->plugin_dependencies);
156 string $a_schema_version,
159 if ($a_entity ==
"pg") {
160 $id = explode(
":", $a_id);
163 if (!$this->config->getMasterLanguageOnly()) {
165 foreach ($trans as $t) {
173 foreach ($langs as $l) {
175 $page_object->buildDom();
177 $this->extractPluginProperties($page_object);
178 $pxml = $page_object->getXMLFromDom(
false,
false,
false,
"",
true);
179 $pxml = str_replace(
"&",
"&", $pxml);
180 $a_media = ($this->config->getIncludeMedia())
182 :
'WithoutMedia="1"';
183 $xml .=
'<PageObject Language="' . $l .
'" Active="' . $page_object->getActive() .
'" ActivationStart="' . $page_object->getActivationStart() .
'" ActivationEnd="' .
184 $page_object->getActivationEnd() .
'" ShowActivationInfo="' . $page_object->getShowActivationInfo() .
'" ' . $a_media .
'>';
186 $xml .=
"</PageObject>";
187 $page_object->freeDom();
192 if ($a_entity ==
"pgtp") {
193 return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, [$a_id],
"",
true,
true);
201 if ($a_entity ==
"pg") {
204 "namespace" =>
"https://www.ilias.de/Services/COPage/pg/4_2",
205 "xsd_file" =>
"ilias_pg_4_2.xsd",
209 "namespace" =>
"https://www.ilias.de/Services/COPage/pg/4_1",
210 "xsd_file" =>
"ilias_pg_4_1.xsd",
215 if ($a_entity ==
"pgtp") {
218 "namespace" =>
"https://www.ilias.de/Services/COPage/pgtp/4_1",
219 "xsd_file" =>
"ilias_pgtp_4_1.xsd",
220 "uses_dataset" =>
true,
236 protected function extractPluginProperties(
239 if (empty($this->plugin_dependencies)) {
246 $nodes = $xpath->query(
"//PageContent[child::Plugged]");
249 foreach ($nodes as $pcnode) {
251 $pc_id = $pcnode->getAttribute(
'PCID');
252 $plnode = $pcnode->childNodes->item(0);
253 $plugin_name = $plnode->getAttribute(
'PluginName');
254 $plugin_version = $plnode->getAttribute(
'PluginVersion');
257 if (isset($this->plugin_dependencies[$plugin_name])) {
260 .
':' . $a_page->
getId()
264 $properties = array();
266 foreach ($plnode->childNodes as $child) {
267 $properties[$child->getAttribute(
'Name')] = $child->nodeValue;
275 $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...
getDomDoc()
Get dom doc (DOMDocument)
static lookupTranslations(string $a_parent_type, int $a_id)
Lookup translations.
getValidSchemaVersions(string $a_entity)
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...
ilCOPageExportConfig $config
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
setMasterLanguageOnly(bool $a_val, bool $a_include_media=true)
getXmlExportHeadDependencies(string $a_entity, string $a_target_release, array $a_ids)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...