4include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
 
   39        $this->use_previous_import_ids = $a_val;
 
   60        return array(
"5.1.0", 
"4.3.0", 
"4.1.0");
 
   71        return "http://www.ilias.de/xml/Services/MediaObject/" . $a_entity;
 
   80    protected function getTypes($a_entity, $a_version)
 
   83        if ($a_entity == 
"mob") {
 
   90                        "Description" => 
"text",
 
   98                        "Description" => 
"text",
 
  106        if ($a_entity == 
"mob_media_item") {
 
  107            switch ($a_version) {
 
  111                        "MobId" => 
"integer",
 
  112                        "Width" => 
"integer",
 
  113                        "Height" => 
"integer",
 
  118                        "Location" => 
"text",
 
  119                        "LocationType" => 
"text",
 
  121                        "TextRepresentation" => 
"text" 
  128                        "MobId" => 
"integer",
 
  129                        "Width" => 
"integer",
 
  130                        "Height" => 
"integer",
 
  135                        "Location" => 
"text",
 
  136                        "LocationType" => 
"text",
 
  138                        "TextRepresentation" => 
"text" 
  144        if ($a_entity == 
"mob_mi_map_area") {
 
  145            switch ($a_version) {
 
  154                            "LinkType" => 
"text",
 
  159                            "TargetFrame" => 
"text",
 
  160                            "HighlightMode" => 
"text",
 
  161                            "HighlightText" => 
"text" 
  167        if ($a_entity == 
"mob_mi_parameter") {
 
  168            switch ($a_version) {
 
  187    public function readData($a_entity, $a_version, $a_ids, $a_field = 
"")
 
  191        if (!is_array($a_ids)) {
 
  192            $a_ids = array($a_ids);
 
  196        if ($a_entity == 
"mob") {
 
  197            $this->data = array();
 
  199            switch ($a_version) {
 
  202                    foreach ($a_ids as $mob_id) {
 
  204                            $this->data[] = array(
"Id" => $mob_id,
 
  213                    foreach ($a_ids as $mob_id) {
 
  215                            $this->data[] = array(
"Id" => $mob_id,
 
  227        if ($a_entity == 
"mob_media_item") {
 
  228            switch ($a_version) {
 
  231                        "caption, nr, purpose, location, location_type, format, text_representation" .
 
  232                        " FROM media_item WHERE " .
 
  233                        $ilDB->in(
"mob_id", $a_ids, 
false, 
"integer"));
 
  239                        "caption, nr, purpose, location, location_type, format, text_representation" .
 
  240                        " FROM media_item WHERE " .
 
  241                        $ilDB->in(
"mob_id", $a_ids, 
false, 
"integer"));
 
  248        if ($a_entity == 
"mob_mi_map_area") {
 
  249            switch ($a_version) {
 
  254                        " ,shape, coords, link_type, title, href, target, type, target_frame, " .
 
  255                        " highlight_mode, highlight_class" .
 
  258                        $ilDB->in(
"item_id", $a_ids, 
false, 
"integer") .
 
  259                        " ORDER BY nr", 
true, 
false) as $r) {
 
  263                        if ($r[
"Type"] == 
"RepositoryItem") {
 
  264                            $id_arr = explode(
"_", $r[
"Target"]);
 
  265                            $ref_id = $id_arr[3];
 
  270                                $id = $otype . 
"_" . $obj_id . 
"_" . $ref_id;
 
  271                                $r[
"Target"] = 
"il_" . $id_arr[1] . 
"_" . $id;
 
  282        if ($a_entity == 
"mob_mi_parameter") {
 
  283            switch ($a_version) {
 
  288                        " FROM mob_parameter " .
 
  290                        $ilDB->in(
"med_item_id", $a_ids, 
false, 
"integer"));
 
  304                    "mob_media_item" => array(
"ids" => $a_rec[
"Id"])
 
  307            case "mob_media_item":
 
  309                    "mob_mi_map_area" => array(
"ids" => $a_rec[
"Id"]),
 
  310                    "mob_mi_parameter" => array(
"ids" => $a_rec[
"Id"])
 
  324        if ($a_entity == 
"mob") {
 
  325            include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
 
  327            $a_set[
"Dir"] = $dir;
 
  339    public function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
 
  349                include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
 
  351                $newObj->setType(
"mob");
 
  352                $newObj->setTitle($a_rec[
"Title"]);
 
  353                $newObj->setDescription($a_rec[
"Description"]);
 
  356                    $newObj->setImportId($a_rec[
"ImportId"]);
 
  361                $newObj->createDirectory();
 
  363                $this->current_mob = $newObj;
 
  365                $dir = str_replace(
"..", 
"", $a_rec[
"Dir"]);
 
  369                    $this->mob_log->debug(
"s:-$source_dir-,t:-$target_dir-");
 
  372                    include_once(
"./Services/MediaObjects/classes/class.ilMediaSvgSanitizer.php");
 
  376                $a_mapping->addMapping(
"Services/MediaObjects", 
"mob", $a_rec[
"Id"], $newObj->getId());
 
  378                $a_mapping->addMapping(
 
  381                    "0:" . $a_rec[
"Id"] . 
":mob",
 
  382                    "0:" . $newObj->getId() . 
":mob" 
  386            case "mob_media_item":
 
  389                include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
 
  390                $mob_id = (int) $a_mapping->getMapping(
"Services/MediaObjects", 
"mob", $a_rec[
"MobId"]);
 
  391                if (is_object($this->current_mob) && $this->current_mob->getId() == $mob_id) {
 
  392                    $mob = $this->current_mob;
 
  397                include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
 
  399                $newObj->setMobId($mob_id);
 
  400                $newObj->setWidth($a_rec[
"Width"]);
 
  401                $newObj->setHeight($a_rec[
"Height"]);
 
  402                $newObj->setCaption($a_rec[
"Caption"]);
 
  403                $newObj->setNr($a_rec[
"Nr"]);
 
  404                $newObj->setPurpose($a_rec[
"Purpose"]);
 
  405                $newObj->setLocation($a_rec[
"Location"]);
 
  406                $newObj->setLocationType($a_rec[
"LocationType"]);
 
  407                $newObj->setFormat($a_rec[
"Format"]);
 
  408                $newObj->setTextRepresentation($a_rec[
"TextRepresentation"]);
 
  410                $this->current_media_item = $newObj;
 
  412                $a_mapping->addMapping(
"Services/MediaObjects", 
"mob_media_item", $a_rec[
"Id"], $newObj->getId());
 
  416            case "mob_mi_parameter":
 
  419                include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
 
  420                $med_id = (int) $a_mapping->getMapping(
"Services/MediaObjects", 
"mob_media_item", $a_rec[
"MiId"]);
 
  421                if (is_object($this->current_media_item) && $this->current_media_item->getId() == $med_id) {
 
  422                    $med = $this->current_media_item;
 
  426                $med->writeParameter($a_rec[
"Name"], $a_rec[
"Value"]);
 
  430            case "mob_mi_map_area":
 
  432                include_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
 
  433                $med_id = (int) $a_mapping->getMapping(
"Services/MediaObjects", 
"mob_media_item", $a_rec[
"MiId"]);
 
  434                if (is_object($this->current_media_item) && $this->current_media_item->getId() == $med_id) {
 
  435                    $med = $this->current_media_item;
 
  440                include_once(
"./Services/MediaObjects/classes/class.ilMapArea.php");
 
  442                $map_area->setItemId($med_id);
 
  443                $map_area->setNr($a_rec[
"Nr"]);
 
  444                $map_area->setShape($a_rec[
"Shape"]);
 
  445                $map_area->setCoords($a_rec[
"Coords"]);
 
  446                $map_area->setLinkType($a_rec[
"LinkType"]);
 
  447                $map_area->setTitle($a_rec[
"Title"]);
 
  448                $map_area->setHref($a_rec[
"Href"]);
 
  449                $map_area->setTarget($a_rec[
"Target"]);
 
  450                $map_area->setType($a_rec[
"Type"]);
 
  451                $map_area->setTargetFrame($a_rec[
"TargetFrame"]);
 
  452                $map_area->setHighlightMode($a_rec[
"HighlightMode"]);
 
  453                $map_area->setHighlightClass($a_rec[
"HighlightClass"]);
 
An exception for terminatinating execution or to throw for unit testing.
A dataset contains in data in a common structure that can be shared and transformed for different pur...
getDirectDataFromQuery($a_query, $a_convert_to_leading_upper=true, $a_set=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
getImportDirectory()
Get import directory.
getCurrentInstallationId()
Get current installation id.
static getLogger($a_component_id)
Get component logger.
static _lookupObjId($a_id)
static _lookupImportId($a_obj_id)
static _lookupTitle($a_id)
lookup object title
static _lookupDescription($a_id)
lookup object description
static _lookupType($a_id, $a_reference=false)
lookup object type
static insertInstIntoID($a_value)
inserts installation id into ILIAS id
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc