ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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...
 
 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)
 

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...
 
- Protected Attributes inherited from ilXmlExporter
 $dir_relative
 
 $dir_absolute
 

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

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

Referenced by getXmlExportTailDependencies().

90  {
91  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
92  $active = array();
93  foreach(ilAdvancedMDRecord::_getActivatedRecordsByObjectType("wiki", "wpg") as $record_obj)
94  {
95  $active[] = $record_obj->getRecordId();
96  }
97  return array_intersect($active, ilAdvancedMDRecord::getObjRecSelection($a_id, "wpg"));
98  }
static _getActivatedRecordsByObjectType($a_obj_type, $a_sub_type="")
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 120 of file class.ilWikiExporter.php.

121  {
122  return array (
123  "4.1.0" => array(
124  "namespace" => "http://www.ilias.de/Modules/Wiki/wiki/4_1",
125  "xsd_file" => "ilias_wiki_4_1.xsd",
126  "uses_dataset" => true,
127  "min" => "4.1.0",
128  "max" => "4.2.99"),
129  "4.3.0" => array(
130  "namespace" => "http://www.ilias.de/Modules/Wiki/wiki/4_3",
131  "xsd_file" => "ilias_wiki_4_3.xsd",
132  "uses_dataset" => true,
133  "min" => "4.3.0",
134  "max" => "")
135  );
136  }

◆ 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 37 of file class.ilWikiExporter.php.

References ilPageObject\_exists(), getActiveAdvMDRecords(), and ilWikiPage\getAllPages().

38  {
39  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
40  $pg_ids = array();
41  foreach ($a_ids as $id)
42  {
43  $pages = ilWikiPage::getAllPages($id);
44  foreach ($pages as $p)
45  {
46  if (ilWikiPage::_exists("wpg", $p["id"]))
47  {
48  $pg_ids[] = "wpg:".$p["id"];
49  }
50  }
51  }
52 
53  $deps = array (
54  array(
55  "component" => "Services/COPage",
56  "entity" => "pg",
57  "ids" => $pg_ids),
58  array(
59  "component" => "Services/Rating",
60  "entity" => "rating_category",
61  "ids" => $a_ids
62  )
63  );
64 
65  $advmd_ids = array();
66  foreach($a_ids as $id)
67  {
68  $rec_ids = $this->getActiveAdvMDRecords($id);
69  if(sizeof($rec_ids))
70  {
71  foreach($rec_ids as $rec_id)
72  {
73  $advmd_ids[] = $id.":".$rec_id;
74  }
75  }
76  }
77  if(sizeof($advmd_ids))
78  {
79  $deps[] = array(
80  "component" => "Services/AdvancedMetaData",
81  "entity" => "advmd",
82  "ids" => $advmd_ids
83  );
84  }
85 
86  return $deps;
87  }
static _exists($a_parent_type, $a_id, $a_lang="")
Checks whether page exists.
static getAllPages($a_wiki_id)
Get all pages of wiki.
+ 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 108 of file class.ilWikiExporter.php.

109  {
110  return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, $a_id, "", true, true);
111  }

◆ init()

ilWikiExporter::init ( )

Initialisation.

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

21  {
22  include_once("./Modules/Wiki/classes/class.ilWikiDataSet.php");
23  $this->ds = new ilWikiDataSet();
24  $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
25  $this->ds->setDSPrefix("ds");
26  }
Wiki Data set class.

Field Documentation

◆ $ds

ilWikiExporter::$ds
private

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


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