ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilECSNodeMappingAssignments Class Reference
+ Collaboration diagram for ilECSNodeMappingAssignments:

Static Public Member Functions

static hasAssignments ($a_server_id, $a_mid, $a_tree_id)
 Check if there is any assignment for a cms tree.
static lookupSettings ($a_server_id, $a_mid, $a_tree_id, $a_node_id)
 Lookup Settings.
static lookupAssignmentIds ($a_server_id, $a_mid, $a_tree_id)
 Lookup assignments $ilDB.
static lookupAssignmentsByRefId ($a_server_id, $a_mid, $a_tree_id, $a_ref_id)
 Lookup assignments.
static isWholeTreeMapped ($a_server_id, $a_mid, $a_tree_id)
 Check if whole tree is mapped.
static lookupDefaultTitleUpdate ($a_server_id, $a_mid, $a_tree_id)
 Lookup default title update setting.
static lookupMappedItemsForRefId ($a_server_id, $a_mid, $a_tree_id, $a_ref_id)
 Get cs ids for ref_id <type> $ilDB.
static deleteMappingsByCsId ($a_server_id, $a_mid, $a_tree_id, $cs_ids)
 Delete mappings $ilDB.
static deleteMappings ($a_server_id, $a_mid, $a_tree_id)
 Delete mappings $ilDB $ilDB.
static deleteDisconnectableMappings ($a_server_id, $a_mid, $a_tree_id, $a_ref_id)
 delete disconnectable mappings

Detailed Description

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Id:
class.ilECSNodeMappingAssignments.php 36713 2012-09-03 19:10:17Z smeyer

Definition at line 12 of file class.ilECSNodeMappingAssignments.php.

Member Function Documentation

static ilECSNodeMappingAssignments::deleteDisconnectableMappings (   $a_server_id,
  $a_mid,
  $a_tree_id,
  $a_ref_id 
)
static

delete disconnectable mappings

Parameters
<type>$a_server_id
<type>$a_mid
<type>$a_tree_id

Definition at line 242 of file class.ilECSNodeMappingAssignments.php.

References deleteMappingsByCsId(), ilECSCmsData\lookupStatusByCmsId(), ilECSCmsData\MAPPING_DELETED, ilECSCmsData\MAPPING_MAPPED, ilECSCmsData\MAPPING_PENDING_DISCONNECTABLE, ilECSCmsData\MAPPING_PENDING_NOT_DISCONNECTABLE, and ilECSCmsData\MAPPING_UNMAPPED.

Referenced by ilECSMappingSettingsGUI\dMap().

{
global $ilDB;
include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
$toDelete = array();
foreach(self::lookupAssignmentsByRefId($a_server_id, $a_mid, $a_tree_id,$a_ref_id) as $assignment)
{
$status = ilECSCmsData::lookupStatusByCmsId($a_server_id, $a_mid, $a_tree_id, $assignment);
switch($status)
{
$toDelete[] = $assignment;
break;
$toDelete[] = $assignment;
break;
break;
$toDelete[] = $assignment;
break;
$toDelete[] = $assignment;
break;
}
}
self::deleteMappingsByCsId($a_server_id, $a_mid, $a_tree_id, $toDelete);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilECSNodeMappingAssignments::deleteMappings (   $a_server_id,
  $a_mid,
  $a_tree_id 
)
static

Delete mappings $ilDB $ilDB.

Parameters
<type>$a_server_id
<type>$a_mid
<type>$a_tree_id
Returns
<type>

Definition at line 224 of file class.ilECSNodeMappingAssignments.php.

References $query.

Referenced by ilECSMappingSettingsGUI\dDeleteTree(), and ilECSCmsTreeCommandQueueHandler\handleDelete().

{
global $ilDB;
$query = 'DELETE FROM ecs_node_mapping_a '.
'WHERE server_id = '.$ilDB->quote($a_server_id).' '.
'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
'AND cs_root = '.$ilDB->quote($a_tree_id,'integer').' ';
$ilDB->manipulate($query);
return true;
}

+ Here is the caller graph for this function:

static ilECSNodeMappingAssignments::deleteMappingsByCsId (   $a_server_id,
  $a_mid,
  $a_tree_id,
  $cs_ids 
)
static

Delete mappings $ilDB.

Parameters
<type>$a_server_id
<type>$a_mid
<type>$a_tree_id
<type>$a_ref_id
<type>$cs_ids
Returns
<type>

Definition at line 203 of file class.ilECSNodeMappingAssignments.php.

References $query.

Referenced by deleteDisconnectableMappings(), and ilECSMappingSettingsGUI\dMap().

{
global $ilDB;
$query = 'DELETE FROM ecs_node_mapping_a '.
'WHERE server_id = '.$ilDB->quote($a_server_id).' '.
'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
'AND cs_root = '.$ilDB->quote($a_tree_id,'integer').' '.
'AND '.$ilDB->in('cs_id',$cs_ids,false,'integer');
$ilDB->manipulate($query);
return true;
}

+ Here is the caller graph for this function:

static ilECSNodeMappingAssignments::hasAssignments (   $a_server_id,
  $a_mid,
  $a_tree_id 
)
static

Check if there is any assignment for a cms tree.

Parameters
int$a_server_id
int$a_tree_id

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

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

Referenced by ilECSMappingUtils\lookupMappingStatus().

{
global $ilDB;
$query = 'SELECT ref_id FROM ecs_node_mapping_a '.
'WHERE server_id = '.$ilDB->quote($a_server_id,'integer'). ' '.
'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
'AND cs_root = '.$ilDB->quote($a_tree_id,'integer').' '.
'AND ref_id > 0';
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return true;
}
return false;
}

