ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilWikiExporter 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 ilWikiExporter:
+ Collaboration diagram for ilWikiExporter:

Public Member Functions

 init ()
 
 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 Member Functions

 getActiveAdvMDRecords (int $a_id)
 

Protected Attributes

ILIAS Wiki InternalRepoService $page_repo
 
ILIAS Style Content DomainService $content_style_domain
 
ilLogger $wiki_log
 
- Protected Attributes inherited from ilXmlExporter
ilExport $exp
 

Private Attributes

ilWikiDataSet $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 wikis

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

Definition at line 24 of file class.ilWikiExporter.php.

Member Function Documentation

◆ getActiveAdvMDRecords()

ilWikiExporter::getActiveAdvMDRecords ( int  $a_id)
protected

Definition at line 137 of file class.ilWikiExporter.php.

137 : array
138 {
139 $active = array();
140 // selected globals
141 $sel_globals = ilAdvancedMDRecord::getObjRecSelection($a_id, "wpg");
142
143 foreach (ilAdvancedMDRecord::_getActivatedRecordsByObjectType("wiki", "wpg") as $record_obj) {
144 // local ones and globally activated for the object
145 if ($record_obj->getParentObject() === $a_id || in_array($record_obj->getRecordId(), $sel_globals)) {
146 $active[] = $record_obj->getRecordId();
147 }
148 }
149
150 $this->wiki_log->debug("active md rec: " . print_r($active, true));
151
152 return $active;
153 }
static getObjRecSelection(int $a_obj_id, string $a_sub_type="")
Get repository object record selection.
static _getActivatedRecordsByObjectType(string $a_obj_type, string $a_sub_type="", bool $a_only_optional=false)
Get activated records by object type.

References ilAdvancedMDRecord\_getActivatedRecordsByObjectType(), and ilAdvancedMDRecord\getObjRecSelection().

+ Here is the call graph for this function:

◆ getValidSchemaVersions()

ilWikiExporter::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 163 of file class.ilWikiExporter.php.

163 : array
164 {
165 return array(
166 "5.4.0" => array(
167 "namespace" => "https://www.ilias.de/Modules/Wiki/wiki/5_4",
168 "xsd_file" => "ilias_wiki_5_4.xsd",
169 "uses_dataset" => true,
170 "min" => "5.4.0",
171 "max" => ""),
172 "4.1.0" => array(
173 "namespace" => "https://www.ilias.de/Modules/Wiki/wiki/4_1",
174 "xsd_file" => "ilias_wiki_4_1.xsd",
175 "uses_dataset" => true,
176 "min" => "4.1.0",
177 "max" => "4.2.99"),
178 "4.3.0" => array(
179 "namespace" => "https://www.ilias.de/Modules/Wiki/wiki/4_3",
180 "xsd_file" => "ilias_wiki_4_3.xsd",
181 "uses_dataset" => true,
182 "min" => "4.3.0",
183 "max" => "4.3.99"),
184 "4.4.0" => array(
185 "namespace" => "https://www.ilias.de/Modules/Wiki/wiki/4_4",
186 "xsd_file" => "ilias_wiki_4_4.xsd",
187 "uses_dataset" => true,
188 "min" => "4.4.0",
189 "max" => "5.0.99"),
190 "5.1.0" => array(
191 "namespace" => "https://www.ilias.de/Modules/Wiki/wiki/5_1",
192 "xsd_file" => "ilias_wiki_5_1.xsd",
193 "uses_dataset" => true,
194 "min" => "5.1.0",
195 "max" => "5.3.99")
196 );
197 }

◆ getXmlExportTailDependencies()

ilWikiExporter::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 45 of file class.ilWikiExporter.php.

