ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
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)
 
 getXmlRepresentation (string $a_entity, string $a_schema_version, string $a_id)
 
 getValidSchemaVersions (string $a_entity)
 
- 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 Style Content DomainService $content_style_domain
 
ilLogger $wiki_log
 
- Protected Attributes inherited from ilXmlExporter
string $dir_relative = ""
 
string $dir_absolute = ""
 
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 122 of file class.ilWikiExporter.php.

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

Referenced by getXmlExportTailDependencies().

122  : array
123  {
124  $active = array();
125  // selected globals
126  $sel_globals = ilAdvancedMDRecord::getObjRecSelection($a_id, "wpg");
127 
128  foreach (ilAdvancedMDRecord::_getActivatedRecordsByObjectType("wiki", "wpg") as $record_obj) {
129  // local ones and globally activated for the object
130  if ($record_obj->getParentObject() === $a_id || in_array($record_obj->getRecordId(), $sel_globals)) {
131  $active[] = $record_obj->getRecordId();
132  }
133  }
134 
135  $this->wiki_log->debug("active md rec: " . print_r($active, true));
136 
137  return $active;
138  }
static _getActivatedRecordsByObjectType(string $a_obj_type, string $a_sub_type="", bool $a_only_optional=false)
Get activated records by object type.
static getObjRecSelection(int $a_obj_id, string $a_sub_type="")
Get repository object record selection.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValidSchemaVersions()

ilWikiExporter::getValidSchemaVersions ( string  $a_entity)

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

148  : array
149  {
150  return array(
151  "5.4.0" => array(
152  "namespace" => "https://www.ilias.de/Modules/Wiki/wiki/5_4",
153  "xsd_file" => "ilias_wiki_5_4.xsd",
154  "uses_dataset" => true,
155  "min" => "5.4.0",
156  "max" => ""),
157  "4.1.0" => array(
158  "namespace" => "https://www.ilias.de/Modules/Wiki/wiki/4_1",
159  "xsd_file" => "ilias_wiki_4_1.xsd",
160  "uses_dataset" => true,
161  "min" => "4.1.0",
162  "max" => "4.2.99"),
163  "4.3.0" => array(
164  "namespace" => "https://www.ilias.de/Modules/Wiki/wiki/4_3",
165  "xsd_file" => "ilias_wiki_4_3.xsd",
166  "uses_dataset" => true,
167  "min" => "4.3.0",
168  "max" => "4.3.99"),
169  "4.4.0" => array(
170  "namespace" => "https://www.ilias.de/Modules/Wiki/wiki/4_4",
171  "xsd_file" => "ilias_wiki_4_4.xsd",
172  "uses_dataset" => true,
173  "min" => "4.4.0",
174  "max" => "5.0.99"),
175  "5.1.0" => array(
176  "namespace" => "https://www.ilias.de/Modules/Wiki/wiki/5_1",
177  "xsd_file" => "ilias_wiki_5_1.xsd",
178  "uses_dataset" => true,
179  "min" => "5.1.0",
180  "max" => "5.3.99")
181  );
182  }

◆ getXmlExportTailDependencies()

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

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

References $id, ilPageObject\_exists(), getActiveAdvMDRecords(), and ilWikiPage\getAllWikiPages().

46  : array {
47  $pg_ids = array();
48  foreach ($a_ids as $id) {
49  $pages = ilWikiPage::getAllWikiPages($id);
50  foreach ($pages as $p) {
51  if (ilWikiPage::_exists("wpg", $p["id"])) {
52  $pg_ids[] = "wpg:" . $p["id"];
53  }
54  }
55  }
56 
57  $deps = array(
58  array(
59  "component" => "Services/COPage",
60  "entity" => "pg",
61  "ids" => $pg_ids),
62  array(
63  "component" => "Services/Rating",
64  "entity" => "rating_category",
65  "ids" => $a_ids
66  )
67  );
68 
69  $advmd_ids = array();
70  foreach ($a_ids as $id) {
71  $rec_ids = $this->getActiveAdvMDRecords($id);
72  $this->wiki_log->debug("advmd rec ids: wiki id:" . $id . ", adv rec ids" . print_r($rec_ids, true));
73  if (count($rec_ids)) {
74  foreach ($rec_ids as $rec_id) {
75  $advmd_ids[] = $id . ":" . $rec_id;
76  }
77  }
78  }
79 
80  $this->wiki_log->debug("advmd ids: " . print_r($advmd_ids, true));
81 
82  if (count($advmd_ids)) {
83  $deps[] = array(
84  "component" => "Services/AdvancedMetaData",
85  "entity" => "advmd",
86  "ids" => $advmd_ids
87  );
88  }
89 
90  // style
91  /*
92  $obj_ids = (is_array($a_ids))
93  ? $a_ids
94  : array($a_ids);
95  $deps[] = array(
96  "component" => "Services/Style",
97  "entity" => "object_style",
98  "ids" => $obj_ids
99  );*/
100 
101  // style
102  foreach ($a_ids as $id) {
103  $style_id = $this->content_style_domain->styleForObjId($id)->getStyleId();
104  if ($style_id > 0) {
105  $deps[] = array(
106  "component" => "Services/Style",
107  "entity" => "sty",
108  "ids" => $style_id
109  );
110  }
111  }
112 
113  // service settings
114  $deps[] = array(
115  "component" => "Services/Object",
116  "entity" => "common",
117  "ids" => $a_ids);
118 
119  return $deps;
120  }
static getAllWikiPages(int $a_wiki_id)
getActiveAdvMDRecords(int $a_id)
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ getXmlRepresentation()

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

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

144  : string {
145  return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, [$a_id], "", true, true);
146  }

◆ init()

ilWikiExporter::init ( )

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

References $DIC, and ilLoggerFactory\getLogger().

30  : void
31  {
32  global $DIC;
33 
34  $this->ds = new ilWikiDataSet();
35  $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
36  $this->ds->setDSPrefix("ds");
37  $this->wiki_log = ilLoggerFactory::getLogger('wiki');
38  $this->content_style_domain = $DIC->contentStyle()
39  ->domain();
40  }
static getLogger(string $a_component_id)
Get component logger.
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ 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 27 of file class.ilWikiExporter.php.

◆ $ds

ilWikiDataSet ilWikiExporter::$ds
private

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

◆ $wiki_log

ilLogger ilWikiExporter::$wiki_log
protected

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


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