ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilECSEContentReader Class Reference
+ Collaboration diagram for ilECSEContentReader:

Public Member Functions

 __construct ($a_econtent_id=0)
 Constructor.
 getEContent ()
 get resources
 read ()
 Read.

Protected Attributes

 $log
 $settings = null
 $connector = null
 $econtent = array()
 $econtent_id = 0

Detailed Description

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 32 of file class.ilECSEContentReader.php.

Constructor & Destructor Documentation

ilECSEContentReader::__construct (   $a_econtent_id = 0)

Constructor.

public

Exceptions
ilECSConnectorException

Definition at line 47 of file class.ilECSEContentReader.php.

References $ilLog, and ilECSSettings\_getInstance().

{
global $ilLog;
include_once('Services/WebServices/ECS/classes/class.ilECSSettings.php');
include_once('Services/WebServices/ECS/classes/class.ilECSConnector.php');
include_once('Services/WebServices/ECS/classes/class.ilECSConnectorException.php');
include_once('Services/WebServices/ECS/classes/class.ilECSEContent.php');
include_once('Services/WebServices/ECS/classes/class.ilECSReaderException.php');
$this->settings = ilECSSettings::_getInstance();
$this->connector = new ilECSConnector();
$this->log = $ilLog;
$this->econtent_id = $a_econtent_id;
}

+ Here is the call graph for this function:

Member Function Documentation

ilECSEContentReader::getEContent ( )

get resources

public

Definition at line 70 of file class.ilECSEContentReader.php.

{
return $this->econtent ? $this->econtent : array();
}
ilECSEContentReader::read ( )

Read.

public

Returns
bool false in case og HTTP 404
Exceptions
ilECSConnectorException,ilECSReaderException

Definition at line 82 of file class.ilECSEContentReader.php.

References $econtent, $ilLog, $res, and ilECSConnector\HTTP_CODE_NOT_FOUND.

Referenced by ilObjCourseGUI\fillECSExportSettings().

{
global $ilLog;
try
{
$res = $this->connector->getResources($this->econtent_id);
{
return false;
}
if(!is_array($res->getResult()))
{
$ilLog->write(__METHOD__.': Error parsing result. Expected result of type array.');
throw new ilECSReaderException('Error parsing query');
}
foreach($res->getResult() as $econtent)
{
$tmp_content = new ilECSEContent();
$tmp_content->loadFromJSON($econtent);
$this->econtent[] = $tmp_content;
}
return true;
}
{
$ilLog->write(__METHOD__.': Error connecting to ECS server. '.$e->getMessage());
throw $e;
}
{
$ilLog->write(__METHOD__.': Error reading EContent. '.$e->getMessage());
throw $e;
}
}

+ Here is the caller graph for this function:

Field Documentation

ilECSEContentReader::$connector = null
protected

Definition at line 36 of file class.ilECSEContentReader.php.

ilECSEContentReader::$econtent = array()
protected

Definition at line 38 of file class.ilECSEContentReader.php.

Referenced by read().

ilECSEContentReader::$econtent_id = 0
protected

Definition at line 39 of file class.ilECSEContentReader.php.

ilECSEContentReader::$log
protected

Definition at line 34 of file class.ilECSEContentReader.php.

ilECSEContentReader::$settings = null
protected

Definition at line 35 of file class.ilECSEContentReader.php.


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