ILIAS  release_8 Revision v8.24
ilContentPageExporter Class Reference
+ Inheritance diagram for ilContentPageExporter:
+ Collaboration diagram for ilContentPageExporter:

Public Member Functions

 init ()
 
 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...
 
 getXmlExportTailDependencies (string $a_entity, string $a_target_release, array $a_ids)
 Get tail dependencies. 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

ilContentPageDataSet $ds
 
DomainService $content_style_domain
 
- Protected Attributes inherited from ilXmlExporter
string $dir_relative = ""
 
string $dir_absolute = ""
 
ilExport $exp
 

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="")
 
- Data Fields inherited from ilContentPageObjectConstants
const OBJ_TYPE = 'copa'
 
const HTTP_PARAM_PAGE_EDITOR_STYLE_CONTEXT = 'page_editor_style'
 
const UI_CMD_VIEW = 'view'
 
const UI_CMD_EDIT = 'edit'
 
const UI_CMD_UPDATE = 'update'
 
const UI_CMD_COPAGE_DOWNLOAD_FILE = 'downloadFile'
 
const UI_CMD_COPAGE_DISPLAY_FULLSCREEN = 'displayMediaFullscreen'
 
const UI_CMD_COPAGE_DISPLAY_MEDIA = 'displayMedia'
 
const UI_CMD_COPAGE_DOWNLOAD_PARAGRAPH = 'download_paragraph'
 
const UI_CMD_COPAGE_EDIT = 'edit'
 
const UI_CMD_STYLES_EDIT = 'editStyleProperties'
 
const UI_TAB_ID_CONTENT = 'content'
 
const UI_TAB_ID_INFO = 'info_short'
 
const UI_TAB_ID_SETTINGS = 'settings'
 
const UI_TAB_ID_STYLE = 'style'
 
const UI_TAB_ID_I18N = 'i18n'
 
const UI_TAB_ID_LP = 'learning_progress'
 
const UI_TAB_ID_EXPORT = 'export'
 
const UI_TAB_ID_PERMISSIONS = 'perm_settings'
 

Detailed Description

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

Member Function Documentation

◆ getValidSchemaVersions()

ilContentPageExporter::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 46 of file class.ilContentPageExporter.php.

46 : array
47 {
48 return [
49 '5.4.0' => [
50 'namespace' => 'http://www.ilias.de/Modules/ContentPage/' . self::OBJ_TYPE . '/5_4',
51 'xsd_file' => 'ilias_' . self::OBJ_TYPE . '_5_4.xsd',
52 'uses_dataset' => true,
53 'min' => '5.4.0',
54 'max' => '',
55 ],
56 ];
57 }

◆ getXmlExportTailDependencies()

ilContentPageExporter::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 59 of file class.ilContentPageExporter.php.

59 : array
60 {
61 $pageObjectIds = [];
62 $styleIds = [];
63
64 foreach ($a_ids as $copaObjId) {
65 $copa = ilObjectFactory::getInstanceByObjId($copaObjId, false);
66 if (!$copa || !($copa instanceof ilObjContentPage)) {
67 continue;
68 }
69
70 $copaPageObjIds = $copa->getPageObjIds();
71 foreach ($copaPageObjIds as $copaPageObjId) {
72 $pageObjectIds[] = self::OBJ_TYPE . ':' . $copaPageObjId;
73 }
74
75 $style_id = $this->content_style_domain
76 ->styleForObjId($copa->getId())
77 ->getStyleId();
78 if ($style_id > 0) {
79 $styleIds[$style_id] = $style_id;
80 }
81 }
82
83 $deps = [];
84
85 if (count($pageObjectIds) > 0) {
86 $deps[] = [
87 'component' => 'Services/COPage',
88 'entity' => 'pg',
89 'ids' => $pageObjectIds,
90 ];
91 }
92
93 if (count($styleIds) > 0) {
94 $deps[] = [
95 'component' => 'Services/Style',
96 'entity' => 'sty',
97 'ids' => array_values($styleIds),
98 ];
99 }
100
101 if (self::OBJ_TYPE === $a_entity) {
102 $deps[] = [
103 'component' => 'Services/Object',
104 'entity' => 'common',
105 'ids' => $a_ids
106 ];
107 }
108
109 return $deps;
110 }
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id

References ilObjectFactory\getInstanceByObjId().

+ Here is the call graph for this function:

◆ getXmlRepresentation()

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

Reimplemented from ilXmlExporter.

Definition at line 38 of file class.ilContentPageExporter.php.

38 : string
39 {
41 $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
42
43 return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, [$a_id], '', true, true);
44 }
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.

References ilXmlExporter\getAbsoluteExportDirectory(), and ilFileUtils\makeDirParents().

+ Here is the call graph for this function:

◆ init()

ilContentPageExporter::init ( )

Reimplemented from ilXmlExporter.

Definition at line 28 of file class.ilContentPageExporter.php.

28 : void
29 {
30 global $DIC;
31
32 $this->ds = new ilContentPageDataSet();
33 $this->ds->setDSPrefix('ds');
34 $this->content_style_domain = $DIC->contentStyle()
35 ->domain();
36 }
Class ilContentPageDataSet.
global $DIC
Definition: feed.php:28

References $DIC.

Field Documentation

◆ $content_style_domain

DomainService ilContentPageExporter::$content_style_domain
protected

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

◆ $ds

ilContentPageDataSet ilContentPageExporter::$ds
protected

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


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