ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilECSCourseConnector Class Reference
+ Inheritance diagram for ilECSCourseConnector:
+ Collaboration diagram for ilECSCourseConnector:

Public Member Functions

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

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
 call ()
 call peer
- Static Protected Member Functions inherited from ilECSConnector
static _fetchEContentIdFromHeader ($a_header)
 fetch new econtent id from location header
- Protected Attributes inherited from ilECSConnector
 $path_postfix = ''
 $settings
 $header_strings = array()

Detailed Description

Constructor & Destructor Documentation

ilECSCourseConnector::__construct ( ilECSSetting  $settings = null)

Constructor.

Parameters
ilECSSetting$settings

Reimplemented from ilECSConnector.

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

References ilECSConnector\$settings.

{
parent::__construct($settings);
}

Member Function Documentation

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.

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

{
$this->path_postfix = '/campusconnect/courses/'. (int) $course_id;
if($a_details and $course_id)
{
$this->path_postfix .= '/details';
}
try {
$this->setHeader(array());
if($a_details)
{
$this->addHeader('Accept', 'application/json');
}
else
{
$this->addHeader('Accept', 'text/uri-list');
}
$this->curl->setOpt(CURLOPT_HTTPHEADER, $this->getHeader());
$res = $this->call();
if(substr($res, 0, 4) == 'http')
{
$json = file_get_contents($res);
$ecs_result = new ilECSResult($json);
}
else
{
$ecs_result = new ilECSResult($res);
}
// Return ECSEContentDetails for details switch
if($a_details)
{
include_once './Services/WebServices/ECS/classes/class.ilECSEContentDetails.php';
$details = new ilECSEContentDetails();
$details->loadFromJson($ecs_result->getResult());
return $details;
}
// Return json result
return $ecs_result->getResult();
}
{
throw new ilECSConnectorException('Error calling ECS service: '.$e->getMessage());
}
}

+ Here is the call graph for this function:


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