ILIAS  release_8 Revision v8.24
ilCOPageExporter Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilCOPageExporter:
+ Collaboration diagram for ilCOPageExporter:

Public Member Functions

 getXmlExportHeadDependencies (string $a_entity, string $a_target_release, array $a_ids)
 Get head dependencies. More...
 
 getXmlExportTailDependencies (string $a_entity, string $a_target_release, array $a_ids)
 Get tail dependencies. More...
 
 getXmlRepresentation (string $a_entity, string $a_schema_version, string $a_id)
 
 getValidSchemaVersions (string $a_entity)
 Returns schema versions that the component can export to. More...
 
- Public Member Functions inherited from ilXmlExporter
 __construct ()
 
 setExport (ilExport $a_exp)
 
 getExport ()
 
 getXmlRepresentation (string $a_entity, string $a_schema_version, string $a_id)
 
 init ()
 
 setExportDirectories (string $a_dir_relative, string $a_dir_absolute)
 
 getRelativeExportDirectory ()
 
 getAbsoluteExportDirectory ()
 
 getXmlExportHeadDependencies (string $a_entity, string $a_target_release, array $a_ids)
 Get head dependencies. More...
 
 getXmlExportTailDependencies (string $a_entity, string $a_target_release, array $a_ids)
 Get tail dependencies. More...
 
 getValidSchemaVersions (string $a_entity)
 Returns schema versions that the component can export to. More...
 
 determineSchemaVersion (string $a_entity, string $a_target_release)
 

Protected Attributes

ilExportConfig $config
 
array $plugin_dependencies = array()
 
- Protected Attributes inherited from ilXmlExporter
string $dir_relative = ""
 
string $dir_absolute = ""
 
ilExport $exp
 

Private Attributes

ilCOPageDataSet $ds
 

Additional Inherited Members

- Static Public Member Functions inherited from ilXmlExporter
static lookupExportDirectory (string $a_obj_type, int $a_obj_id, string $a_export_type='xml', string $a_entity="")
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Exporter class for meta data

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 23 of file class.ilCOPageExporter.php.

Member Function Documentation

◆ getValidSchemaVersions()

ilCOPageExporter::getValidSchemaVersions ( string  $a_entity)

Returns schema versions that the component can export to.

ILIAS chooses the first one, that has min/max constraints which fit to the target release. Please put the newest on top. Example: return array ( "4.1.0" => array( "namespace" => "http://www.ilias.de/Services/MetaData/md/4_1", "xsd_file" => "ilias_md_4_1.xsd", "min" => "4.1.0", "max" => "") );

Reimplemented from ilXmlExporter.

Definition at line 199 of file class.ilCOPageExporter.php.

201 : array {
202 if ($a_entity == "pg") {
203 return array(
204 "4.2.0" => array(
205 "namespace" => "https://www.ilias.de/Services/COPage/pg/4_2",
206 "xsd_file" => "ilias_pg_4_2.xsd",
207 "min" => "4.2.0",
208 "max" => ""),
209 "4.1.0" => array(
210 "namespace" => "https://www.ilias.de/Services/COPage/pg/4_1",
211 "xsd_file" => "ilias_pg_4_1.xsd",
212 "min" => "4.1.0",
213 "max" => "4.1.99")
214 );
215 }
216 if ($a_entity == "pgtp") {
217 return array(
218 "4.2.0" => array(
219 "namespace" => "https://www.ilias.de/Services/COPage/pgtp/4_1",
220 "xsd_file" => "ilias_pgtp_4_1.xsd",
221 "uses_dataset" => true,
222 "min" => "4.2.0",
223 "max" => "")
224 );
225 }
226 return [];
227 }

◆ getXmlExportHeadDependencies()

ilCOPageExporter::getXmlExportHeadDependencies ( string  $a_entity,
string  $a_target_release,
array  $a_ids 
)

Get head dependencies.

Returns
array array of array with keys "component", entity", "ids"

Reimplemented from ilXmlExporter.

Definition at line 78 of file class.ilCOPageExporter.php.

