57 public static function getInstance($a_server_id, $a_econtent_id, $a_resource_type)
63 include_once
'./Services/WebServices/ECS/classes/class.ilECSSetting.php';
64 include_once
'./Services/WebServices/ECS/classes/class.ilECSConnector.php';
66 $res = $connector->getResource($a_resource_type, $a_econtent_id,
true);
71 if(!is_object(
$res->getResult()))
73 $ilLog->write(__METHOD__ .
': Error parsing result. Expected result of type array.');
83 include_once
'./Services/WebServices/ECS/classes/class.ilECSEContentDetails.php';
84 $details =
new self();
85 $details->loadFromJSON(
$res->getResult());
103 return isset($this->senders[0]) ? $this->senders[0] : 0;
171 if(!is_object($json))
173 $ilLog->write(__METHOD__.
': Cannot load from JSON. No object given.');
174 throw new ilException(
'Cannot parse ECS content details.');
177 foreach((
array) $json->senders as $sender)
179 $this->senders[] = $sender->mid;
183 foreach((
array) $json->receivers as $receiver)
185 $this->receivers[] = $receiver->mid;
186 if($receiver->itsyou
and $this->sender_index === NULL)
188 $this->sender_index = $index;
196 $this->receiver_info[$this->sender[$i]] = $this->receivers[$i];
199 if(is_object($json->owner))
201 $this->owner = (int) $json->owner->pid;
204 $this->url = $json->url;
205 $this->content_type = $json->content_type;
Base class for ILIAS Exception handling.
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
getMySender()
Get sender from whom we received the ressource According to the documentation the sender and receiver...
getReceiverInfo()
Get receiver info.
Presentation of ecs content details (http://...campusconnect/courselinks/id/details) ...
getFirstSender()
get first sender
Create styles array
The data for the language used.
getReceivers()
Get recievers.
loadFromJson($json)
Load from JSON object.
static getInstance($a_server_id, $a_econtent_id, $a_resource_type)
Get data from server.
const HTTP_CODE_NOT_FOUND
getFirstReceiver()
Get first receiver.