ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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
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'
 
const UI_TAB_ID_MD = 'meta_data'
 

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 '9.0' => [
50 'namespace' => 'http://www.ilias.de/Modules/ContentPage/' . self::OBJ_TYPE . '/9',
51 'xsd_file' => 'ilias_' . self::OBJ_TYPE . '_9.xsd',
52 'uses_dataset' => true,
53 'min' => '9.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 $metadataIds = [];
64
65 foreach ($a_ids as $copaObjId) {
66 $copa = ilObjectFactory::getInstanceByObjId($copaObjId, false);
67 if (!$copa || !($copa instanceof ilObjContentPage)) {
68 continue;
69 }
70
71 $metadataIds[] = $copaObjId . ':0:' . self::OBJ_TYPE;
72
73 $copaPageObjIds = $copa->getPageObjIds();
74 foreach ($copaPageObjIds as $copaPageObjId) {
75 $pageObjectIds[] = self::OBJ_TYPE . ':' . $copaPageObjId;
76 }
77
78 $style_id = $this->content_style_domain
79 ->styleForObjId($copa->getId())
80 ->getStyleId();
81 if ($style_id > 0) {
82 $styleIds[$style_id] = $style_id;
83 }
84 }
85
86 $deps = [];
87
88 if (count($pageObjectIds) > 0) {
89 $deps[] = [
90 'component' => 'components/ILIAS/COPage',
91 'entity' => 'pg',
92 'ids' => $pageObjectIds,
93 ];
94 }
95
96 if (count($metadataIds) > 0) {
97 $deps[] = [
98 'component' => 'components/ILIAS/MetaData',
99 'entity' => 'md',
100 'ids' => $metadataIds,
101 ];
102 }
103
104 if (count($styleIds) > 0) {
105 $deps[] = [
106 'component' => 'components/ILIAS/Style',
107 'entity' => 'sty',
108 'ids' => array_values($styleIds),
109 ];
110 }
111
112 if (self::OBJ_TYPE === $a_entity) {
113 $deps[] = [
114 'component' => 'components/ILIAS/ILIASObject',
115 'entity' => 'common',
116 'ids' => $a_ids
117 ];
118 }
119
120 return $deps;
121 }
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id

References ilObjectFactory\getInstanceByObjId(), and ilContentPageObjectConstants\OBJ_TYPE.

+ 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->initByExporter($this);
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 }
global $DIC
Definition: shib_login.php:26

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: