4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
27 return array(
"4.1.0",
"4.3.0");
38 return "http://www.ilias.de/xml/Modules/Wiki/".$a_entity;
47 protected function getTypes($a_entity, $a_version)
49 if ($a_entity ==
"wiki")
57 "Description" =>
"text",
58 "StartPage" =>
"text",
60 "Introduction" =>
"text",
61 "Rating" =>
"integer");
67 "Description" =>
"text",
68 "StartPage" =>
"text",
70 "Introduction" =>
"text",
71 "Rating" =>
"integer",
72 "PublicNotes" =>
"integer",
74 "PageToc" =>
"integer",
75 "RatingSide" =>
"integer",
76 "RatingNew" =>
"integer",
77 "RatingExt" =>
"integer");
83 "Description" =>
"text",
84 "StartPage" =>
"text",
86 "Introduction" =>
"text",
87 "Rating" =>
"integer",
88 "PublicNotes" =>
"integer",
90 "PageToc" =>
"integer",
91 "RatingSide" =>
"integer",
92 "RatingNew" =>
"integer",
93 "RatingExt" =>
"integer",
94 "RatingOverall" =>
"integer");
98 if ($a_entity ==
"wpg")
106 "WikiId" =>
"integer");
112 "WikiId" =>
"integer",
113 "Blocked" =>
"integer",
114 "Rating" =>
"integer");
126 function readData($a_entity, $a_version, $a_ids, $a_field =
"")
130 if (!is_array($a_ids))
132 $a_ids = array($a_ids);
135 if ($a_entity ==
"wiki")
141 " startpage start_page, short, rating, introduction".
142 " FROM il_wiki_data JOIN object_data ON (il_wiki_data.id = object_data.obj_id)".
143 " WHERE ".$ilDB->in(
"id", $a_ids,
false,
"integer"));
148 " startpage start_page, short, rating, introduction,".
149 " public_notes, page_toc, rating_side, rating_new, rating_ext".
150 " FROM il_wiki_data JOIN object_data ON (il_wiki_data.id = object_data.obj_id)".
151 " WHERE ".$ilDB->in(
"id", $a_ids,
false,
"integer"));
156 " startpage start_page, short, rating, rating_overall, introduction,".
157 " public_notes, page_toc, rating_side, rating_new, rating_ext".
158 " FROM il_wiki_data JOIN object_data ON (il_wiki_data.id = object_data.obj_id)".
159 " WHERE ".$ilDB->in(
"id", $a_ids,
false,
"integer"));
164 if ($a_entity ==
"wpg")
170 " FROM il_wiki_page".
171 " WHERE ".$ilDB->in(
"wiki_id", $a_ids,
false,
"integer"));
177 " FROM il_wiki_page".
178 " WHERE ".$ilDB->in(
"wiki_id", $a_ids,
false,
"integer"));
194 "wpg" => array(
"ids" => $a_rec[
"Id"])
208 function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
217 include_once(
"./Modules/Wiki/classes/class.ilObjWiki.php");
218 if($new_id = $a_mapping->getMapping(
'Services/Container',
'objs',$a_rec[
'Id']))
225 $newObj->setType(
"wiki");
226 $newObj->create(
true);
229 $newObj->setTitle($a_rec[
"Title"]);
230 $newObj->setDescription($a_rec[
"Description"]);
231 $newObj->setShortTitle($a_rec[
"Short"]);
232 $newObj->setStartPage($a_rec[
"StartPage"]);
233 $newObj->setRatingOverall($a_rec[
"RatingOverall"]);
234 $newObj->setRating($a_rec[
"Rating"]);
235 $newObj->setIntroduction($a_rec[
"Introduction"]);
236 $newObj->setPublicNotes($a_rec[
"PublicNotes"]);
239 if(isset($a_rec[
"PageToc"]))
242 $newObj->setPageToc($a_rec[
"PageToc"]);
243 $newObj->setRatingAsBlock($a_rec[
"RatingSide"]);
244 $newObj->setRatingForNewPages($a_rec[
"RatingNew"]);
245 $newObj->setRatingCategories($a_rec[
"RatingExt"]);
248 $newObj->update(
true);
249 $this->current_obj = $newObj;
250 $a_mapping->addMapping(
"Modules/Wiki",
"wiki", $a_rec[
"Id"], $newObj->getId());
251 $a_mapping->addMapping(
"Services/Rating",
"rating_category_parent_id", $a_rec[
"Id"], $newObj->getId());
252 $a_mapping->addMapping(
"Services/AdvancedMetaData",
"parent", $a_rec[
"Id"], $newObj->getId());
256 $wiki_id = $a_mapping->getMapping(
"Modules/Wiki",
"wiki", $a_rec[
"WikiId"]);
257 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
259 $wpage->setWikiId($wiki_id);
260 $wpage->setTitle($a_rec[
"Title"]);
263 if(isset($a_rec[
"Blocked"]))
265 $wpage->setBlocked($a_rec[
"Blocked"]);
266 $wpage->setRating($a_rec[
"Rating"]);
269 $wpage->create(
true);
271 $a_mapping->addMapping(
"Modules/Wiki",
"wpg", $a_rec[
"Id"], $wpage->getId());
272 $a_mapping->addMapping(
"Services/COPage",
"pg",
"wpg:".$a_rec[
"Id"],
"wpg:".$wpage->getId());
273 $a_mapping->addMapping(
"Services/AdvancedMetaData",
"advmd_sub_item",
"advmd:wpg:".$a_rec[
"Id"], $wpage->getId());