ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilWikiExporter Class Reference

Exporter class for wikis. More...

+ Inheritance diagram for ilWikiExporter:
+ Collaboration diagram for ilWikiExporter:

Public Member Functions

 init ()
 Initialisation. More...
 
 getXmlExportTailDependencies ($a_entity, $a_target_release, $a_ids)
 Get tail dependencies. More...
 
 getXmlRepresentation ($a_entity, $a_schema_version, $a_id)
 Get xml representation. More...
 
 getValidSchemaVersions ($a_entity)
 Returns schema versions that the component can export to. More...
 
- Public Member Functions inherited from ilXmlExporter
 __construct ()
 Constructor. More...
 
 setExport (ilExport $a_exp)
 Set export object. More...
 
 getExport ()
 Get export. More...
 
 getXmlRepresentation ($a_entity, $a_schema_version, $a_id)
 Get xml representation. More...
 
 init ()
 
 setExportDirectories ($a_dir_relative, $a_dir_absolute)
 Export directories. More...
 
 getRelativeExportDirectory ()
 Get relative export directory. More...
 
 getAbsoluteExportDirectory ()
 Get absolute export directory. More...
 
 getXmlExportHeadDependencies ($a_entity, $a_target_release, $a_ids)
 Get head dependencies. More...
 
 getXmlExportTailDependencies ($a_entity, $a_target_release, $a_ids)
 Get tail dependencies. More...
 
 getValidSchemaVersions ($a_entity)
 Returns schema versions that the component can export to. More...
 
 determineSchemaVersion ($a_entity, $a_target_release)
 Determine schema version. More...
 

Protected Member Functions

 getActiveAdvMDRecords ($a_id)
 

Protected Attributes

 $wiki_log
 
- Protected Attributes inherited from ilXmlExporter
 $dir_relative
 
 $dir_absolute
 
 $exp
 

Private Attributes

 $ds
 

Additional Inherited Members

- Static Public Member Functions inherited from ilXmlExporter
static lookupExportDirectory ($a_obj_type, $a_obj_id, $a_export_type='xml', $a_entity="")
 export directory lookup More...
 

Detailed Description

Exporter class for wikis.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id:$

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

Member Function Documentation

◆ getActiveAdvMDRecords()

ilWikiExporter::getActiveAdvMDRecords (   $a_id)
protected

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

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

Referenced by getXmlExportTailDependencies().

111  {
112  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
113  $active = array();
114  // selected globals
115  $sel_globals = ilAdvancedMDRecord::getObjRecSelection($a_id, "wpg");
116 
117  foreach (ilAdvancedMDRecord::_getActivatedRecordsByObjectType("wiki", "wpg") as $record_obj) {
118  // local ones and globally activated for the object
119  if ($record_obj->getParentObject() == $a_id || in_array($record_obj->getRecordId(), $sel_globals)) {
120  $active[] = $record_obj->getRecordId();
121  }
122  }
123 
124  $this->wiki_log->debug("active md rec: " . print_r($active, true));
125 
126  return $active;
127  }
Create styles array
The data for the language used.
static _getActivatedRecordsByObjectType($a_obj_type, $a_sub_type="", $a_only_optional=false)
Get activated records by object type.
static getObjRecSelection($a_obj_id, $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 (   $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.

Returns

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

References array.

150  {
151  return array(
152  "4.1.0" => array(
153  "namespace" => "http://www.ilias.de/Modules/Wiki/wiki/4_1",
154  "xsd_file" => "ilias_wiki_4_1.xsd",
155  "uses_dataset" => true,
156  "min" => "4.1.0",
157  "max" => "4.2.99"),
158  "4.3.0" => array(
159  "namespace" => "http://www.ilias.de/Modules/Wiki/wiki/4_3",
160  "xsd_file" => "ilias_wiki_4_3.xsd",
161  "uses_dataset" => true,
162  "min" => "4.3.0",
163  "max" => "4.3.99"),
164  "4.4.0" => array(
165  "namespace" => "http://www.ilias.de/Modules/Wiki/wiki/4_4",
166  "xsd_file" => "ilias_wiki_4_4.xsd",
167  "uses_dataset" => true,
168  "min" => "4.4.0",
169  "max" => "5.0.99"),
170  "5.1.0" => array(
171  "namespace" => "http://www.ilias.de/Modules/Wiki/wiki/5_1",
172  "xsd_file" => "ilias_wiki_5_1.xsd",
173  "uses_dataset" => true,
174  "min" => "5.1.0",
175  "max" => "")
176  );
177  }
Create styles array
The data for the language used.

◆ getXmlExportTailDependencies()

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

Get tail dependencies.

Parameters
stringentity
stringtarget release
arrayids
Returns
array array of array with keys "component", entity", "ids"

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

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

46  {
47  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
48  $pg_ids = array();
49  foreach ($a_ids as $id) {
50  $pages = ilWikiPage::getAllWikiPages($id);
51  foreach ($pages as $p) {
52  if (ilWikiPage::_exists("wpg", $p["id"])) {
53  $pg_ids[] = "wpg:" . $p["id"];
54  }
55  }
56  }
57 
58  $deps = array(
59  array(
60  "component" => "Services/COPage",
61  "entity" => "pg",
62  "ids" => $pg_ids),
63  array(
64  "component" => "Services/Rating",
65  "entity" => "rating_category",
66  "ids" => $a_ids
67  )
68  );
69 
70  $advmd_ids = array();
71  foreach ($a_ids as $id) {
72  $rec_ids = $this->getActiveAdvMDRecords($id);
73  $this->wiki_log->debug("advmd rec ids: wiki id:" . $id . ", adv rec ids" . print_r($rec_ids, true));
74  if (sizeof($rec_ids)) {
75  foreach ($rec_ids as $rec_id) {
76  $advmd_ids[] = $id . ":" . $rec_id;
77  }
78  }
79  }
80 
81  $this->wiki_log->debug("advmd ids: " . print_r($advmd_ids, true));
82 
83  if (sizeof($advmd_ids)) {
84  $deps[] = array(
85  "component" => "Services/AdvancedMetaData",
86  "entity" => "advmd",
87  "ids" => $advmd_ids
88  );
89  }
90 
91  // style
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  // service settings
102  $deps[] = array(
103  "component" => "Services/Object",
104  "entity" => "service_settings",
105  "ids" => $a_ids);
106 
107  return $deps;
108  }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
if(!array_key_exists('StateId', $_REQUEST)) $id
static getAllWikiPages($a_wiki_id)
Get all pages of wiki.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ getXmlRepresentation()

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

Get xml representation.

Parameters
stringentity
stringtarget release
stringid
Returns
string xml string

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

138  {
139  return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, $a_id, "", true, true);
140  }

◆ init()

ilWikiExporter::init ( )

Initialisation.

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

References ilLoggerFactory\getLogger().

27  {
28  include_once("./Modules/Wiki/classes/class.ilWikiDataSet.php");
29  $this->ds = new ilWikiDataSet();
30  $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
31  $this->ds->setDSPrefix("ds");
32 
33  $this->wiki_log = ilLoggerFactory::getLogger('wiki');
34  }
Wiki Data set class.
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:

Field Documentation

◆ $ds

ilWikiExporter::$ds
private

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

◆ $wiki_log

ilWikiExporter::$wiki_log
protected

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


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