ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilECSDirectoryTreeConnector Class Reference
+ Inheritance diagram for ilECSDirectoryTreeConnector:
+ Collaboration diagram for ilECSDirectoryTreeConnector:

Public Member Functions

 __construct (ilECSSetting $settings=null)
 Constructor. More...
 
 getDirectoryTrees ($a_mid=0)
 Get directory tree ilLog $ilLog. More...
 
 getDirectoryTree ($tree_id)
 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

Constructor & Destructor Documentation

◆ __construct()

ilECSDirectoryTreeConnector::__construct ( ilECSSetting  $settings = null)

Constructor.

Parameters
ilECSSetting$settings

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

References ilECSConnector\$settings.

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

Member Function Documentation

◆ getDirectoryTree()

ilECSDirectoryTreeConnector::getDirectoryTree (   $tree_id)

Get single directory tree.

Returns
array an array of ecs cms directory tree entries

Definition at line 62 of file class.ilECSDirectoryTreeConnector.php.

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

63  {
64  $this->path_postfix = '/campusconnect/directory_trees/' . (int) $tree_id;
65 
66  try {
67  $this->prepareConnection();
68  $this->setHeader(array());
69  $this->addHeader('Accept', 'text/uri-list');
70  $this->curl->setOpt(CURLOPT_HTTPHEADER, $this->getHeader());
71  $res = $this->call();
72 
73  if (substr($res, 0, 4) == 'http') {
74  $json = file_get_contents($res);
75  $ecs_result = new ilECSResult($json);
76  } else {
77  $ecs_result = new ilECSResult($res);
78  }
79  return $ecs_result;
80  } catch (ilCurlConnectionException $e) {
81  throw new ilECSConnectorException('Error calling ECS service: ' . $e->getMessage());
82  }
83  }
foreach($_POST as $key=> $value) $res
setHeader($a_header_strings)
addHeader($a_name, $a_value)
Add Header.
prepareConnection()
prepare connection
+ Here is the call graph for this function:

◆ getDirectoryTrees()

ilECSDirectoryTreeConnector::getDirectoryTrees (   $a_mid = 0)

Get directory tree ilLog $ilLog.

Returns
ilECSResult
Exceptions
ilECSConnectorException

Definition at line 31 of file class.ilECSDirectoryTreeConnector.php.

References $DIC, $ilLog, $res, ilECSConnector\addHeader(), ilECSConnector\call(), ilECSConnector\getHeader(), ilECSConnector\prepareConnection(), ilECSResult\RESULT_TYPE_URL_LIST, and ilECSConnector\setHeader().

32  {
33  global $DIC;
34 
35  $ilLog = $DIC['ilLog'];
36 
37  $this->path_postfix = '/campusconnect/directory_trees';
38 
39  try {
40  $this->prepareConnection();
41  $this->setHeader(array());
42  $this->addHeader('Accept', 'text/uri-list');
43  $this->addHeader('X-EcsQueryStrings', 'all=true');
44  if ($a_mid) {
45  $this->addHeader('X-EcsReceiverMemberships', $a_mid);
46  }
47 
48  $this->curl->setOpt(CURLOPT_HTTPHEADER, $this->getHeader());
49  $res = $this->call();
50 
51  $ecsResult = new ilECSResult($res, false, ilECSResult::RESULT_TYPE_URL_LIST);
52  return $ecsResult->getResult();
53  } catch (ilCurlConnectionException $exc) {
54  throw new ilECSConnectorException('Error calling ECS service: ' . $exc->getMessage());
55  }
56  }
const RESULT_TYPE_URL_LIST
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
setHeader($a_header_strings)
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: