ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilSearchAppEventListener Class Reference

Update search command queue from Services/Object events. More...

+ Inheritance diagram for ilSearchAppEventListener:
+ Collaboration diagram for ilSearchAppEventListener:

Static Public Member Functions

static handleEvent ($a_component, $a_event, $a_params)
 Handle an event in a listener.

Static Protected Member Functions

static storeElement ($a_command, $a_params)

Detailed Description

Update search command queue from Services/Object events.

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

Definition at line 37 of file class.ilSearchAppEventListener.php.

Member Function Documentation

static ilSearchAppEventListener::handleEvent (   $a_component,
  $a_event,
  $a_params 
)
static

Handle an event in a listener.

Parameters
string$a_componentcomponent, e.g. "Services/User"
string$a_eventevent e.g. "createUser", "updateUser", "deleteUser", ...
array$a_parameterparameter array (assoc), array("name" => ..., "phone_office" => ...)

Implements ilAppEventListener.

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

References $command, $type, ilObject\_lookupType(), ilSearchCommandQueueElement\CREATE, ilSearchCommandQueueElement\DELETE, ilSearchCommandQueueElement\RESET, and storeElement().

{
// only for files in the moment
if(!isset($a_params['obj_type']))
{
$type = ilObject::_lookupType($a_params['obj_id']);
}
else
{
$type = $a_params['obj_type'];
}
if($type != 'file' and
$type != 'htlm')
{
return;
}
switch($a_component)
{
case 'Services/Object':
switch($a_event)
{
case 'update':
break;
case 'create':
break;
case 'toTrash':
break;
case 'delete':
break;
case 'undelete':
break;
default:
return true;
}
return true;
}
}

+ Here is the call graph for this function:

static ilSearchAppEventListener::storeElement (   $a_command,
  $a_params 
)
staticprotected

Definition at line 100 of file class.ilSearchAppEventListener.php.

References $ilLog, ilObject\_lookupType(), and ilSearchCommandQueue\factory().

Referenced by handleEvent().

{
global $ilLog;
if(!$a_command)
{
return false;
}
if(!isset($a_params['obj_id']) or !$a_params['obj_id'])
{
return false;
}
if(!isset($a_params['obj_type']) or !$a_params['obj_type'])
{
$a_params['obj_type'] = ilObject::_lookupType($a_params['obj_id']);
}
$ilLog->write(__METHOD__.': Handling new command: '.$a_command.' for type '.$a_params['obj_type']);
$element = new ilSearchCommandQueueElement();
$element->setObjId($a_params['obj_id']);
$element->setObjType($a_params['obj_type']);
$element->setCommand($a_command);
ilSearchCommandQueue::factory()->store($element);
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


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