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;
158 if(!is_object($json))
160 $ilLog->write(__METHOD__.
': Cannot load from JSON. No object given.');
161 throw new ilException(
'Cannot parse ECS content details.');
164 foreach((array) $json->senders as $sender)
166 $this->senders[] = $sender->mid;
170 foreach((array) $json->receivers as $receiver)
172 $this->receivers[] = $receiver->mid;
173 if($receiver->itsyou and $this->sender_index === NULL)
175 $this->sender_index = $index;
183 $this->receiver_info[$this->sender[$i]] = $this->receivers[$i];
186 if(is_object($json->owner))
188 $this->owner = (int) $json->owner->pid;
191 $this->url = $json->url;
192 $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
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