4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
30 $this->use_previous_import_ids = $a_val;
51 return array(
"5.1.0",
"4.3.0",
"4.1.0");
62 return "http://www.ilias.de/xml/Services/MediaObject/".$a_entity;
71 protected function getTypes($a_entity, $a_version)
74 if ($a_entity ==
"mob")
83 "Description" =>
"text",
91 "Description" =>
"text",
99 if ($a_entity ==
"mob_media_item")
106 "MobId" =>
"integer",
107 "Width" =>
"integer",
108 "Height" =>
"integer",
113 "Location" =>
"text",
114 "LocationType" =>
"text",
116 "TextRepresentation" =>
"text" 123 "MobId" =>
"integer",
124 "Width" =>
"integer",
125 "Height" =>
"integer",
130 "Location" =>
"text",
131 "LocationType" =>
"text",
133 "TextRepresentation" =>
"text" 139 if ($a_entity ==
"mob_mi_map_area")
151 "LinkType" =>
"text",
156 "TargetFrame" =>
"text",
157 "HighlightMode" =>
"text",
158 "HighlightText" =>
"text" 164 if ($a_entity ==
"mob_mi_parameter")
186 function readData($a_entity, $a_version, $a_ids, $a_field =
"")
190 if (!is_array($a_ids))
192 $a_ids = array($a_ids);
196 if ($a_entity ==
"mob")
198 $this->data = array();
204 foreach ($a_ids as $mob_id)
208 $this->data[] = array (
"Id" => $mob_id,
217 foreach ($a_ids as $mob_id)
221 $this->data[] = array (
"Id" => $mob_id,
233 if ($a_entity ==
"mob_media_item")
239 "caption, nr, purpose, location, location_type, format, text_representation".
240 " FROM media_item WHERE ".
241 $ilDB->in(
"mob_id", $a_ids,
false,
"integer"));
247 "caption, nr, purpose, location, location_type, format, text_representation".
248 " FROM media_item WHERE ".
249 $ilDB->in(
"mob_id", $a_ids,
false,
"integer"));
256 if ($a_entity ==
"mob_mi_map_area")
264 " ,shape, coords, link_type, title, href, target, type, target_frame, ".
265 " highlight_mode, highlight_class".
268 $ilDB->in(
"item_id", $a_ids,
false,
"integer").
275 if ($a_entity ==
"mob_mi_parameter")
283 " FROM mob_parameter ".
285 $ilDB->in(
"med_item_id", $a_ids,
false,
"integer"));
301 "mob_media_item" => array(
"ids" => $a_rec[
"Id"])
304 case "mob_media_item":
306 "mob_mi_map_area" => array(
"ids" => $a_rec[
"Id"]),
307 "mob_mi_parameter" => array(
"ids" => $a_rec[
"Id"])
321 if ($a_entity ==
"mob")
323 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
325 $a_set[
"Dir"] = $dir;
337 function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
348 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
350 $newObj->setType(
"mob");
351 $newObj->setTitle($a_rec[
"Title"]);
352 $newObj->setDescription($a_rec[
"Description"]);
356 $newObj->setImportId($a_rec[
"ImportId"]);
363 $newObj->createDirectory();
365 $this->current_mob = $newObj;
367 $dir = str_replace(
"..",
"", $a_rec[
"Dir"]);
374 include_once(
"./Services/MediaObjects/classes/class.ilMediaSvgSanitizer.php");
378 $a_mapping->addMapping(
"Services/MediaObjects",
"mob", $a_rec[
"Id"], $newObj->getId());
380 $a_mapping->addMapping(
"Services/MetaData",
"md",
381 "0:".$a_rec[
"Id"].
":mob",
"0:".$newObj->getId().
":mob");
384 case "mob_media_item":
387 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
388 $mob_id = (int) $a_mapping->getMapping(
"Services/MediaObjects",
"mob", $a_rec[
"MobId"]);
389 if (is_object($this->current_mob) && $this->current_mob->getId() == $mob_id)
391 $mob = $this->current_mob;
398 include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
400 $newObj->setMobId($mob_id);
401 $newObj->setWidth($a_rec[
"Width"]);
402 $newObj->setHeight($a_rec[
"Height"]);
403 $newObj->setCaption($a_rec[
"Caption"]);
404 $newObj->setNr($a_rec[
"Nr"]);
405 $newObj->setPurpose($a_rec[
"Purpose"]);
406 $newObj->setLocation($a_rec[
"Location"]);
407 $newObj->setLocationType($a_rec[
"LocationType"]);
408 $newObj->setFormat($a_rec[
"Format"]);
409 $newObj->setTextRepresentation($a_rec[
"TextRepresentation"]);
411 $this->current_media_item = $newObj;
413 $a_mapping->addMapping(
"Services/MediaObjects",
"mob_media_item", $a_rec[
"Id"], $newObj->getId());
417 case "mob_mi_parameter":
420 include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
421 $med_id = (int) $a_mapping->getMapping(
"Services/MediaObjects",
"mob_media_item", $a_rec[
"MiId"]);
422 if (is_object($this->current_media_item) && $this->current_media_item->getId() == $med_id)
424 $med = $this->current_media_item;
430 $med->writeParameter($a_rec[
"Name"], $a_rec[
"Value"]);
434 case "mob_mi_map_area":
436 include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
437 $med_id = (int) $a_mapping->getMapping(
"Services/MediaObjects",
"mob_media_item", $a_rec[
"MiId"]);
438 if (is_object($this->current_media_item) && $this->current_media_item->getId() == $med_id)
440 $med = $this->current_media_item;
447 include_once(
"./Services/MediaObjects/classes/class.ilMapArea.php");
449 $map_area->setItemId($med_id);
450 $map_area->setNr($a_rec[
"Nr"]);
451 $map_area->setShape($a_rec[
"Shape"]);
452 $map_area->setCoords($a_rec[
"Coords"]);
453 $map_area->setLinkType($a_rec[
"LinkType"]);
454 $map_area->setTitle($a_rec[
"Title"]);
455 $map_area->setHref($a_rec[
"Href"]);
456 $map_area->setTarget($a_rec[
"Target"]);
457 $map_area->setType($a_rec[
"Type"]);
458 $map_area->setTargetFrame($a_rec[
"TargetFrame"]);
459 $map_area->setHighlightMode($a_rec[
"HighlightMode"]);
460 $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
getCurrentInstallationId()
Get current installation id.
static _lookupImportId($a_obj_id)
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...