ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilECSImport Class Reference

Storage of ECS imported objects. More...

+ Collaboration diagram for ilECSImport:

Public Member Functions

 __construct ($a_server_id, $a_obj_id)
 Constructor.
 _lookupObjIds ($a_server_id, $a_econtent_id)
 Lookup obj_id.
 _lookupMID ($a_server_id, $a_obj_id)
 Lookup mid.
 setServerId ($a_server_id)
 getServerId ()
 setImported ($a_status)
 Set imported.
 setSubId ($a_id)
 getSubId ()
 setContentId ($a_content_id)
 Set content id.
 getContentId ()
 get content id
 setMID ($a_mid)
 set mid
 getMID ()
 get mid
 setEContentId ($a_id)
 set econtent id
 getEContentId ()
 get econtent id
 save ()
 Save.
 setECSId ($a_id)

Static Public Member Functions

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.
static lookupObjIdByContentId ($a_server_id, $a_mid, $a_content_id, $a_sub_id= '')
 Lookup obj_id by content id.
static lookupObjIdsByContentId ($a_content_id)
static lookupEContentIdByContentId ($a_server_id, $a_mid, $a_content_id)
 Lookup econtent id The econtent id is the unique id from ecs.
static getAllImportedRemoteObjects ($a_server_id)
 get all imported links
static _lookupObjIdsByMID ($a_server_id, $a_mid)
 lookup obj ids by mid
static _lookupEContentId ($a_obj_id)
 get econent_id
static lookupServerId ($a_obj_id)
 Lookup server id of imported content <type> $ilDB.
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 _lookupMIDs ($a_server_id, $a_econtent_id)
 Lookup mids by.
static _deleteByObjId ($a_obj_id)
 Delete by obj_id.
static deleteByServer ($a_server_id)
 Delete by server id ilDB $ilDB.
static deleteRessources ($a_server_id, $a_mid, $a_econtent_ids)
 Delete ressources $ilDB.
static _isImported ($a_server_id, $a_econtent_id, $a_mid, $a_sub_id=0)
 check if econtent is imported for a specific mid
static resetServerId ($a_server_id)

Protected Attributes

 $db = null
 $server_id = 0
 $obj_id = 0
 $econtent_id = 0
 $content_id = ''
 $sub_id = 0
 $mid = 0
 $imported = false
 $ecs_id = 0

Private Member Functions

 read ()
 Read private.

Detailed Description

Storage of ECS imported objects.

This class stores the econent id and informations whether an object is imported or not.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 14 of file class.ilECSImport.php.

Constructor & Destructor Documentation

ilECSImport::__construct (   $a_server_id,
  $a_obj_id 
)

Constructor.

public

Parameters
int$a_server_id
int$a_obj_id

Definition at line 34 of file class.ilECSImport.php.

References $ilDB, and read().

{
global $ilDB;
$this->server_id = $a_server_id;
$this->obj_id = $a_obj_id;
$this->db = $ilDB;
$this->read();
}

+ Here is the call graph for this function:

Member Function Documentation

static ilECSImport::_deleteByObjId (   $a_obj_id)
static

Delete by obj_id.

public

Parameters
intobj_id

Definition at line 340 of file class.ilECSImport.php.

References $ilDB, $query, and $res.

Referenced by ilObject\delete(), and ilRemoteObjectBase\doDelete().

{
global $ilDB;
$query = "DELETE FROM ecs_import ".
"WHERE obj_id = ".$ilDB->quote($a_obj_id,'integer')." ";
$res = $ilDB->manipulate($query);
return true;
}

+ Here is the caller graph for this function:

static ilECSImport::_isImported (   $a_server_id,
  $a_econtent_id,
  $a_mid,
  $a_sub_id = 0 
)
static

check if econtent is imported for a specific mid

public

Parameters
intecontent id
intmid

Definition at line 394 of file class.ilECSImport.php.

References _lookupObjId().

Referenced by ilRemoteObjectBase\handleUpdate().

{
return ilECSImport::_lookupObjId($a_server_id,$a_econtent_id,$a_mid, $a_sub_id);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilECSImport::_lookupEContentId (   $a_obj_id)
static

get econent_id

public

Parameters
intobj_id

Definition at line 202 of file class.ilECSImport.php.

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilObjRemoteCategoryListGUI\getCommandFrame(), ilObjRemoteCourseListGUI\getCommandFrame(), ilObjRemoteGlossaryListGUI\getCommandFrame(), ilObjRemoteTestListGUI\getCommandFrame(), ilObjRemoteWikiListGUI\getCommandFrame(), ilObjRemoteGroupListGUI\getCommandFrame(), ilObjRemoteLearningModuleListGUI\getCommandFrame(), ilObjRemoteFileListGUI\getCommandFrame(), and ilRemoteObjectBase\isLocalObject().

{
global $ilDB;
$query = "SELECT * FROM ecs_import WHERE obj_id = ".$ilDB->quote($a_obj_id,'integer')." ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->econtent_id;
}
return 0;
}

+ Here is the caller graph for this function:

ilECSImport::_lookupMID (   $a_server_id,
  $a_obj_id 
)

Lookup mid.

public

Definition at line 295 of file class.ilECSImport.php.

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

{
global $ilDB;
$query = "SELECT * FROM ecs_emport WHERE obj_id = ".$ilDB->quote($a_obj_id)." ".
'AND server_id = '.$ilDB->quote($a_server_id,'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->mid;
}
return 0;
}
static ilECSImport::_lookupMIDs (   $a_server_id,
  $a_econtent_id 
)
static

Lookup mids by.

public

Parameters
intecontent_id

Definition at line 318 of file class.ilECSImport.php.

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

{
global $ilDB;
$query = "SELECT mid FROM ecs_import WHERE econtent_id = ".$ilDB->quote($a_econtent_id,'text')." ".
'AND server_id = '.$ilDB->quote($a_server_id,'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$mids[] = $row->mid;
}
return $mids ? $mids : array();
}
static ilECSImport::_lookupObjId (   $a_server_id,
  $a_econtent_id,
  $a_mid,
  $a_sub_id = NULL 
)
static

loogup obj_id by econtent and mid and server_id

public

Parameters
intecontent_id

Definition at line 263 of file class.ilECSImport.php.

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by _isImported().

{
global $ilDB;
$query = "SELECT obj_id FROM ecs_import ".
"WHERE econtent_id = ".$ilDB->quote($a_econtent_id,'text')." ".
"AND mid = ".$ilDB->quote($a_mid,'integer')." ".
'AND server_id = '.$ilDB->quote($a_server_id,'integer').' ';
if($a_sub_id)
{
$query .= 'AND sub_id = '.$ilDB->quote($a_sub_id,'text');
}
else
{
$query .= 'AND sub_id IS NULL';
}
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->obj_id;
}
return 0;
}

+ Here is the caller graph for this function:

ilECSImport::_lookupObjIds (   $a_server_id,
  $a_econtent_id 
)

Lookup obj_id.

public

Definition at line 241 of file class.ilECSImport.php.

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilRemoteObjectBase\handleDelete().

{
global $ilDB;
$query = "SELECT obj_id FROM ecs_import WHERE econtent_id = ".$ilDB->quote($a_econtent_id,'text')." ".
'AND server_id = '.$ilDB->quote($a_server_id,'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$obj_ids[] = $row->obj_id;
}
return $obj_ids ? $obj_ids : array();
}

+ Here is the caller graph for this function:

static ilECSImport::_lookupObjIdsByMID (   $a_server_id,
  $a_mid 
)
static

lookup obj ids by mid

public

Parameters
intmid
Returns
array int

Definition at line 178 of file class.ilECSImport.php.

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

{
global $ilDB;
$query = "SELECT * FROM ecs_import ".
"WHERE mid = ".$ilDB->quote($a_mid,'integer')." ".
'AND server_id = '.$ilDB->quote($a_server_id,'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$obj_ids[] = $row->obj_id;
}
return $obj_ids ? $obj_ids : array();
}
static ilECSImport::deleteByServer (   $a_server_id)
static

Delete by server id ilDB $ilDB.

Parameters
int$a_server_id

Definition at line 355 of file class.ilECSImport.php.

References $ilDB, and $query.

Referenced by ilECSSettingsGUI\doDelete().

{
global $ilDB;
$query = 'DELETE FROM ecs_import '.
'WHERE server_id = '.$ilDB->quote($a_server_id,'integer');
$ilDB->manipulate($query);
}

+ Here is the caller graph for this function:

static ilECSImport::deleteRessources (   $a_server_id,
  $a_mid,
  $a_econtent_ids 
)
static

Delete ressources $ilDB.

Parameters
type$a_server_id
type$a_mid
type$a_econtent_ids

Definition at line 371 of file class.ilECSImport.php.

References $ilDB, and $query.

Referenced by ilECSMappingSettingsGUI\dDeleteTree().

{
global $ilDB;
$query = 'DELETE FROM ecs_import '.
'WHERE server_id = '.$ilDB->quote($a_server_id,'integer'). ' '.
'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
'AND '.$ilDB->in('econtent_id',(array) $a_econtent_ids,false,'text');
$ilDB->manipulate($query);
return true;
}

+ Here is the caller graph for this function:

static ilECSImport::getAllImportedRemoteObjects (   $a_server_id)
static

get all imported links

public

Definition at line 152 of file class.ilECSImport.php.

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, and ilECSUtils\getPossibleRemoteTypes().

Referenced by ilECSEventQueueReader\handleImportReset().

{
global $ilDB;
include_once './Services/WebServices/ECS/classes/class.ilECSUtils.php';
$query = "SELECT * FROM ecs_import ei JOIN object_data obd ON ei.obj_id = obd.obj_id ".
'WHERE server_id = '.$ilDB->quote($a_server_id).' '.
'AND '.$ilDB->in('type', ilECSUtils::getPossibleRemoteTypes(), false, 'text');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$all[$row->econtent_id] = $row->obj_id;
}
return $all ? $all : array();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilECSImport::getContentId ( )

get content id

Returns
type

Definition at line 444 of file class.ilECSImport.php.

References $content_id.

Referenced by save().

{
}

+ Here is the caller graph for this function:

ilECSImport::getEContentId ( )

get econtent id

public

Definition at line 490 of file class.ilECSImport.php.

References $econtent_id.

{
}
ilECSImport::getMID ( )

get mid

public

Definition at line 467 of file class.ilECSImport.php.

References $mid.

{
return $this->mid;
}
ilECSImport::getServerId ( )

Definition at line 404 of file class.ilECSImport.php.

References $server_id.

Referenced by read(), and save().

{
}

+ Here is the caller graph for this function:

ilECSImport::getSubId ( )

Definition at line 426 of file class.ilECSImport.php.

Referenced by save().

{
return $this->sub_id ? $this->sub_id : NULL;
}

+ Here is the caller graph for this function:

static ilECSImport::lookupContentId (   $a_server_id,
  $a_mid,
  $a_econtent_id 
)
static

Lookup content id The content is the - not necessarily unique - id provided by the econtent type.

The econtent id is the unique id from ecs

Parameters
type$a_server_id
type$a_mid
type$a_econtent_id
Returns
string content id

Definition at line 53 of file class.ilECSImport.php.

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

{
global $ilDB;
$query = 'SELECT * from ecs_import '.
'WHERE server_id = '.$ilDB->quote($a_server_id,'integer').' '.
'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
'AND econtent_id = '.$ilDB->quote($a_econtent_id,'text');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->content_id;
}
return '';
}
static ilECSImport::lookupEContentIdByContentId (   $a_server_id,
  $a_mid,
  $a_content_id 
)
static

Lookup econtent id The econtent id is the unique id from ecs.

Parameters
type$a_server_id
type$a_mid
type$a_econtent_id
Returns
int content id

Definition at line 129 of file class.ilECSImport.php.

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilECSCmsCourseMemberCommandQueueHandler\readCourse().

{
global $ilDB;
$query = 'SELECT * from ecs_import '.
'WHERE server_id = '.$ilDB->quote($a_server_id,'integer').' '.
'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
'AND content_id = '.$ilDB->quote($a_content_id,'text');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->econtent_id;
}
return 0;
}

+ Here is the caller graph for this function:

static ilECSImport::lookupObjIdByContentId (   $a_server_id,
  $a_mid,
  $a_content_id,
  $a_sub_id = '' 
)
static

Lookup obj_id by content id.

Parameters
type$a_server_id
type$a_mid
type$a_content_id
type$a_sub_id

Definition at line 76 of file class.ilECSImport.php.

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilECSCmsCourseMemberCommandQueueHandler\doUpdate(), ilECSCourseCreationHandler\getImportId(), ilECSCmsTreeSynchronizer\handleTreeUpdate(), and ilECSCmsTreeSynchronizer\syncCategory().

{
global $ilDB;
$query = "SELECT obj_id FROM ecs_import ".
"WHERE content_id = ".$ilDB->quote($a_content_id,'integer')." ".
"AND mid = ".$ilDB->quote($a_mid,'integer')." ".
'AND server_id = '.$ilDB->quote($a_server_id,'integer').' ';
if($a_sub_id)
{
$query .= 'AND sub_id = '.$ilDB->quote($a_sub_id,'text');
}
else
{
$query .= 'AND sub_id IS NULL';
}
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->obj_id;
}
return 0;
}

+ Here is the caller graph for this function:

static ilECSImport::lookupObjIdsByContentId (   $a_content_id)
static

Definition at line 103 of file class.ilECSImport.php.

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilECSEnrolmentStatusCommandQueueHandler\doUpdate().

{
global $ilDB;
$query = "SELECT obj_id FROM ecs_import ".
"WHERE content_id = ".$ilDB->quote($a_content_id,'integer');
$res = $ilDB->query($query);
$obj_ids = array();
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$obj_ids[] = $row->obj_id;
}
return $obj_ids;
}

+ Here is the caller graph for this function:

static ilECSImport::lookupServerId (   $a_obj_id)
static
ilECSImport::read ( )
private

