ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
class.ilECSDirectoryTreeConnector.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4
include_once
'./Services/WebServices/ECS/classes/class.ilECSConnector.php'
;
5
include_once
'./Services/WebServices/ECS/classes/class.ilECSConnectorException.php'
;
6
13
class
ilECSDirectoryTreeConnector
extends
ilECSConnector
14
{
15
20
public
function
__construct
(
ilECSSetting
$settings
= null)
21
{
22
parent::__construct(
$settings
);
23
}
24
31
public
function
getDirectoryTrees
($a_mid = 0)
32
{
33
global
$ilLog
;
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'
, $a_mid);
44
}
45
46
$this->curl->setOpt(CURLOPT_HTTPHEADER, $this->
getHeader
());
47
$res
= $this->
call
();
48
49
$ecsResult =
new
ilECSResult
(
$res
,
false
,
ilECSResult::RESULT_TYPE_URL_LIST
);
50
return
$ecsResult->getResult();
51
}
catch
(
ilCurlConnectionException
$exc) {
52
throw
new
ilECSConnectorException
(
'Error calling ECS service: '
. $exc->getMessage());
53
}
54
}
55
60
public
function
getDirectoryTree
($tree_id)
61
{
62
$this->path_postfix =
'/campusconnect/directory_trees/'
. (int) $tree_id;
63
64
try
{
65
$this->
prepareConnection
();
66
$this->
setHeader
(
array
());
67
$this->
addHeader
(
'Accept'
,
'text/uri-list'
);
68
$this->curl->setOpt(CURLOPT_HTTPHEADER, $this->
getHeader
());
69
$res
= $this->
call
();
70
71
if
(substr(
$res
, 0, 4) ==
'http'
) {
72
$json = file_get_contents(
$res
);
73
$ecs_result =
new
ilECSResult
($json);
74
}
else
{
75
$ecs_result =
new
ilECSResult
(
$res
);
76
}
77
return
$ecs_result;
78
}
catch
(
ilCurlConnectionException
$e) {
79
throw
new
ilECSConnectorException
(
'Error calling ECS service: '
. $e->getMessage());
80
}
81
}
82
}
ilECSResult\RESULT_TYPE_URL_LIST
const RESULT_TYPE_URL_LIST
Definition:
class.ilECSResult.php:38
ilCurlConnectionException
Definition:
class.ilCurlConnectionException.php:34
ilECSSetting
Definition:
class.ilECSSetting.php:33
ilECSConnector\$settings
$settings
Definition:
class.ilECSConnector.php:50
ilECSConnector\getHeader
getHeader()
Definition:
class.ilECSConnector.php:82
ilECSDirectoryTreeConnector
Definition:
class.ilECSDirectoryTreeConnector.php:13
ilECSResult
Definition:
class.ilECSResult.php:35
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilECSConnectorException
Definition:
class.ilECSConnectorException.php:36
ilECSDirectoryTreeConnector\getDirectoryTree
getDirectoryTree($tree_id)
Get single directory tree.
Definition:
class.ilECSDirectoryTreeConnector.php:60
ilECSConnector\setHeader
setHeader($a_header_strings)
Definition:
class.ilECSConnector.php:87
$ilLog
$ilLog
Definition:
inc.setup_header.php:129
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
ilECSConnector\call
call()
call peer
Definition:
class.ilECSConnector.php:591
ilECSConnector
Definition:
class.ilECSConnector.php:38
ilECSConnector\addHeader
addHeader($a_name, $a_value)
Add Header.
Definition:
class.ilECSConnector.php:77
ilECSDirectoryTreeConnector\__construct
__construct(ilECSSetting $settings=null)
Constructor.
Definition:
class.ilECSDirectoryTreeConnector.php:20
ilECSConnector\prepareConnection
prepareConnection()
prepare connection
Definition:
class.ilECSConnector.php:548
ilECSDirectoryTreeConnector\getDirectoryTrees
getDirectoryTrees($a_mid=0)
Get directory tree ilLog $ilLog.
Definition:
class.ilECSDirectoryTreeConnector.php:31
Services
WebServices
ECS
classes
Tree
class.ilECSDirectoryTreeConnector.php
Generated on Sat Jan 18 2025 19:01:41 for ILIAS by
1.8.13 (using
Doxyfile
)