4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
34 $this->db = $DIC->database();
35 parent::__construct();
48 return array(
"4.1.0",
"4.3.0",
"4.4.0",
"5.1.0");
59 return "http://www.ilias.de/xml/Modules/Wiki/" . $a_entity;
68 protected function getTypes($a_entity, $a_version)
70 if ($a_entity ==
"wiki") {
76 "Description" =>
"text",
77 "StartPage" =>
"text",
79 "Introduction" =>
"text",
80 "Rating" =>
"integer");
86 "Description" =>
"text",
87 "StartPage" =>
"text",
89 "Introduction" =>
"text",
90 "Rating" =>
"integer",
91 "PublicNotes" =>
"integer",
93 "PageToc" =>
"integer",
94 "RatingSide" =>
"integer",
95 "RatingNew" =>
"integer",
96 "RatingExt" =>
"integer");
102 "Description" =>
"text",
103 "StartPage" =>
"text",
105 "Introduction" =>
"text",
106 "Rating" =>
"integer",
107 "PublicNotes" =>
"integer",
109 "PageToc" =>
"integer",
110 "RatingSide" =>
"integer",
111 "RatingNew" =>
"integer",
112 "RatingExt" =>
"integer",
113 "RatingOverall" =>
"integer");
119 "Description" =>
"text",
120 "StartPage" =>
"text",
122 "Introduction" =>
"text",
123 "Rating" =>
"integer",
124 "PublicNotes" =>
"integer",
126 "PageToc" =>
"integer",
127 "RatingSide" =>
"integer",
128 "RatingNew" =>
"integer",
129 "RatingExt" =>
"integer",
130 "RatingOverall" =>
"integer",
131 "LinkMdValues" =>
"integer" 136 if ($a_entity ==
"wpg") {
137 switch ($a_version) {
142 "WikiId" =>
"integer");
150 "WikiId" =>
"integer",
151 "Blocked" =>
"integer",
152 "Rating" =>
"integer");
156 if ($a_entity ==
"wiki_imp_page") {
157 switch ($a_version) {
160 "WikiId" =>
"integer",
161 "PageId" =>
"integer",
163 "Indent" =>
"integer");
175 public function readData($a_entity, $a_version, $a_ids, $a_field =
"")
179 if (!is_array($a_ids)) {
180 $a_ids =
array($a_ids);
183 if ($a_entity ==
"wiki") {
184 switch ($a_version) {
187 " startpage start_page, short, rating, introduction" .
188 " FROM il_wiki_data JOIN object_data ON (il_wiki_data.id = object_data.obj_id)" .
189 " WHERE " .
$ilDB->in(
"id", $a_ids,
false,
"integer"));
194 " startpage start_page, short, rating, introduction," .
195 " public_notes, page_toc, rating_side, rating_new, rating_ext" .
196 " FROM il_wiki_data JOIN object_data ON (il_wiki_data.id = object_data.obj_id)" .
197 " WHERE " .
$ilDB->in(
"id", $a_ids,
false,
"integer"));
202 " startpage start_page, short, rating, rating_overall, introduction," .
203 " public_notes, page_toc, rating_side, rating_new, rating_ext" .
204 " FROM il_wiki_data JOIN object_data ON (il_wiki_data.id = object_data.obj_id)" .
205 " WHERE " .
$ilDB->in(
"id", $a_ids,
false,
"integer"));
210 " startpage start_page, short, rating, rating_overall, introduction," .
211 " public_notes, page_toc, rating_side, rating_new, rating_ext, link_md_values" .
212 " FROM il_wiki_data JOIN object_data ON (il_wiki_data.id = object_data.obj_id)" .
213 " WHERE " .
$ilDB->in(
"id", $a_ids,
false,
"integer"));
218 if ($a_entity ==
"wpg") {
219 switch ($a_version) {
222 " FROM il_wiki_page" .
223 " WHERE " .
$ilDB->in(
"wiki_id", $a_ids,
false,
"integer"));
231 " FROM il_wiki_page" .
232 " WHERE " .
$ilDB->in(
"wiki_id", $a_ids,
false,
"integer"));
237 if ($a_entity ==
"wiki_imp_page") {
238 switch ($a_version) {
241 " FROM il_wiki_imp_pages " .
242 " WHERE " .
$ilDB->in(
"wiki_id", $a_ids,
false,
"integer"));
256 "wpg" =>
array(
"ids" => $a_rec[
"Id"]),
257 "wiki_imp_page" =>
array(
"ids" => $a_rec[
"Id"])
271 public function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
279 include_once(
"./Modules/Wiki/classes/class.ilObjWiki.php");
280 if ($new_id = $a_mapping->getMapping(
'Services/Container',
'objs', $a_rec[
'Id'])) {
284 $newObj->setType(
"wiki");
285 $newObj->create(
true);
288 $newObj->setTitle($a_rec[
"Title"]);
289 $newObj->setDescription($a_rec[
"Description"]);
290 $newObj->setShortTitle($a_rec[
"Short"]);
291 $newObj->setStartPage($a_rec[
"StartPage"]);
292 $newObj->setRatingOverall($a_rec[
"RatingOverall"]);
293 $newObj->setRating($a_rec[
"Rating"]);
294 $newObj->setIntroduction($a_rec[
"Introduction"]);
295 $newObj->setPublicNotes($a_rec[
"PublicNotes"]);
298 if (isset($a_rec[
"PageToc"])) {
300 $newObj->setPageToc($a_rec[
"PageToc"]);
301 $newObj->setRatingAsBlock($a_rec[
"RatingSide"]);
302 $newObj->setRatingForNewPages($a_rec[
"RatingNew"]);
303 $newObj->setRatingCategories($a_rec[
"RatingExt"]);
305 $newObj->setLinkMetadataValues($a_rec[
"LinkMdValues"]);
307 $newObj->update(
true);
308 $this->current_obj = $newObj;
309 $a_mapping->addMapping(
"Modules/Wiki",
"wiki", $a_rec[
"Id"], $newObj->getId());
310 $a_mapping->addMapping(
"Services/Object",
"obj", $a_rec[
"Id"], $newObj->getId());
311 $a_mapping->addMapping(
"Services/Rating",
"rating_category_parent_id", $a_rec[
"Id"], $newObj->getId());
312 $a_mapping->addMapping(
"Services/AdvancedMetaData",
"parent", $a_rec[
"Id"], $newObj->getId());
316 $wiki_id = $a_mapping->getMapping(
"Modules/Wiki",
"wiki", $a_rec[
"WikiId"]);
317 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
319 $wpage->setWikiId($wiki_id);
320 $wpage->setTitle($a_rec[
"Title"]);
323 if (isset($a_rec[
"Blocked"])) {
324 $wpage->setBlocked($a_rec[
"Blocked"]);
325 $wpage->setRating($a_rec[
"Rating"]);
328 $wpage->create(
true);
330 $a_mapping->addMapping(
"Modules/Wiki",
"wpg", $a_rec[
"Id"], $wpage->getId());
331 $a_mapping->addMapping(
"Services/COPage",
"pg",
"wpg:" . $a_rec[
"Id"],
"wpg:" . $wpage->getId());
332 $a_mapping->addMapping(
"Services/AdvancedMetaData",
"advmd_sub_item",
"advmd:wpg:" . $a_rec[
"Id"], $wpage->getId());
335 case "wiki_imp_page":
336 $wiki_id = $a_mapping->getMapping(
"Modules/Wiki",
"wiki", $a_rec[
"WikiId"]);
337 $page_id = $a_mapping->getMapping(
"Modules/Wiki",
"wpg", $a_rec[
"PageId"]);
338 if ($wiki_id > 0 && $page_id > 0 && is_object($this->current_obj) && $this->current_obj->getId() == $wiki_id) {
339 $this->current_obj->addImportantPage($page_id, $a_rec[
"Ord"], $a_rec[
"Indent"]);
getDirectDataFromQuery($a_query, $a_convert_to_leading_upper=true, $a_set=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
getSupportedVersions()
Get supported versions.
getXmlNamespace($a_entity, $a_schema_version)
Get xml namespace.
getTypes($a_entity, $a_version)
Get field types for entity.
importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
Import record.
getDependencies($a_entity, $a_version, $a_rec, $a_ids)
Determine the dependent sets of data.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Create styles array
The data for the language used.
static getLogger($a_component_id)
Get component logger.
A dataset contains in data in a common structure that can be shared and transformed for different pur...
readData($a_entity, $a_version, $a_ids, $a_field="")
Read data.