ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 117 of file class.ilWikiExporter.php.

118 {
119 include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
120 $active = array();
121 // selected globals
122 $sel_globals = ilAdvancedMDRecord::getObjRecSelection($a_id, "wpg");
123
124 foreach(ilAdvancedMDRecord::_getActivatedRecordsByObjectType("wiki", "wpg") as $record_obj)
125 {
126 // local ones and globally activated for the object
127 if ($record_obj->getParentObject() == $a_id || in_array($record_obj->getRecordId(), $sel_globals))
128 {
129 $active[] = $record_obj->getRecordId();
130 }
131 }
132
133 $this->wiki_log->debug("active md rec: ".print_r($active, true));
134
135 return $active;
136 }
static getObjRecSelection($a_obj_id, $a_sub_type="")
Get repository object record selection.
static _getActivatedRecordsByObjectType($a_obj_type, $a_sub_type="", $a_only_optional=false)
Get activated records by object type.

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

Referenced by getXmlExportTailDependencies().

+ 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

Reimplemented from ilXmlExporter.

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

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

◆ 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"

Reimplemented from ilXmlExporter.

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

46 {
47 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
48 $pg_ids = array();
49 foreach ($a_ids as $id)
50 {
51 $pages = ilWikiPage::getAllPages($id);
52 foreach ($pages as $p)
53 {
54 if (ilWikiPage::_exists("wpg", $p["id"]))
55 {
56 $pg_ids[] = "wpg:".$p["id"];
57 }
58 }
59 }
60
61 $deps = array (
62 array(
63 "component" => "Services/COPage",
64 "entity" => "pg",
65 "ids" => $pg_ids),
66 array(
67 "component" => "Services/Rating",
68 "entity" => "rating_category",
69 "ids" => $a_ids
70 )
71 );
72
73 $advmd_ids = array();
74 foreach($a_ids as $id)
75 {
76 $rec_ids = $this->getActiveAdvMDRecords($id);
77 $this->wiki_log->debug("advmd rec ids: wiki id:".$id.", adv rec ids".print_r($rec_ids, true));
78 if(sizeof($rec_ids))
79 {
80 foreach($rec_ids as $rec_id)
81 {
82 $advmd_ids[] = $id.":".$rec_id;
83 }
84 }
85 }
86
87 $this->wiki_log->debug("advmd ids: ".print_r($advmd_ids, true));
88
89 if(sizeof($advmd_ids))
90 {
91 $deps[] = array(
92 "component" => "Services/AdvancedMetaData",
93 "entity" => "advmd",
94 "ids" => $advmd_ids
95 );
96 }
97
98 // style
99 $obj_ids = (is_array($a_ids))
100 ? $a_ids
101 : array($a_ids);
102 $deps[] = array(
103 "component" => "Services/Style",
104 "entity" => "object_style",
105 "ids" => $obj_ids
106 );
107
108 // service settings
109 $deps[] = array(
110 "component" => "Services/Object",
111 "entity" => "service_settings",
112 "ids" => $a_ids);
113
114 return $deps;
115 }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
static getAllPages($a_wiki_id)
Get all pages of wiki

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

+ 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

Reimplemented from ilXmlExporter.

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

147 {
148 return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, $a_id, "", true, true);
149 }

◆ init()

ilWikiExporter::init ( )

Initialisation.

Reimplemented from ilXmlExporter.

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

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 }
static getLogger($a_component_id)
Get component logger.
Wiki Data set class.

References ilLoggerFactory\getLogger().

+ 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: