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"]);
307 include_once(
"./Services/MediaObjects/classes/class.ilMediaSvgSanitizer.php");
311 $a_mapping->addMapping(
"Services/MediaObjects",
"mob", $a_rec[
"Id"], $newObj->getId());
313 $a_mapping->addMapping(
"Services/MetaData",
"md",
314 "0:".$a_rec[
"Id"].
":mob",
"0:".$newObj->getId().
":mob");
317 case "mob_media_item":
320 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
321 $mob_id = (int) $a_mapping->getMapping(
"Services/MediaObjects",
"mob", $a_rec[
"MobId"]);
322 if (is_object($this->current_mob) && $this->current_mob->getId() == $mob_id)
324 $mob = $this->current_mob;
331 include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
333 $newObj->setMobId($mob_id);
334 $newObj->setWidth($a_rec[
"Width"]);
335 $newObj->setHeight($a_rec[
"Height"]);
336 $newObj->setCaption($a_rec[
"Caption"]);
337 $newObj->setNr($a_rec[
"Nr"]);
338 $newObj->setPurpose($a_rec[
"Purpose"]);
339 $newObj->setLocation($a_rec[
"Location"]);
340 $newObj->setLocationType($a_rec[
"LocationType"]);
341 $newObj->setFormat($a_rec[
"Format"]);
342 $newObj->setTextRepresentation($a_rec[
"TextRepresentation"]);
344 $this->current_media_item = $newObj;
346 $a_mapping->addMapping(
"Services/MediaObjects",
"mob_media_item", $a_rec[
"Id"], $newObj->getId());
350 case "mob_mi_parameter":
353 include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
354 $med_id = (int) $a_mapping->getMapping(
"Services/MediaObjects",
"mob_media_item", $a_rec[
"MiId"]);
355 if (is_object($this->current_media_item) && $this->current_media_item->getId() == $med_id)
357 $med = $this->current_media_item;
363 $med->writeParameter($a_rec[
"Name"], $a_rec[
"Value"]);
367 case "mob_mi_map_area":
369 include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
370 $med_id = (int) $a_mapping->getMapping(
"Services/MediaObjects",
"mob_media_item", $a_rec[
"MiId"]);
371 if (is_object($this->current_media_item) && $this->current_media_item->getId() == $med_id)
373 $med = $this->current_media_item;
380 include_once(
"./Services/MediaObjects/classes/class.ilMapArea.php");
382 $map_area->setItemId($med_id);
383 $map_area->setNr($a_rec[
"Nr"]);
384 $map_area->setShape($a_rec[
"Shape"]);
385 $map_area->setCoords($a_rec[
"Coords"]);
386 $map_area->setLinkType($a_rec[
"LinkType"]);
387 $map_area->setTitle($a_rec[
"Title"]);
388 $map_area->setHref($a_rec[
"Href"]);
389 $map_area->setTarget($a_rec[
"Target"]);
390 $map_area->setType($a_rec[
"Type"]);
391 $map_area->setTargetFrame($a_rec[
"TargetFrame"]);
392 $map_area->setHighlightMode($a_rec[
"HighlightMode"]);
393 $map_area->setHighlightClass($a_rec[
"HighlightClass"]);
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
static _lookupTitle($a_id)
lookup object title
getImportDirectory()
Get import directory.
getDirectDataFromQuery($a_query, $a_convert_to_leading_upper=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
static _lookupDescription($a_id)
lookup object description
static _lookupType($a_id, $a_reference=false)
lookup object type
A dataset contains in data in a common structure that can be shared and transformed for different pur...