ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilECSDirectoryTreeConnector Class Reference
+ Inheritance diagram for ilECSDirectoryTreeConnector:
+ Collaboration diagram for ilECSDirectoryTreeConnector:

Public Member Functions

 getDirectoryTrees (int $a_mid=0)
 Get directory tree. More...
 
 getDirectoryTree ($tree_id)
 Get single directory tree. More...
 
- Public Member Functions inherited from ilECSConnector
 __construct (?ilECSSetting $settings=null)
 
 addHeader (string $a_name, string $a_value)
 Add Header. More...
 
 getHeader ()
 
 setHeader (array $a_header_strings)
 
 getServer ()
 Get current server setting. More...
 
 addAuth (string $a_post, int $a_target_mid)
 Add auth resource. More...
 
 getAuth (string $a_hash, bool $a_details_only=false)
 get auth resource More...
 
 readEventFifo (bool $a_delete=false)
 Read event fifo. More...
 
 getResourceList (string $a_path)
 
 getResource (string $a_path, int $a_econtent_id, bool $a_details_only=false)
 Get resources from ECS server. More...
 
 addResource (string $a_path, $a_post)
 Add resource. More...
 
 updateResource (string $a_path, int $a_econtent_id, string $a_post_string)
 update resource More...
 
 deleteResource (string $a_path, int $a_econtent_id)
 Delete resource. More...
 
 getMemberships (int $a_mid=0)
 

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...
 
- Protected Attributes inherited from ilECSConnector
string $path_postfix = ''
 
ilECSSetting $settings = null
 
ilCurlConnection $curl = null
 
array $header_strings = []
 
ilLogger $logger
 

Detailed Description

Member Function Documentation

◆ getDirectoryTree()

ilECSDirectoryTreeConnector::getDirectoryTree (   $tree_id)

Get single directory tree.

Returns
ilECSResult an array of ecs cms directory tree entries

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

References Vendor\Package\$e, $res, ilECSConnector\addHeader(), ilECSConnector\call(), ilECSConnector\getHeader(), ILIAS\Repository\int(), ilECSConnector\prepareConnection(), and ilECSConnector\setHeader().

59  : ilECSResult
60  {
61  $this->path_postfix = '/campusconnect/directory_trees/' . (int) $tree_id;
62 
63  try {
64  $this->prepareConnection();
65  $this->setHeader(array());
66  $this->addHeader('Accept', 'text/uri-list');
67  $this->curl->setOpt(CURLOPT_HTTPHEADER, $this->getHeader());
68  $res = $this->call();
69 
70  if (strpos($res, 'http') === 0) {
71  $json = file_get_contents($res);
72  $ecs_result = new ilECSResult($json);
73  } else {
74  $ecs_result = new ilECSResult($res);
75  }
76  return $ecs_result;
77  } catch (ilCurlConnectionException $e) {
78  throw new ilECSConnectorException('Error calling ECS service: ' . $e->getMessage());
79  }
80  }
$res
Definition: ltiservices.php:66
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addHeader(string $a_name, string $a_value)
Add Header.
setHeader(array $a_header_strings)
prepareConnection()
prepare connection
+ Here is the call graph for this function:

◆ getDirectoryTrees()

ilECSDirectoryTreeConnector::getDirectoryTrees ( int  $a_mid = 0)

Get directory tree.

Exceptions
ilECSConnectorException

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

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

33  : ?\ilECSUriList
34  {
35  $this->path_postfix = '/campusconnect/directory_trees';
36 
37  try {
38  $this->prepareConnection();
39  $this->setHeader(array());
40  $this->addHeader('Accept', 'text/uri-list');
41  $this->addHeader('X-EcsQueryStrings', 'all=true');
42  if ($a_mid) {
43  $this->addHeader('X-EcsReceiverMemberships', (string) $a_mid);
44  }
45 
46  $this->curl->setOpt(CURLOPT_HTTPHEADER, $this->getHeader());
47  $res = $this->call();
48 
49  return (new ilECSResult($res, ilECSResult::RESULT_TYPE_URL_LIST))->getResult();
50  } catch (ilCurlConnectionException $exc) {
51  throw new ilECSConnectorException('Error calling ECS service: ' . $exc->getMessage());
52  }
53  }
const RESULT_TYPE_URL_LIST
$res
Definition: ltiservices.php:66
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addHeader(string $a_name, string $a_value)
Add Header.
Presentation of ecs uril (http://...campusconnect/courselinks)
setHeader(array $a_header_strings)
prepareConnection()
prepare connection
+ Here is the call graph for this function:

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