55 public static function getInstance($a_server_id, $a_econtent_id, $a_resource_type)
59 $ilLog =
$DIC[
'ilLog'];
62 include_once
'./Services/WebServices/ECS/classes/class.ilECSSetting.php';
63 include_once
'./Services/WebServices/ECS/classes/class.ilECSConnector.php';
65 $res = $connector->getResource($a_resource_type, $a_econtent_id,
true);
69 if (!is_object(
$res->getResult())) {
70 $ilLog->write(__METHOD__ .
': Error parsing result. Expected result of type array.');
78 include_once
'./Services/WebServices/ECS/classes/class.ilECSEContentDetails.php';
79 $details =
new self();
80 $details->loadFromJSON(
$res->getResult());
98 return isset($this->senders[0]) ? $this->senders[0] : 0;
165 $ilLog =
$DIC[
'ilLog'];
167 if (!is_object($json)) {
168 $ilLog->write(__METHOD__ .
': Cannot load from JSON. No object given.');
169 throw new ilException(
'Cannot parse ECS content details.');
172 foreach ((array) $json->senders as $sender) {
173 $this->senders[] = $sender->mid;
177 foreach ((array) $json->receivers as $receiver) {
178 $this->receivers[] = $receiver->mid;
179 if ($receiver->itsyou and $this->sender_index ===
null) {
180 $this->sender_index =
$index;
187 $this->receiver_info[$this->sender[
$i]] = $this->receivers[
$i];
190 if (is_object($json->owner)) {
191 $this->owner = (int) $json->owner->pid;
194 $this->url = $json->url;
195 $this->content_type = $json->content_type;
An exception for terminatinating execution or to throw for unit testing.
const HTTP_CODE_NOT_FOUND
Presentation of ecs content details (http://...campusconnect/courselinks/id/details)
getMySender()
Get sender from whom we received the ressource According to the documentation the sender and receiver...
getFirstReceiver()
Get first receiver.
getReceiverInfo()
Get receiver info.
static getInstance($a_server_id, $a_econtent_id, $a_resource_type)
Get data from server.
loadFromJson($json)
Load from JSON object.
getReceivers()
Get recievers.
getFirstSender()
get first sender
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
foreach($_POST as $key=> $value) $res