4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
26 return array(
"4.1.0");
38 return "http://www.ilias.de/xml/Services/News/".$a_entity;
47 protected function getTypes($a_entity, $a_version)
49 if ($a_entity ==
"news")
58 "Priority" =>
"integer",
59 "ContextObjId" =>
"integer",
60 "ContextObjType" =>
"text",
61 "ContextSubObjId" =>
"integer",
62 "ContextSubObjType" =>
"text",
63 "ContentType" =>
"text",
64 "Visibility" =>
"text",
65 "ContentLong" =>
"text",
66 "ContentIsLangVar" =>
"integer",
81 function readData($a_entity, $a_version, $a_ids, $a_field =
"")
85 if (!is_array($a_ids))
87 $a_ids = array($a_ids);
90 if ($a_entity ==
"news")
96 " context_obj_id, context_obj_type, context_sub_obj_id, context_sub_obj_type, ".
97 " content_type, visibility, content_long, content_is_lang_var, mob_id, playtime".
98 " FROM il_news_item ".
100 $ilDB->in(
"id", $a_ids,
false,
"integer"));
122 function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
131 if ($a_rec[
"MobId"] > 0)
133 $mob_id = $a_mapping->getMapping(
"Services/MediaObjects",
"mob", $a_rec[
"MobId"]);
135 $c = (int)$a_rec[
"ContextObjId"].
":".$a_rec[
"ContextObjType"].
":".(
int)$a_rec[
"ContextSubObjId"].
136 ":".$a_rec[
"ContextSubObjType"];
137 $context = $a_mapping->getMapping(
"Services/News",
"news_context", $c);
138 $context = explode(
":", $context);
141 include_once(
"./Services/News/classes/class.ilNewsItem.php");
143 $newObj->setTitle($a_rec[
"Title"]);
144 $newObj->setContent($a_rec[
"Content"]);
145 $newObj->setPriority($a_rec[
"Priority"]);
146 $newObj->setContextObjId($context[0]);
147 $newObj->setContextObjType($context[1]);
148 $newObj->setContextSubObjId($context[2]);
149 $newObj->setContextSubObjType($context[3]);
150 $newObj->setContentType($a_rec[
"ContentType"]);
151 $newObj->setVisibility($a_rec[
"Visibility"]);
152 $newObj->setContentLong($a_rec[
"ContentLong"]);
153 $newObj->setContentIsLangVar($a_rec[
"ContentIsLangVar"]);
154 $newObj->setMobId($mob_id);
155 $newObj->setPlaytime($a_rec[
"Playtime"]);
157 $a_mapping->addMapping(
"Services/News",
"news", $a_rec[
"Id"], $newObj->getId());