ILIAS  release_8 Revision v8.24
class.ilWikiExporter.php
Go to the documentation of this file.
1<?php
2
25{
27 protected \ILIAS\Style\Content\DomainService $content_style_domain;
29
30 public function init(): 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 }
41
43 string $a_entity,
44 string $a_target_release,
45 array $a_ids
46 ): array {
47 $pg_ids = array();
48 foreach ($a_ids as $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 }
121
122 protected function getActiveAdvMDRecords(int $a_id): 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 }
139
140 public function getXmlRepresentation(
141 string $a_entity,
142 string $a_schema_version,
143 string $a_id
144 ): string {
145 return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, [$a_id], "", true, true);
146 }
147
148 public function getValidSchemaVersions(string $a_entity): 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 }
183}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
return true
static getObjRecSelection(int $a_obj_id, string $a_sub_type="")
Get repository object record selection.
static _getActivatedRecordsByObjectType(string $a_obj_type, string $a_sub_type="", bool $a_only_optional=false)
Get activated records by object type.
static getLogger(string $a_component_id)
Get component logger.
Component logger with individual log levels by component id.
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS Style Content DomainService $content_style_domain
getActiveAdvMDRecords(int $a_id)
getXmlExportTailDependencies(string $a_entity, string $a_target_release, array $a_ids)
Get tail dependencies.
getXmlRepresentation(string $a_entity, string $a_schema_version, string $a_id)
getValidSchemaVersions(string $a_entity)
Returns schema versions that the component can export to.
static getAllWikiPages(int $a_wiki_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
return['3gp', '7z', 'ai', 'aif', 'aifc', 'aiff', 'au', 'arw', 'avi', 'backup', 'bak', 'bas', 'bpmn', 'bpmn2', 'bmp', 'bib', 'bibtex', 'bz', 'bz2', 'c', 'c++', 'cc', 'cct', 'cdf', 'cer', 'class', 'cls', 'conf', 'cpp', 'crt', 'crs', 'crw', 'cr2', 'css', 'cst', 'csv', 'cur', 'db', 'dcr', 'des', 'dng', 'doc', 'docx', 'dot', 'dotx', 'dtd', 'dvi', 'el', 'eps', 'epub', 'f', 'f77', 'f90', 'flv', 'for', 'g3', 'gif', 'gl', 'gan', 'ggb', 'gsd', 'gsm', 'gtar', 'gz', 'gzip', 'h', 'hpp', 'htm', 'html', 'htmls', 'ibooks', 'ico', 'ics', 'ini', 'ipynb', 'java', 'jbf', 'jpeg', 'jpg', 'js', 'jsf', 'jso', 'json', 'latex', 'lang', 'less', 'log', 'lsp', 'ltx', 'm1v', 'm2a', 'm2v', 'm3u', 'm4a', 'm4v', 'markdown', 'm', 'mat', 'md', 'mdl', 'mdown', 'mid', 'min', 'midi', 'mobi', 'mod', 'mov', 'movie', 'mp2', 'mp3', 'mp4', 'mpa', 'mpeg', 'mpg', 'mph', 'mpga', 'mpp', 'mpt', 'mpv', 'mpx', 'mv', 'mw', 'mv4', 'nb', 'nbp', 'nef', 'nif', 'niff', 'obj', 'obm', 'odt', 'ods', 'odp', 'odg', 'odf', 'oga', 'ogg', 'ogv', 'old', 'p', 'pas', 'pbm', 'pcl', 'pct', 'pcx', 'pdf', 'pgm', 'pic', 'pict', 'png', 'por', 'pov', 'project', 'properties', 'ppa', 'ppm', 'pps', 'ppsx', 'ppt', 'pptx', 'ppz', 'ps', 'psd', 'pwz', 'qt', 'qtc', 'qti', 'qtif', 'r', 'ra', 'ram', 'rar', 'rast', 'rda', 'rev', 'rexx', 'ris', 'rf', 'rgb', 'rm', 'rmd', 'rmi', 'rmm', 'rmp', 'rt', 'rtf', 'rtx', 'rv', 's', 's3m', 'sav', 'sbs', 'sec', 'sdml', 'sgm', 'sgml', 'smi', 'smil', 'srt', 'sps', 'spv', 'stl', 'svg', 'swa', 'swf', 'swz', 'tar', 'tex', 'texi', 'texinfo', 'text', 'tgz', 'tif', 'tiff', 'ttf', 'txt', 'tmp', 'uvproj', 'vdf', 'vimeo', 'viv', 'vivo', 'vrml', 'vsdx', 'wav', 'webm', 'wmv', 'wmx', 'wmz', 'woff', 'wwd', 'xhtml', 'xif', 'xls', 'xlsx', 'xmind', 'xml', 'xsl', 'xsd', 'zip']
global $DIC
Definition: feed.php:28