ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilECSCmsCourseCommandQueueHandler Class Reference

Description of class. More...

+ Inheritance diagram for ilECSCmsCourseCommandQueueHandler:
+ Collaboration diagram for ilECSCmsCourseCommandQueueHandler:

Public Member Functions

 __construct (ilECSSetting $server)
 Constructor.
 getServer ()
 Get server.
 getMid ()
 Get mid.
 checkAllocationActivation (ilECSSetting $server, $a_content_id)
 Check if course allocation is activated for one recipient of the.
 handleCreate (ilECSSetting $server, $a_content_id)
 Handle create.
 handleDelete (ilECSSetting $server, $a_content_id)
 Handle delete.
 handleUpdate (ilECSSetting $server, $a_content_id)
 Handle update.

Protected Member Functions

 doUpdate ($a_content_id, $course)
 Perform update.

Private Member Functions

 readCourse (ilECSSetting $server, $a_content_id, $a_details=false)
 Read course from ecs.

Private Attributes

 $server = null
 $mid = 0

Detailed Description

Description of class.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 15 of file class.ilECSCmsCourseCommandQueueHandler.php.

Constructor & Destructor Documentation

ilECSCmsCourseCommandQueueHandler::__construct ( ilECSSetting  $server)

Constructor.

Definition at line 24 of file class.ilECSCmsCourseCommandQueueHandler.php.

References $server.

{
$this->server = $server;
}

Member Function Documentation

ilECSCmsCourseCommandQueueHandler::checkAllocationActivation ( ilECSSetting  $server,
  $a_content_id 
)

Check if course allocation is activated for one recipient of the.

Parameters
ilECSSetting$server
type$a_content_id

Definition at line 52 of file class.ilECSCmsCourseCommandQueueHandler.php.

References $GLOBALS, ilECSParticipantSetting\getInstance(), ilECSNodeMappingSettings\getInstanceByServerMid(), getMid(), and getServer().

Referenced by handleCreate(), and handleUpdate().

{
try
{
include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseConnector.php';
$crs_reader = new ilECSCourseConnector($server);
$details = $crs_reader->getCourse($a_content_id,true);
$this->mid = $details->getMySender();
// Check if import is enabled
include_once './Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
$part = ilECSParticipantSetting::getInstance($this->getServer()->getServerId(), $this->getMid());
if(!$part->isImportEnabled())
{
$GLOBALS['ilLog']->write(__METHOD__.': Import disabled for mid '.$this->getMid());
return false;
}
// Check course allocation setting
include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
$this->getServer()->getServerId(),
$this->getMid()
);
$enabled = $gl_settings->isCourseAllocationEnabled();
if(!$enabled)
{
$GLOBALS['ilLog']->write(__METHOD__.': Course allocation disabled for '.$this->getMid());
}
return $enabled;
}
{
$GLOBALS['ilLog']->write(__METHOD__.': Reading course details failed with message '. $e->getMessage());
return false;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilECSCmsCourseCommandQueueHandler::doUpdate (   $a_content_id,
  $course 
)
protected

Perform update.

Parameters
type$a_content_id
type$course

Definition at line 163 of file class.ilECSCmsCourseCommandQueueHandler.php.

References $GLOBALS, and getServer().

Referenced by handleCreate(), and handleUpdate().

{
$GLOBALS['ilLog']->write(__METHOD__.': Starting course creation/update');
include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseCreationHandler.php';
$creation_handler = new ilECSCourseCreationHandler($this->getServer(),$this->mid);
$creation_handler->handle($a_content_id, $course);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilECSCmsCourseCommandQueueHandler::getMid ( )

Get mid.

Returns
type

Definition at line 42 of file class.ilECSCmsCourseCommandQueueHandler.php.

References $mid.

Referenced by checkAllocationActivation().

{
return $this->mid;
}

+ Here is the caller graph for this function:

ilECSCmsCourseCommandQueueHandler::getServer ( )

Get server.

Returns
ilECSServerSetting

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

References $server.

Referenced by checkAllocationActivation(), and doUpdate().

{
return $this->server;
}

+ Here is the caller graph for this function:

ilECSCmsCourseCommandQueueHandler::handleCreate ( ilECSSetting  $server,
  $a_content_id 
)

Handle create.

Parameters
ilECSSetting$server
type$a_content_id

Implements ilECSCommandQueueHandler.

Definition at line 95 of file class.ilECSCmsCourseCommandQueueHandler.php.

References $GLOBALS, checkAllocationActivation(), doUpdate(), and readCourse().

{
include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseConnector.php';
if(!$this->checkAllocationActivation($server, $a_content_id))
{
return true;
}
try
{
$course = $this->readCourse($server,$a_content_id);
$GLOBALS['ilLog']->write(__METHOD__.': '. print_r($course,true));
$this->doUpdate($a_content_id, $course);
return true;
}
{
$GLOBALS['ilLog']->write(__METHOD__.': Course creation failed with mesage ' . $e->getMessage());
return false;
}
return true;
}

+ Here is the call graph for this function:

ilECSCmsCourseCommandQueueHandler::handleDelete ( ilECSSetting  $server,
  $a_content_id 
)

Handle delete.

Parameters
ilECSSetting$server
type$a_content_id

Implements ilECSCommandQueueHandler.

Definition at line 125 of file class.ilECSCmsCourseCommandQueueHandler.php.

{
// nothing todo
return true;
}
ilECSCmsCourseCommandQueueHandler::handleUpdate ( ilECSSetting  $server,
  $a_content_id 
)

Handle update.

Parameters
ilECSSetting$server
type$a_content_id

Implements ilECSCommandQueueHandler.

Definition at line 136 of file class.ilECSCmsCourseCommandQueueHandler.php.

References $GLOBALS, checkAllocationActivation(), doUpdate(), and readCourse().

{
if(!$this->checkAllocationActivation($server, $a_content_id))
{
return true;
}
try
{
$course = $this->readCourse($server,$a_content_id);
$this->doUpdate($a_content_id, $course);
return true;
}
{
$GLOBALS['ilLog']->write(__METHOD__.': Course creation failed with mesage ' . $e->getMessage());
return false;
}
return true;
}

+ Here is the call graph for this function:

ilECSCmsCourseCommandQueueHandler::readCourse ( ilECSSetting  $server,
  $a_content_id,
  $a_details = false 
)
private

Read course from ecs.

Returns
boolean

Definition at line 177 of file class.ilECSCmsCourseCommandQueueHandler.php.

Referenced by handleCreate(), and handleUpdate().

{
try
{
include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseConnector.php';
$crs_reader = new ilECSCourseConnector($server);
return $crs_reader->getCourse($a_content_id,$a_details);
}
{
throw $e;
}
}

+ Here is the caller graph for this function:

Field Documentation

ilECSCmsCourseCommandQueueHandler::$mid = 0
private

Definition at line 18 of file class.ilECSCmsCourseCommandQueueHandler.php.

Referenced by getMid().

ilECSCmsCourseCommandQueueHandler::$server = null
private

Definition at line 17 of file class.ilECSCmsCourseCommandQueueHandler.php.

Referenced by __construct(), and getServer().


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