49 : array {
50 $pg_ids = array();
51 foreach ($a_ids as $id) {
52 foreach ($this->page_repo->page()->getWikiPages($id) as $page) {
53 if ($this->page_repo->page()->exists($page->getId())) {
54 $pg_ids[] = "wpg:" . $page->getId();
55 }
56 }
57 }
58
59 $deps = array(
60 array(
61 "component" => "components/ILIAS/COPage",
62 "entity" => "pg",
63 "ids" => $pg_ids),
64 array(
65 "component" => "components/ILIAS/Rating",
66 "entity" => "rating_category",
67 "ids" => $a_ids
68 )
69 );
70
71 $advmd_ids = array();
72 foreach ($a_ids as $id) {
73 $rec_ids = $this->getActiveAdvMDRecords($id);
74 $this->wiki_log->debug("advmd rec ids: wiki id:" . $id . ", adv rec ids" . print_r($rec_ids, true));
75 if (count($rec_ids)) {
76 foreach ($rec_ids as $rec_id) {
77 $advmd_ids[] = $id . ":" . $rec_id;
78 }
79 }
80 }
81
82 $this->wiki_log->debug("advmd ids: " . print_r($advmd_ids, true));
83
84 if (count($advmd_ids)) {
85 $deps[] = array(
86 "component" => "components/ILIAS/AdvancedMetaData",
87 "entity" => "advmd",
88 "ids" => $advmd_ids
89 );
90 }
91
92 // style
93 /*
94 $obj_ids = (is_array($a_ids))
95 ? $a_ids
96 : array($a_ids);
97 $deps[] = array(
98 "component" => "components/ILIAS/Style",
99 "entity" => "object_style",
100 "ids" => $obj_ids
101 );*/
102
103 // style
104 foreach ($a_ids as $id) {
105 $style_id = $this->content_style_domain->styleForObjId($id)->getExportStyleId();
106 if ($style_id > 0) {
107 $deps[] = array(
108 "component" => "components/ILIAS/Style",
109 "entity" => "sty",
110 "ids" => $style_id
111 );
112 }
113 }
114
115 // service settings
116 $deps[] = array(
117 "component" => "components/ILIAS/ILIASObject",
118 "entity" => "common",
119 "ids" => $a_ids);
120
121 // Learning Object Metadata
122 $md_ids = [];
123 foreach ($a_ids as $id) {
124 $md_ids[] = $id . ':0:wiki';
125 }
126 if (!empty($md_ids)) {
127 $deps[] = [
128 'component' => 'components/ILIAS/MetaData',
129 'entity' => 'md',
130 'ids' => $md_ids,
131 ];
132 }
133
134 return $deps;
135 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
getActiveAdvMDRecords(int $a_id)

References $id.

◆ getXmlRepresentation()

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

Reimplemented from ilXmlExporter.

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

159 : string {
160 return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, [$a_id], "", true, true);
161 }

◆ init()

ilWikiExporter::init ( )

Reimplemented from ilXmlExporter.

Definition at line 31 of file class.ilWikiExporter.php.

31 : void
32 {
33 global $DIC;
34
35 $repo = $DIC->wiki()->internal()->repo();
36 $this->ds = new ilWikiDataSet();
37 $this->ds->initByExporter($this);
38 $this->ds->setDSPrefix("ds");
39 $this->wiki_log = ilLoggerFactory::getLogger('wiki');
40 $this->content_style_domain = $DIC->contentStyle()
41 ->domain();
42 $this->page_repo = $repo;
43 }
static getLogger(string $a_component_id)
Get component logger.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:26

References $DIC, and ilLoggerFactory\getLogger().

+ Here is the call graph for this function:

Field Documentation

◆ $content_style_domain

ILIAS Style Content DomainService ilWikiExporter::$content_style_domain
protected

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

◆ $ds

ilWikiDataSet ilWikiExporter::$ds
private

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

◆ $page_repo

ILIAS Wiki InternalRepoService ilWikiExporter::$page_repo
protected

Definition at line 27 of file class.ilWikiExporter.php.

◆ $wiki_log

ilLogger ilWikiExporter::$wiki_log
protected

Definition at line 29 of file class.ilWikiExporter.php.


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