82 : array {
83 if ($a_entity == "pg") {
84 // get all media objects and files of the page
85 $mob_ids = array();
86 $file_ids = array();
87 foreach ($a_ids as $pg_id) {
88 $pg_id = explode(":", $pg_id);
89
90 $lang = ($this->config->getMasterLanguageOnly())
91 ? "-"
92 : "";
93
94 // get media objects
95 if ($this->config->getIncludeMedia()) {
96 $mids = ilObjMediaObject::_getMobsOfObject($pg_id[0] . ":pg", $pg_id[1], 0, $lang);
97 foreach ($mids as $mid) {
98 if (ilObject::_lookupType($mid) == "mob") {
99 $mob_ids[] = $mid;
100 }
101 }
102 }
103
104 // get files
105 $files = ilObjFile::_getFilesOfObject($pg_id[0] . ":pg", $pg_id[1], 0, $lang);
106 foreach ($files as $file) {
107 if (ilObject::_lookupType($file) == "file") {
108 $file_ids[] = $file;
109 }
110 }
111 }
112
113 return array(
114 array(
115 "component" => "Services/MediaObjects",
116 "entity" => "mob",
117 "ids" => $mob_ids),
118 array(
119 "component" => "Modules/File",
120 "entity" => "file",
121 "ids" => $file_ids)
122 );
123 }
124
125 return array();
126 }
static _getMobsOfObject(string $a_type, int $a_id, int $a_usage_hist_nr=0, string $a_lang="-")
static _lookupType(int $id, bool $reference=false)
$lang
Definition: xapiexit.php:26

References $lang, ilObjMediaObject\_getMobsOfObject(), and ilObject\_lookupType().

+ Here is the call graph for this function:

◆ getXmlExportTailDependencies()

ilCOPageExporter::getXmlExportTailDependencies ( string  $a_entity,
string  $a_target_release,
array  $a_ids 
)

Get tail dependencies.

Returns
array array of array with keys "component", entity", "ids"

Reimplemented from ilXmlExporter.

Definition at line 128 of file class.ilCOPageExporter.php.

132 : array {
133 if ($a_entity == "pgtp") {
134 $pg_ids = array();
135 foreach ($a_ids as $id) {
136 $pg_ids[] = "stys:" . $id;
137 }
138
139 return array(
140 array(
141 "component" => "Services/COPage",
142 "entity" => "pg",
143 "ids" => $pg_ids)
144 );
145 }
146
147 if (!empty($this->plugin_dependencies)) {
148 // use numeric keys instead plugin names
149 return array_values($this->plugin_dependencies);
150 }
151
152 return array();
153 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References $id.

◆ getXmlRepresentation()

ilCOPageExporter::getXmlRepresentation ( string  $a_entity,
string  $a_schema_version,
string  $a_id 
)

Reimplemented from ilXmlExporter.

Definition at line 155 of file class.ilCOPageExporter.php.

159 : string {
160 if ($a_entity == "pg") {
161 $id = explode(":", $a_id);
162
163 $langs = array("-");
164 if (!$this->config->getMasterLanguageOnly()) {
166 foreach ($trans as $t) {
167 if ($t != "-") {
168 $langs[] = $t;
169 }
170 }
171 }
172
173 $xml = "";
174 foreach ($langs as $l) {
175 $page_object = ilPageObjectFactory::getInstance($id[0], $id[1], 0, $l);
176 $page_object->buildDom();
177 $page_object->insertInstIntoIDs(IL_INST_ID);
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())
182 ? ""
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 . '>';
186 $xml .= $pxml;
187 $xml .= "</PageObject>";
188 $page_object->freeDom();
189 }
190
191 return $xml;
192 }
193 if ($a_entity == "pgtp") {
194 return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, [$a_id], "", true, true);
195 }
196 return "";
197 }
static getInstance(string $a_parent_type, int $a_id=0, int $a_old_nr=0, string $a_lang="-")
Get page object instance.
static lookupTranslations(string $a_parent_type, int $a_id)
Lookup translations.
const IL_INST_ID
Definition: constants.php:40
$xml
Definition: metadata.php:351

References $id, $xml, ilPageObjectFactory\getInstance(), IL_INST_ID, and ilPageObject\lookupTranslations().

+ Here is the call graph for this function:

Field Documentation

◆ $config

ilExportConfig ilCOPageExporter::$config
protected

Definition at line 26 of file class.ilCOPageExporter.php.

◆ $ds

ilCOPageDataSet ilCOPageExporter::$ds
private

Definition at line 25 of file class.ilCOPageExporter.php.

◆ $plugin_dependencies

array ilCOPageExporter::$plugin_dependencies = array()
protected

Definition at line 43 of file class.ilCOPageExporter.php.


The documentation for this class was generated from the following file: