ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilECSCourseConnector Class Reference
+ Inheritance diagram for ilECSCourseConnector:
+ Collaboration diagram for ilECSCourseConnector:

Public Member Functions

 __construct (ilECSSetting $settings=null)
 Constructor. More...
 
 getCourse ($course_id, $a_details=false)
 Get single directory tree. More...
 
- Public Member Functions inherited from ilECSConnector
 __construct (ilECSSetting $settings=null)
 Constructor. More...
 
 addHeader ($a_name, $a_value)
 Add Header. More...
 
 getHeader ()
 
 setHeader ($a_header_strings)
 
 getServer ()
 Get current server setting. More...
 
 addAuth ($a_post, $a_target_mid)
 Add auth resource. More...
 
 getAuth ($a_hash, $a_details_only=false)
 get auth resource More...
 
 getEventQueues ()
 get event queue More...
 
 readEventFifo ($a_delete=false)
 Read event fifo. More...
 
 getResourceList ($a_path)
 
 getResource ($a_path, $a_econtent_id, $a_details_only=false)
 Get resources from ECS server. More...
 
 addResource ($a_path, $a_post)
 Add resource. More...
 
 updateResource ($a_path, $a_econtent_id, $a_post_string)
 update resource More...
 
 deleteResource ($a_path, $a_econtent_id)
 Delete resource. More...
 
 getMemberships ($a_mid=0)
 @access public More...
 

Additional Inherited Members

- Data Fields inherited from ilECSConnector
const HTTP_CODE_CREATED = 201
 
const HTTP_CODE_OK = 200
 
const HTTP_CODE_NOT_FOUND = 404
 
const HEADER_MEMBERSHIPS = 'X-EcsReceiverMemberships'
 
const HEADER_COMMUNITIES = 'X-EcsReceiverCommunities'
 
- Protected Member Functions inherited from ilECSConnector
 prepareConnection ()
 prepare connection More...
 
 call ()
 call peer More...
 
- Static Protected Member Functions inherited from ilECSConnector
static _fetchEContentIdFromHeader ($a_header)
 fetch new econtent id from location header More...
 
- Protected Attributes inherited from ilECSConnector
 $path_postfix = ''
 
 $settings
 
 $header_strings = array()
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilECSCourseConnector::__construct ( ilECSSetting  $settings = null)

Constructor.

Parameters
ilECSSetting$settings

Reimplemented from ilECSConnector.

Definition at line 20 of file class.ilECSCourseConnector.php.

21 {
22 parent::__construct($settings);
23 }

References ilECSConnector\$settings.

Member Function Documentation

◆ getCourse()

ilECSCourseConnector::getCourse (   $course_id,
  $a_details = false 
)

Get single directory tree.

Returns
array an array of ecs cms directory tree entries

Definition at line 30 of file class.ilECSCourseConnector.php.

31 {
32 $this->path_postfix = '/campusconnect/courses/' . (int) $course_id;
33
34 if ($a_details and $course_id) {
35 $this->path_postfix .= '/details';
36 }
37
38 try {
39 $this->prepareConnection();
40 $this->setHeader(array());
41 if ($a_details) {
42 $this->addHeader('Accept', 'application/json');
43 } else {
44 $this->addHeader('Accept', 'text/uri-list');
45 }
46 $this->curl->setOpt(CURLOPT_HTTPHEADER, $this->getHeader());
47 $res = $this->call();
48
49 if (substr($res, 0, 4) == 'http') {
50 $json = file_get_contents($res);
51 $ecs_result = new ilECSResult($json);
52 } else {
53 $ecs_result = new ilECSResult($res);
54 }
55
56 // Return ECSEContentDetails for details switch
57 if ($a_details) {
58 include_once './Services/WebServices/ECS/classes/class.ilECSEContentDetails.php';
59 $details = new ilECSEContentDetails();
60 $details->loadFromJson($ecs_result->getResult());
61 return $details;
62 }
63 // Return json result
64 return $ecs_result->getResult();
65 } catch (ilCurlConnectionException $e) {
66 throw new ilECSConnectorException('Error calling ECS service: ' . $e->getMessage());
67 }
68 }
addHeader($a_name, $a_value)
Add Header.
prepareConnection()
prepare connection
setHeader($a_header_strings)
Presentation of ecs content details (http://...campusconnect/courselinks/id/details)
foreach($_POST as $key=> $value) $res

References $res, ilECSConnector\addHeader(), ilECSConnector\call(), ilECSConnector\getHeader(), ilECSConnector\prepareConnection(), and ilECSConnector\setHeader().

+ Here is the call graph for this function:

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