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

Static Public Member Functions

static lookupParticipantName ($a_owner, $a_server_id)
 Lookup participant name.
static _getOptionalEContentFields ()
 get optional econtent fields These fields might be mapped against AdvancedMetaData field definitions
static _getOptionalECourseFields ()
 get optional econtent fields These fields might be mapped against AdvancedMetaData field definitions
static getPossibleRemoteTypes ($a_with_captions=false)
 Get all possible remote object types.
static getPossibleReleaseTypes ($a_with_captions=false)
 Get all possible release object types.
static getEContentDefinition ($a_resource_id)
 Get econtent / metadata definition.
static getMatchableContent ($a_resource_id, $a_server_id, $a_ecs_content, $a_owner)
 Convert ECS content to rule matchable values.

Data Fields

const TYPE_ARRAY = 1
const TYPE_INT = 2
const TYPE_STRING = 3
const TYPE_TIMEPLACE = 4

Detailed Description

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

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

Member Function Documentation

static ilECSUtils::_getOptionalEContentFields ( )
static

get optional econtent fields These fields might be mapped against AdvancedMetaData field definitions

public

Definition at line 75 of file class.ilECSUtils.php.

References getEContentDefinition().

Referenced by ilECSSettingsGUI\initMappingsForm().

{
// :TODO: ?
$def = self::getEContentDefinition('/campusconnect/courselinks');
return array_keys($def);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilECSUtils::_getOptionalECourseFields ( )
static

get optional econtent fields These fields might be mapped against AdvancedMetaData field definitions

public

Definition at line 90 of file class.ilECSUtils.php.

References getEContentDefinition().

Referenced by ilECSCategoryMapping\getPossibleFields(), and ilECSSettingsGUI\initMappingsForm().

{
// :TODO: ?
$def = self::getEContentDefinition('/campusconnect/courselinks');
return array_keys($def);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilECSUtils::getEContentDefinition (   $a_resource_id)
static

Get econtent / metadata definition.

Parameters
string$a_resource_id
Returns
array

Definition at line 153 of file class.ilECSUtils.php.

Referenced by _getOptionalEContentFields(), _getOptionalECourseFields(), ilECSCourseSettings\buildJson(), getMatchableContent(), and ilObjRemoteCourse\updateCustomFromECSContent().

{
switch($a_resource_id)
{
case '/campusconnect/courselinks':
return array(
'study_courses' => self::TYPE_ARRAY,
'lecturer' => self::TYPE_ARRAY,
'courseType' => self::TYPE_STRING,
'courseID' => self::TYPE_INT,
'credits' => self::TYPE_INT,
'semester_hours' => self::TYPE_INT,
'term' => self::TYPE_STRING,
'begin' => array(self::TYPE_TIMEPLACE, 'timePlace'),
'end' => array(self::TYPE_TIMEPLACE, 'timePlace'),
'room' => array(self::TYPE_TIMEPLACE, 'timePlace'),
'cycle' => array(self::TYPE_TIMEPLACE, 'timePlace')
);
case '/campusconnect/categories':
case '/campusconnect/files':
case '/campusconnect/glossaries':
case '/campusconnect/groups':
case '/campusconnect/learningmodules':
case '/campusconnect/wikis':
// no metadata mapping yet
return array();
}
}

+ Here is the caller graph for this function:

static ilECSUtils::getMatchableContent (   $a_resource_id,
  $a_server_id,
  $a_ecs_content,
  $a_owner 
)
static

Convert ECS content to rule matchable values.

Parameters
string$a_resource_id
int$a_server_id
object$a_ecs_content
int$a_owner
Returns
array

Definition at line 192 of file class.ilECSUtils.php.

References $res, ilECSCategoryMappingRule\ATTR_ARRAY, ilECSCategoryMappingRule\ATTR_INT, ilECSCategoryMappingRule\ATTR_STRING, getEContentDefinition(), ilECSCommunitiesCache\getInstance(), TYPE_ARRAY, TYPE_INT, TYPE_STRING, and TYPE_TIMEPLACE.

Referenced by ilRemoteObjectBase\createFromECSEContent(), and ilRemoteObjectBase\updateFromECSContent().

{
include_once './Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
include_once './Services/WebServices/ECS/classes/class.ilECSCommunitiesCache.php';
// see ilECSCategoryMapping::getPossibleFields();
$res = array();
$res["part_id"] = array($a_owner, ilECSCategoryMappingRule::ATTR_INT);
$res["community"] = array(ilECSCommunitiesCache::getInstance()->lookupTitle($a_server_id, $a_owner),
$definition = self::getEContentDefinition($a_resource_id);
$timePlace = null;
foreach($definition as $id => $type)
{
if(is_array($type))
{
$target = $type[1];
$type = $type[0];
}
else
{
$target = $id;
}
switch($type)
{
$value = array(implode(',', (array) $a_ecs_content->$target), ilECSCategoryMappingRule::ATTR_ARRAY);
break;
$value = array((int)$a_ecs_content->$target, ilECSCategoryMappingRule::ATTR_INT);
break;
$value = array((string)$a_ecs_content->$target, ilECSCategoryMappingRule::ATTR_STRING);
break;
if(!is_object($timePlace))
{
include_once('./Services/WebServices/ECS/classes/class.ilECSTimePlace.php');
if(is_object($a_ecs_content->$target))
{
$timePlace = new ilECSTimePlace();
$timePlace->loadFromJSON($a_ecs_content->$target);
}
else
{
$timePlace = new ilECSTimePlace();
}
}
switch($id)
{
case 'begin':
case 'end':
$value = array($timePlace->{'getUT'.ucfirst($id)}(),
break;
case 'room':
case 'cycle':
$value = array($timePlace->{'get'.ucfirst($id)}(),
break;
}
break;
}
$res[$id] = $value;
}
return $res;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilECSUtils::getPossibleReleaseTypes (   $a_with_captions = false)
static

Get all possible release object types.

Parameters
bool$a_with_captions
Returns
array

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

References $lng, and $res.

Referenced by ilECSSettingsGUI\released().

{
global $lng;
$all = array("crs", "cat", "file", "glo", "grp", "lm", "wiki");
if(!$a_with_captions)
{
return $all;
}
$res = array();
foreach($all as $id)
{
$res[$id] = $lng->txt("obj_".$id);
}
return $res;
}

+ Here is the caller graph for this function:

static ilECSUtils::getPossibleRemoteTypes (   $a_with_captions = false)
static

Get all possible remote object types.

Parameters
bool$a_with_captions
Returns
array

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

References $lng, and $res.

Referenced by ilECSImport\getAllImportedRemoteObjects(), ilECSEventQueueReader\handleImportReset(), ilECSSettingsGUI\imported(), and ilECSSettingsGUI\initCategoryMappingForm().

{
global $lng;
$all = array("rcrs", "rcat", "rfil", "rglo", "rgrp", "rlm", "rwik");
if(!$a_with_captions)
{
return $all;
}
$res = array();
foreach($all as $id)
{
$res[$id] = $lng->txt("obj_".$id);
}
return $res;
}

+ Here is the caller graph for this function:

static ilECSUtils::lookupParticipantName (   $a_owner,
  $a_server_id 
)
static

Lookup participant name.

Parameters
int$a_ownerMid of participant
int$a_server_id
Returns

Definition at line 47 of file class.ilECSUtils.php.

References $ilLog, $reader, and ilECSCommunityReader\getInstanceByServerId().

Referenced by ilECSCategoryMappingRule\participantsToString(), and ilRemoteObjectBase\updateFromECSContent().

{
global $ilLog;
try {
include_once './Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
if($part = $reader->getParticipantByMID($a_owner))
{
return $part->getParticipantName();
}
return '';
}
{
$ilLog->write(__METHOD__.': Error reading participants.');
return '';
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

const ilECSUtils::TYPE_ARRAY = 1
const ilECSUtils::TYPE_INT = 2
const ilECSUtils::TYPE_STRING = 3
const ilECSUtils::TYPE_TIMEPLACE = 4

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