Read private.

Definition at line 528 of file class.ilECSImport.php.

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, and getServerId().

Referenced by __construct().

{
global $ilDB;
$query = "SELECT * FROM ecs_import WHERE ".
"obj_id = ".$this->db->quote($this->obj_id,'integer')." ".
'AND server_id = '.$ilDB->quote($this->getServerId(),'integer');
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->econtent_id = $row->econtent_id;
$this->mid = $row->mid;
$this->sub_id = $row->sub_id;
$this->content_id = $row->content_id;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilECSImport::resetServerId (   $a_server_id)
static

Definition at line 545 of file class.ilECSImport.php.

References $ilDB, and $query.

Referenced by ilECSSetting\delete().

{
global $ilDB;
$query = 'UPDATE ecs_import SET server_id = '.$ilDB->quote(0,'integer').
' WHERE server_id = '.$ilDB->quote($a_server_id,'integer');
$ilDB->manipulate($query);
return true;
}

+ Here is the caller graph for this function:

ilECSImport::save ( )

Save.

public

Definition at line 500 of file class.ilECSImport.php.

References $ilDB, $query, $res, getContentId(), getServerId(), and getSubId().

{
global $ilDB;
$query = "DELETE FROM ecs_import ".
"WHERE obj_id = ".$this->db->quote($this->obj_id,'integer')." ".
'AND server_id = '.$ilDB->quote($this->getServerId(),'integer');
$res = $ilDB->manipulate($query);
$query = "INSERT INTO ecs_import (obj_id,mid,econtent_id,sub_id,server_id,content_id) ".
"VALUES ( ".
$this->db->quote($this->obj_id,'integer').", ".
$this->db->quote($this->mid,'integer').", ".
$this->db->quote($this->econtent_id,'text').", ".
$this->db->quote($this->getSubId(),'text'). ', '.
$this->db->quote($this->getServerId(),'integer').', '.
$this->db->quote($this->getContentId(),'text').' '.
")";
$res = $ilDB->manipulate($query);
return true;
}

+ Here is the call graph for this function:

ilECSImport::setContentId (   $a_content_id)

Set content id.

Parameters
type$a_content_id

Definition at line 435 of file class.ilECSImport.php.

Referenced by ilObjRemoteCourse\updateCustomFromECSContent().

{
$this->content_id = $a_content_id;
}

+ Here is the caller graph for this function:

ilECSImport::setEContentId (   $a_id)

set econtent id

public

Parameters
intecontent id

Definition at line 479 of file class.ilECSImport.php.

Referenced by ilRemoteObjectBase\handleUpdate().

{
$this->econtent_id = $a_id;
}

+ Here is the caller graph for this function:

ilECSImport::setECSId (   $a_id)

Definition at line 556 of file class.ilECSImport.php.

{
$this->ecs_id = $a_id;
}
ilECSImport::setImported (   $a_status)

Set imported.

public

Parameters
boolexport status

Definition at line 416 of file class.ilECSImport.php.

{
$this->imported = $a_status;
}
ilECSImport::setMID (   $a_mid)

set mid

public

Parameters
intmid

Definition at line 456 of file class.ilECSImport.php.

Referenced by ilECSCmsTreeSynchronizer\syncCategory(), and ilECSCourseCreationHandler\syncCategory().

{
$this->mid = $a_mid;
}

+ Here is the caller graph for this function:

ilECSImport::setServerId (   $a_server_id)

Definition at line 399 of file class.ilECSImport.php.

{
$this->server_id = $a_server_id;
}
ilECSImport::setSubId (   $a_id)

Definition at line 421 of file class.ilECSImport.php.

{
$this->sub_id = $a_id;
}

Field Documentation

ilECSImport::$content_id = ''
protected

Definition at line 21 of file class.ilECSImport.php.

Referenced by getContentId().

ilECSImport::$db = null
protected

Definition at line 16 of file class.ilECSImport.php.

ilECSImport::$econtent_id = 0
protected

Definition at line 20 of file class.ilECSImport.php.

Referenced by getEContentId().

ilECSImport::$ecs_id = 0
protected

Definition at line 25 of file class.ilECSImport.php.

ilECSImport::$imported = false
protected

Definition at line 24 of file class.ilECSImport.php.

ilECSImport::$mid = 0
protected

Definition at line 23 of file class.ilECSImport.php.

Referenced by getMID().

ilECSImport::$obj_id = 0
protected

Definition at line 19 of file class.ilECSImport.php.

ilECSImport::$server_id = 0
protected

Definition at line 18 of file class.ilECSImport.php.

Referenced by getServerId().

ilECSImport::$sub_id = 0
protected

Definition at line 22 of file class.ilECSImport.php.


The documentation for this class was generated from the following file: