ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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 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 124 of file class.ilWikiExporter.php.

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

Referenced by getXmlExportTailDependencies().

124  : array
125  {
126  $active = array();
127  // selected globals
128  $sel_globals = ilAdvancedMDRecord::getObjRecSelection($a_id, "wpg");
129 
130  foreach (ilAdvancedMDRecord::_getActivatedRecordsByObjectType("wiki", "wpg") as $record_obj) {
131  // local ones and globally activated for the object
132  if ($record_obj->getParentObject() === $a_id || in_array($record_obj->getRecordId(), $sel_globals)) {
133  $active[] = $record_obj->getRecordId();
134  }
135  }
136 
137  $this->wiki_log->debug("active md rec: " . print_r($active, true));
138 
139  return $active;
140  }
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 150 of file class.ilWikiExporter.php.

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

◆ getXmlExportTailDependencies()

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

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

References $id, and getActiveAdvMDRecords().

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  return $deps;
122  }
getActiveAdvMDRecords(int $a_id)
$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 142 of file class.ilWikiExporter.php.

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

◆ init()

ilWikiExporter::init ( )

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

References $DIC, and ilLoggerFactory\getLogger().

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.
global $DIC
Definition: shib_login.php:26
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 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: