40 $this->server_id = $a_server_id;
41 $this->obj_id = $a_obj_id;
61 $query =
'SELECT * from ecs_import ' .
62 'WHERE server_id = ' .
$ilDB->quote($a_server_id,
'integer') .
' ' .
63 'AND mid = ' .
$ilDB->quote($a_mid,
'integer') .
' ' .
64 'AND econtent_id = ' .
$ilDB->quote($a_econtent_id,
'text');
67 return $row->content_id;
85 $query =
"SELECT obj_id FROM ecs_import " .
86 "WHERE content_id = " .
$ilDB->quote($a_content_id,
'integer') .
" " .
87 "AND mid = " .
$ilDB->quote($a_mid,
'integer') .
" " .
88 'AND server_id = ' .
$ilDB->quote($a_server_id,
'integer') .
' ';
90 if (!is_null($a_sub_id)) {
91 $query .=
'AND sub_id = ' .
$ilDB->quote($a_sub_id,
'text');
93 $query .=
'AND sub_id IS NULL';
107 $ilDB = $DIC[
'ilDB'];
109 $query =
"SELECT obj_id FROM ecs_import " .
110 "WHERE content_id = " .
$ilDB->quote($a_content_id,
'integer');
116 $obj_ids[] =
$row->obj_id;
134 $ilDB = $DIC[
'ilDB'];
136 $query =
'SELECT * from ecs_import ' .
137 'WHERE server_id = ' .
$ilDB->quote($a_server_id,
'integer') .
' ' .
138 'AND mid = ' .
$ilDB->quote($a_mid,
'integer') .
' ' .
139 'AND content_id = ' .
$ilDB->quote($a_content_id,
'text');
142 return $row->econtent_id;
158 $ilDB = $DIC[
'ilDB'];
160 include_once
'./Services/WebServices/ECS/classes/class.ilECSUtils.php';
162 $query =
"SELECT * FROM ecs_import ei JOIN object_data obd ON ei.obj_id = obd.obj_id " .
163 'WHERE server_id = ' .
$ilDB->quote($a_server_id) .
' ' .
167 $all[
$row->econtent_id] =
$row->obj_id;
170 return $all ? $all : array();
185 $ilDB = $DIC[
'ilDB'];
187 $query =
"SELECT * FROM ecs_import " .
188 "WHERE mid = " .
$ilDB->quote($a_mid,
'integer') .
" " .
189 'AND server_id = ' .
$ilDB->quote($a_server_id,
'integer');
193 $obj_ids[] =
$row->obj_id;
195 return $obj_ids ? $obj_ids : array();
210 $ilDB = $DIC[
'ilDB'];
212 $query =
"SELECT * FROM ecs_import WHERE obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" ";
215 return $row->econtent_id;
230 $ilDB = $DIC[
'ilDB'];
232 $query =
'SELECT * FROM ecs_import WHERE obj_id = ' .
$ilDB->quote($a_obj_id,
'integer');
235 return $row->server_id;
251 $ilDB = $DIC[
'ilDB'];
253 $query =
"SELECT obj_id FROM ecs_import WHERE econtent_id = " .
$ilDB->quote($a_econtent_id,
'text') .
" " .
254 'AND server_id = ' .
$ilDB->quote($a_server_id,
'integer');
257 $obj_ids[] =
$row->obj_id;
259 return $obj_ids ? $obj_ids : array();
270 public static function _lookupObjId($a_server_id, $a_econtent_id, $a_mid, $a_sub_id = null)
274 $ilDB = $DIC[
'ilDB'];
276 $query =
"SELECT obj_id FROM ecs_import " .
277 "WHERE econtent_id = " .
$ilDB->quote($a_econtent_id,
'text') .
" " .
278 "AND mid = " .
$ilDB->quote($a_mid,
'integer') .
" " .
279 'AND server_id = ' .
$ilDB->quote($a_server_id,
'integer') .
' ';
281 if (!is_null($a_sub_id)) {
282 $query .=
'AND sub_id = ' .
$ilDB->quote($a_sub_id,
'text');
284 $query .=
'AND sub_id IS NULL';
304 $ilDB = $DIC[
'ilDB'];
306 $query =
"SELECT * FROM ecs_emport WHERE obj_id = " .
$ilDB->quote($a_obj_id) .
" " .
307 'AND server_id = ' .
$ilDB->quote($a_server_id,
'integer');
327 $ilDB = $DIC[
'ilDB'];
329 $query =
"SELECT mid FROM ecs_import WHERE econtent_id = " .
$ilDB->quote($a_econtent_id,
'text') .
" " .
330 'AND server_id = ' .
$ilDB->quote($a_server_id,
'integer');
335 return $mids ? $mids : array();
350 $ilDB = $DIC[
'ilDB'];
352 $query =
"DELETE FROM ecs_import " .
353 "WHERE obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" ";
367 $ilDB = $DIC[
'ilDB'];
369 $query =
'DELETE FROM ecs_import ' .
370 'WHERE server_id = ' .
$ilDB->quote($a_server_id,
'integer');
385 $ilDB = $DIC[
'ilDB'];
387 $query =
'DELETE FROM ecs_import ' .
388 'WHERE server_id = ' .
$ilDB->quote($a_server_id,
'integer') .
' ' .
389 'AND mid = ' .
$ilDB->quote($a_mid,
'integer') .
' ' .
390 'AND ' .
$ilDB->in(
'econtent_id', (array) $a_econtent_ids,
false,
'text');
406 public static function _isImported($a_server_id, $a_econtent_id, $a_mid, $a_sub_id = null)
413 $this->server_id = $a_server_id;
430 $this->imported = $a_status;
435 $this->sub_id = $a_id;
440 return strlen($this->sub_id) ? $this->sub_id : null;
449 $this->content_id = $a_content_id;
493 $this->econtent_id = $a_id;
516 $ilDB = $DIC[
'ilDB'];
518 $query =
"DELETE FROM ecs_import " .
519 "WHERE obj_id = " . $this->db->quote($this->obj_id,
'integer') .
" " .
523 $query =
"INSERT INTO ecs_import (obj_id,mid,econtent_id,sub_id,server_id,content_id) " .
525 $this->db->quote($this->obj_id,
'integer') .
", " .
526 $this->db->quote($this->mid,
'integer') .
", " .
527 $this->db->quote($this->econtent_id,
'text') .
", " .
528 $this->db->quote($this->
getSubId(),
'text') .
', ' .
529 $this->db->quote($this->
getServerId(),
'integer') .
', ' .
546 $ilDB = $DIC[
'ilDB'];
548 $query =
"SELECT * FROM ecs_import WHERE " .
549 "obj_id = " . $this->db->quote($this->obj_id,
'integer') .
" " .
553 $this->econtent_id =
$row->econtent_id;
554 $this->mid =
$row->mid;
555 $this->sub_id =
$row->sub_id;
556 $this->content_id =
$row->content_id;
564 $ilDB = $DIC[
'ilDB'];
566 $query =
'UPDATE ecs_import SET server_id = ' .
$ilDB->quote(0,
'integer') .
567 ' WHERE server_id = ' .
$ilDB->quote($a_server_id,
'integer');
575 $this->ecs_id = $a_id;
setServerId($a_server_id)
static getAllImportedRemoteObjects($a_server_id)
get all imported links
static getPossibleRemoteTypes($a_with_captions=false)
Get all possible remote object types.
static _lookupEContentId($a_obj_id)
get econent_id
static _lookupObjId($a_server_id, $a_econtent_id, $a_mid, $a_sub_id=null)
loogup obj_id by econtent and mid and server_id
static lookupObjIdByContentId($a_server_id, $a_mid, $a_content_id, $a_sub_id=null)
Lookup obj_id by content id.
static _deleteByObjId($a_obj_id)
Delete by obj_id.
static deleteByServer($a_server_id)
Delete by server id ilDB $ilDB.
static _lookupObjIdsByMID($a_server_id, $a_mid)
lookup obj ids by mid
static resetServerId($a_server_id)
foreach($_POST as $key=> $value) $res
Storage of ECS imported objects.
static _isImported($a_server_id, $a_econtent_id, $a_mid, $a_sub_id=null)
check if econtent is imported for a specific mid
getEContentId()
get econtent id
static lookupEContentIdByContentId($a_server_id, $a_mid, $a_content_id)
Lookup econtent id The econtent id is the unique id from ecs.
static lookupServerId($a_obj_id)
Lookup server id of imported content <type> $ilDB.
static _lookupMIDs($a_server_id, $a_econtent_id)
Lookup mids by.
static lookupContentId($a_server_id, $a_mid, $a_econtent_id)
Lookup content id The content is the - not necessarily unique - id provided by the econtent type...
setImported($a_status)
Set imported.
getContentId()
get content id
static deleteRessources($a_server_id, $a_mid, $a_econtent_ids)
Delete ressources $ilDB.
setContentId($a_content_id)
Set content id.
static _lookupObjIds($a_server_id, $a_econtent_id)
Lookup obj_id.
setEContentId($a_id)
set econtent id
static _lookupMID($a_server_id, $a_obj_id)
Lookup mid.
static lookupObjIdsByContentId($a_content_id)
__construct($a_server_id, $a_obj_id)
Constructor.