+ Here is the caller graph for this function:

static ilECSNodeMappingAssignments::isWholeTreeMapped (   $a_server_id,
  $a_mid,
  $a_tree_id 
)
static

Check if whole tree is mapped.

Parameters
int$a_server_id
int$a_tree_id

Definition at line 128 of file class.ilECSNodeMappingAssignments.php.

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

Referenced by ilECSMappingUtils\lookupMappingStatus().

{
global $ilDB;
$query = 'SELECT depth FROM ecs_node_mapping_a '.
'JOIN ecs_cms_tree ON (tree = cs_root AND child = cs_id) '.
'WHERE server_id = '.$ilDB->quote($a_server_id,'integer').' '.
'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
'AND cs_root = '.$ilDB->quote($a_tree_id,'integer').' ';
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->depth == 1;
}
return false;
}

+ Here is the caller graph for this function:

static ilECSNodeMappingAssignments::lookupAssignmentIds (   $a_server_id,
  $a_mid,
  $a_tree_id 
)
static

Lookup assignments $ilDB.

Parameters
<type>$a_server_id
<type>$a_mid
<type>$a_tree_id

Definition at line 78 of file class.ilECSNodeMappingAssignments.php.

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

Referenced by ilECSCmsData\updateStatus().

{
global $ilDB;
$query = 'SELECT cs_id FROM ecs_node_mapping_a '.
'WHERE server_id = '.$ilDB->quote($a_server_id,'integer'). ' '.
'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
'AND cs_root = '.$ilDB->quote($a_tree_id,'integer').' '.
'AND ref_id > 0';
$res = $ilDB->query($query);
$assignments = array();
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$assignments[] = $row->cs_id;
}
return $assignments;
}

+ Here is the caller graph for this function:

static ilECSNodeMappingAssignments::lookupAssignmentsByRefId (   $a_server_id,
  $a_mid,
  $a_tree_id,
  $a_ref_id 
)
static

Lookup assignments.

Parameters
<type>$a_server_id
<type>$a_mid
<type>$a_tree_id

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

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

Referenced by ilECSMappingSettingsGUI\dShowCmsExplorer().

{
global $ilDB;
$query = 'SELECT cs_id FROM ecs_node_mapping_a '.
'WHERE server_id = '.$ilDB->quote($a_server_id,'integer'). ' '.
'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
'AND cs_root = '.$ilDB->quote($a_tree_id,'integer').' '.
'AND ref_id = '.$ilDB->quote($a_ref_id,'integer').' ';
$res = $ilDB->query($query);
$assignments = array();
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$assignments[] = $row->cs_id;
}
return $assignments;
}

+ Here is the caller graph for this function:

static ilECSNodeMappingAssignments::lookupDefaultTitleUpdate (   $a_server_id,
  $a_mid,
  $a_tree_id 
)
static

Lookup default title update setting.

Definition at line 148 of file class.ilECSNodeMappingAssignments.php.

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

Referenced by ilECSMappingSettingsGUI\dMap().

{
global $ilDB;
$query = 'SELECT title_update FROM ecs_node_mapping_a '.
'WHERE server_id = '.$ilDB->quote($a_server_id,'integer').' '.
'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
'AND cs_root = '.$ilDB->quote($a_tree_id,'integer').' '.
'AND cs_id = '.$ilDB->quote(0,'integer').' ';
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return (bool) $row->title_update;
}
return false;
}

+ Here is the caller graph for this function:

static ilECSNodeMappingAssignments::lookupMappedItemsForRefId (   $a_server_id,
  $a_mid,
  $a_tree_id,
  $a_ref_id 
)
static

Get cs ids for ref_id <type> $ilDB.

Parameters
<type>$a_server_id
<type>$a_mid
<type>$a_tree_id
<type>$a_ref_id
Returns
<type>

Definition at line 174 of file class.ilECSNodeMappingAssignments.php.

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

Referenced by ilECSMappingSettingsGUI\dShowCmsExplorer().

{
global $ilDB;
$query = 'SELECT cs_id FROM ecs_node_mapping_a '.
'WHERE server_id = '.$ilDB->quote($a_server_id,'integer').' '.
'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
'AND cs_root = '.$ilDB->quote($a_tree_id,'integer').' '.
'AND ref_id = '.$ilDB->quote($a_ref_id,'integer').' ';
$res = $ilDB->query($query);
$cs_ids = array();
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$cs_ids[] = $row->cs_id;
}
return $cs_ids;
}

+ Here is the caller graph for this function:

static ilECSNodeMappingAssignments::lookupSettings (   $a_server_id,
  $a_mid,
  $a_tree_id,
  $a_node_id 
)
static

Lookup Settings.

Parameters
type$a_server_id
type$a_mid
type$a_tree_id
Returns
mixed false in case of no specific setting available, array of settings

Definition at line 45 of file class.ilECSNodeMappingAssignments.php.

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

Referenced by ilECSCmsTreeSynchronizer\sync().

{
global $ilDB;
$query = 'SELECT title_update, position_update, tree_update FROM ecs_node_mapping_a '.
'WHERE server_id = '.$ilDB->quote($a_server_id,'integer'). ' '.
'AND mid = '.$ilDB->quote($a_mid,'integer').' '.
'AND cs_root = '.$ilDB->quote($a_tree_id,'integer').' '.
'AND cs_id = '.$ilDB->quote($a_node_id,'integer');
$res = $ilDB->query($query);
if(!$res->numRows())
{
return false;
}
$settings = array();
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$settings['title_update'] = $row->title_update;
$settings['position_update'] = $row->position_update;
$settings['tree_update'] = $row->tree_update;
}
return (array) $settings;
}

+ Here is the caller graph for this function:


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