ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilECSCourseMemberConnector Class Reference

Connector for course member ressource. More...

+ Inheritance diagram for ilECSCourseMemberConnector:
+ Collaboration diagram for ilECSCourseMemberConnector:

Public Member Functions

 __construct (ilECSSetting $settings=null)
 Constructor. More...
 
 getCourseMember ($course_member_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)
 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

Connector for course member ressource.

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

Definition at line 13 of file class.ilECSCourseMemberConnector.php.

Constructor & Destructor Documentation

◆ __construct()

ilECSCourseMemberConnector::__construct ( ilECSSetting  $settings = null)

Constructor.

Parameters
ilECSSetting$settings

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

References ilECSConnector\$settings.

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

Member Function Documentation

◆ getCourseMember()

ilECSCourseMemberConnector::getCourseMember (   $course_member_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.ilECSCourseMemberConnector.php.

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

31  {
32  $this->path_postfix = '/campusconnect/course_members/' . (int) $course_member_id;
33 
34  if ($a_details and $course_member_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  $GLOBALS['ilLog']->write(print_r($res, true));
61  $details->loadFromJson($ecs_result->getResult());
62  return $details;
63  }
64 
65  return $ecs_result->getResult();
66  } catch (ilCurlConnectionException $e) {
67  throw new ilECSConnectorException('Error calling ECS service: ' . $e->getMessage());
68  }
69  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Presentation of ecs content details (http://...campusconnect/courselinks/id/details) ...
foreach($_POST as $key=> $value) $res
setHeader($a_header_strings)
Create styles array
The data for the language used.
addHeader($a_name, $a_value)
Add Header.
prepareConnection()
prepare connection
+ Here is the call graph for this function:

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