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

Presentation of ecs content details (http://...campusconnect/courselinks/id/details) More...

+ Collaboration diagram for ilECSEContentDetails:

Public Member Functions

 __construct ()
 getSenders ()
 Get senders.
 getFirstSender ()
 get first sender
 getMySender ()
 Get sender from whom we received the ressource According to the documentation the sender and receiver arrays have corresponding indexes.
 getReceivers ()
 Get recievers.
 getFirstReceiver ()
 Get first receiver.
 getReceiverInfo ()
 Get receiver info.
 getUrl ()
 Get url.
 getOwner ()
 loadFromJson ($json)
 Load from JSON object.

Static Public Member Functions

static getInstance ($a_server_id, $a_econtent_id, $a_resource_type)
 Get data from server.

Data Fields

 $senders = array()
 $sender_index = NULL
 $receivers = array()
 $url = array()
 $content_type = array()
 $owner = 0

Private Attributes

 $receiver_info = array()

Detailed Description

Presentation of ecs content details (http://...campusconnect/courselinks/id/details)

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 32 of file class.ilECSEContentDetails.php.

Constructor & Destructor Documentation

ilECSEContentDetails::__construct ( )

Definition at line 44 of file class.ilECSEContentDetails.php.

{
}

Member Function Documentation

ilECSEContentDetails::getFirstReceiver ( )

Get first receiver.

Returns
int

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

References getReceivers().

{
foreach ($this->getReceivers() as $mid)
{
return $mid;
}
return 0;
}

+ Here is the call graph for this function:

ilECSEContentDetails::getFirstSender ( )

get first sender

Definition at line 101 of file class.ilECSEContentDetails.php.

{
return isset($this->senders[0]) ? $this->senders[0] : 0;
}
static ilECSEContentDetails::getInstance (   $a_server_id,
  $a_econtent_id,
  $a_resource_type 
)
static

Get data from server.

Parameters
int$a_server_id
int$a_econtent_id
string$a_resource_type
Returns
ilECSEContentDetails

Definition at line 57 of file class.ilECSEContentDetails.php.

References $ilLog, $res, ilECSSetting\getInstanceByServerId(), and ilECSConnector\HTTP_CODE_NOT_FOUND.

Referenced by ilECSObjectSettings\addSettingsToForm(), ilECSObjectSettings\getParticipants(), ilRemoteObjectBase\handleUpdate(), and ilECSObjectSettings\sendNewContentNotification().

{
global $ilLog;
try
{
include_once './Services/WebServices/ECS/classes/class.ilECSSetting.php';
include_once './Services/WebServices/ECS/classes/class.ilECSConnector.php';
$connector = new ilECSConnector(ilECSSetting::getInstanceByServerId($a_server_id));
$res = $connector->getResource($a_resource_type, $a_econtent_id, true);
{
return;
}
if(!is_object($res->getResult()))
{
$ilLog->write(__METHOD__ . ': Error parsing result. Expected result of type array.');
$ilLog->logStack();
throw new ilECSConnectorException('error parsing json');
}
}
{
return;
}
include_once './Services/WebServices/ECS/classes/class.ilECSEContentDetails.php';
$details = new self();
$details->loadFromJSON($res->getResult());
return $details;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilECSEContentDetails::getMySender ( )

Get sender from whom we received the ressource According to the documentation the sender and receiver arrays have corresponding indexes.

Definition at line 110 of file class.ilECSEContentDetails.php.

References $sender_index.

{
return $this->senders[$this->sender_index];
}
ilECSEContentDetails::getOwner ( )

Definition at line 155 of file class.ilECSEContentDetails.php.

References $owner.

{
return (int) $this->owner;
}
ilECSEContentDetails::getReceiverInfo ( )

Get receiver info.

Returns
array

Definition at line 141 of file class.ilECSEContentDetails.php.

References $receiver_info.

{
return (array) $this->receiver_info;
}
ilECSEContentDetails::getReceivers ( )

Get recievers.

Returns
<type>

Definition at line 119 of file class.ilECSEContentDetails.php.

References $receivers.

Referenced by getFirstReceiver(), and loadFromJson().

{
return (array) $this->receivers;
}

+ Here is the caller graph for this function:

ilECSEContentDetails::getSenders ( )

Get senders.

Returns
array

Definition at line 93 of file class.ilECSEContentDetails.php.

References $senders.

{
return (array) $this->senders;
}
ilECSEContentDetails::getUrl ( )

Get url.

Returns
string

Definition at line 150 of file class.ilECSEContentDetails.php.

References $url.

{
return $this->url;
}
ilECSEContentDetails::loadFromJson (   $json)

Load from JSON object.

public

Parameters
objectJSON object
Exceptions
ilException

Definition at line 167 of file class.ilECSEContentDetails.php.

References $ilLog, and getReceivers().

{
global $ilLog;
if(!is_object($json))
{
$ilLog->write(__METHOD__.': Cannot load from JSON. No object given.');
throw new ilException('Cannot parse ECS content details.');
}
foreach((array) $json->senders as $sender)
{
$this->senders[] = $sender->mid;
}
$index = 0;
foreach((array) $json->receivers as $receiver)
{
$this->receivers[] = $receiver->mid;
if($receiver->itsyou and $this->sender_index === NULL)
{
$this->sender_index = $index;
}
++$index;
}
// Collect in one array
for($i = 0; $i < count($this->getReceivers()); ++$i)
{
$this->receiver_info[$this->sender[$i]] = $this->receivers[$i];
}
if(is_object($json->owner))
{
$this->owner = (int) $json->owner->pid;
}
$this->url = $json->url;
$this->content_type = $json->content_type;
return true;
}

+ Here is the call graph for this function:

Field Documentation

ilECSEContentDetails::$content_type = array()

Definition at line 39 of file class.ilECSEContentDetails.php.

ilECSEContentDetails::$owner = 0

Definition at line 40 of file class.ilECSEContentDetails.php.

Referenced by getOwner().

ilECSEContentDetails::$receiver_info = array()
private

Definition at line 42 of file class.ilECSEContentDetails.php.

Referenced by getReceiverInfo().

ilECSEContentDetails::$receivers = array()

Definition at line 37 of file class.ilECSEContentDetails.php.

Referenced by getReceivers().

ilECSEContentDetails::$sender_index = NULL

Definition at line 36 of file class.ilECSEContentDetails.php.

Referenced by getMySender().

ilECSEContentDetails::$senders = array()

Definition at line 35 of file class.ilECSEContentDetails.php.

Referenced by getSenders().

ilECSEContentDetails::$url = array()

Definition at line 38 of file class.ilECSEContentDetails.php.

Referenced by getUrl().


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