4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
 
   27                 return array(
"4.1.0");
 
   38                 return "http://www.ilias.de/xml/Modules/MediaPool/".$a_entity;
 
   47         protected function getTypes($a_entity, $a_version)
 
   50                 if ($a_entity == 
"mep")
 
   58                                                 "Description" => 
"text",
 
   59                                                 "DefaultWidth" => 
"integer",
 
   60                                                 "DefaultHeight" => 
"integer");
 
   65                 if ($a_entity == 
"mep_tree")
 
   73                                                         "Parent" => 
"integer",
 
   77                                                         "ForeignId" => 
"integer" 
   89         function readData($a_entity, $a_version, $a_ids, $a_field = 
"")
 
   93                 if (!is_array($a_ids))
 
   95                         $a_ids = array($a_ids);
 
   99                 if ($a_entity == 
"mep")
 
  105                                                 " default_width, default_height".
 
  106                                                 " FROM mep_data JOIN object_data ON (mep_data.id = object_data.obj_id) ".
 
  108                                                 $ilDB->in(
"id", $a_ids, 
false, 
"integer"));
 
  114                 if ($a_entity == 
"mep_tree")
 
  120                                                 " ,parent,depth,type,title,foreign_id ".
 
  121                                                 " FROM mep_tree JOIN mep_item ON (child = obj_id) ".
 
  123                                                 $ilDB->in(
"mep_id", $a_ids, 
false, 
"integer").
 
  139                                         "mep_tree" => array(
"ids" => $a_rec[
"Id"])
 
  156         function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
 
  164                                 include_once(
"./Modules/MediaPool/classes/class.ilObjMediaPool.php");
 
  166                                 if($new_id = $a_mapping->getMapping(
'Services/Container',
'objs',$a_rec[
'Id']))
 
  173                                         $newObj->setType(
"mep");
 
  174                                         $newObj->create(
true);
 
  177                                 $newObj->setTitle($a_rec[
"Title"]);
 
  178                                 $newObj->setDescription($a_rec[
"Description"]);
 
  179                                 $newObj->setDefaultWidth($a_rec[
"DefaultWidth"]);
 
  180                                 $newObj->setDefaultHeight($a_rec[
"DefaultHeight"]);
 
  183                                 $this->current_obj = $newObj;
 
  184                                 $a_mapping->addMapping(
"Modules/MediaPool", 
"mep", $a_rec[
"Id"], $newObj->getId());
 
  188                                 switch ($a_rec[
"Type"])
 
  191                                                 $parent = (int) $a_mapping->getMapping(
"Modules/MediaPool", 
"mep_tree", $a_rec[
"Parent"]);
 
  193                                                         $this->current_obj->createFolder($a_rec[
"Title"], $parent);
 
  194                                                 $a_mapping->addMapping(
"Modules/MediaPool", 
"mep_tree", $a_rec[
"Child"],
 
  199                                                 $parent = (int) $a_mapping->getMapping(
"Modules/MediaPool", 
"mep_tree", $a_rec[
"Parent"]);
 
  200                                                 $mob_id = (int) $a_mapping->getMapping(
"Services/MediaObjects", 
"mob", $a_rec[
"ForeignId"]);
 
  202                                                 $item->setType(
"mob");
 
  203                                                 $item->setForeignId($mob_id);
 
  204                                                 $item->setTitle($a_rec[
"Title"]);
 
  206                                                 if ($item->getId() > 0)
 
  208                                                         $this->current_obj->insertInTree($item->getId(), $parent);
 
  213                                                 $parent = (int) $a_mapping->getMapping(
"Modules/MediaPool", 
"mep_tree", $a_rec[
"Parent"]);
 
  216                                                 $item->setType(
"pg");
 
  217                                                 $item->setTitle($a_rec[
"Title"]);
 
  219                                                 $a_mapping->addMapping(
"Services/COPage", 
"pg", 
"mep:".$a_rec[
"Child"],
 
  220                                                         "mep:".$item->getId());
 
  221                                                 if ($item->getId() > 0)
 
  223                                                         $this->current_obj->insertInTree($item->getId(), $parent);