4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
29 return array(
"4.3.0",
"4.1.0");
40 return "http://www.ilias.de/xml/Services/MediaObject/".$a_entity;
49 protected function getTypes($a_entity, $a_version)
52 if ($a_entity ==
"mob")
61 "Description" =>
"text",
68 if ($a_entity ==
"mob_media_item")
77 "Height" =>
"integer",
83 "LocationType" =>
"text",
85 "TextRepresentation" =>
"text"
93 "Height" =>
"integer",
99 "LocationType" =>
"text",
101 "TextRepresentation" =>
"text"
107 if ($a_entity ==
"mob_mi_map_area")
118 "LinkType" =>
"text",
123 "TargetFrame" =>
"text",
124 "HighlightMode" =>
"text",
125 "HighlightText" =>
"text"
131 if ($a_entity ==
"mob_mi_parameter")
152 function readData($a_entity, $a_version, $a_ids, $a_field =
"")
156 if (!is_array($a_ids))
158 $a_ids = array($a_ids);
162 if ($a_entity ==
"mob")
164 $this->data = array();
166 foreach ($a_ids as $mob_id)
170 $this->data[] = array (
"Id" => $mob_id,
178 if ($a_entity ==
"mob_media_item")
184 "caption, nr, purpose, location, location_type, format, text_representation".
185 " FROM media_item WHERE ".
186 $ilDB->in(
"mob_id", $a_ids,
false,
"integer"));
191 "caption, nr, purpose, location, location_type, format, text_representation".
192 " FROM media_item WHERE ".
193 $ilDB->in(
"mob_id", $a_ids,
false,
"integer"));
200 if ($a_entity ==
"mob_mi_map_area")
207 " ,shape, coords, link_type, title, href, target, type, target_frame, ".
208 " highlight_mode, highlight_class".
211 $ilDB->in(
"item_id", $a_ids,
false,
"integer").
218 if ($a_entity ==
"mob_mi_parameter")
225 " FROM mob_parameter ".
227 $ilDB->in(
"med_item_id", $a_ids,
false,
"integer"));
243 "mob_media_item" => array(
"ids" => $a_rec[
"Id"])
246 case "mob_media_item":
248 "mob_mi_map_area" => array(
"ids" => $a_rec[
"Id"]),
249 "mob_mi_parameter" => array(
"ids" => $a_rec[
"Id"])
263 if ($a_entity ==
"mob")
265 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
267 $a_set[
"Dir"] = $dir;
279 function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
290 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
292 $newObj->setType(
"mob");
293 $newObj->setTitle($a_rec[
"Title"]);
294 $newObj->setDescription($a_rec[
"Description"]);
296 $newObj->createDirectory();
298 $this->current_mob = $newObj;
300 $dir = str_replace(
"..",
"", $a_rec[
"Dir"]);
308 $a_mapping->addMapping(
"Services/MediaObjects",
"mob", $a_rec[
"Id"], $newObj->getId());
310 $a_mapping->addMapping(
"Services/MetaData",
"md",
311 "0:".$a_rec[
"Id"].
":mob",
"0:".$newObj->getId().
":mob");
314 case "mob_media_item":
317 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
318 $mob_id = (int) $a_mapping->getMapping(
"Services/MediaObjects",
"mob", $a_rec[
"MobId"]);
319 if (is_object($this->current_mob) && $this->current_mob->getId() == $mob_id)
321 $mob = $this->current_mob;
328 include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
330 $newObj->setMobId($mob_id);
331 $newObj->setWidth($a_rec[
"Width"]);
332 $newObj->setHeight($a_rec[
"Height"]);
333 $newObj->setCaption($a_rec[
"Caption"]);
334 $newObj->setNr($a_rec[
"Nr"]);
335 $newObj->setPurpose($a_rec[
"Purpose"]);
336 $newObj->setLocation($a_rec[
"Location"]);
337 $newObj->setLocationType($a_rec[
"LocationType"]);
338 $newObj->setFormat($a_rec[
"Format"]);
339 $newObj->setTextRepresentation($a_rec[
"TextRepresentation"]);
341 $this->current_media_item = $newObj;
343 $a_mapping->addMapping(
"Services/MediaObjects",
"mob_media_item", $a_rec[
"Id"], $newObj->getId());
347 case "mob_mi_parameter":
350 include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
351 $med_id = (int) $a_mapping->getMapping(
"Services/MediaObjects",
"mob_media_item", $a_rec[
"MiId"]);
352 if (is_object($this->current_media_item) && $this->current_media_item->getId() == $med_id)
354 $med = $this->current_media_item;
360 $med->writeParameter($a_rec[
"Name"], $a_rec[
"Value"]);
364 case "mob_mi_map_area":
366 include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
367 $med_id = (int) $a_mapping->getMapping(
"Services/MediaObjects",
"mob_media_item", $a_rec[
"MiId"]);
368 if (is_object($this->current_media_item) && $this->current_media_item->getId() == $med_id)
370 $med = $this->current_media_item;
377 include_once(
"./Services/MediaObjects/classes/class.ilMapArea.php");
379 $map_area->setItemId($med_id);
380 $map_area->setNr($a_rec[
"Nr"]);
381 $map_area->setShape($a_rec[
"Shape"]);
382 $map_area->setCoords($a_rec[
"Coords"]);
383 $map_area->setLinkType($a_rec[
"LinkType"]);
384 $map_area->setTitle($a_rec[
"Title"]);
385 $map_area->setHref($a_rec[
"Href"]);
386 $map_area->setTarget($a_rec[
"Target"]);
387 $map_area->setType($a_rec[
"Type"]);
388 $map_area->setTargetFrame($a_rec[
"TargetFrame"]);
389 $map_area->setHighlightMode($a_rec[
"HighlightMode"]);
390 $map_area->setHighlightClass($a_rec[
"HighlightClass"]);