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

Public Member Functions

 ilLuceneRPCAdapter ()
 setMode ($a_mode)
 getMode ()
 setFiles (&$files)
getFiles ()
 setHTLMs (&$htlms)
getHTLMs ()
 setQueryString ($a_str)
 getQueryString ()
 setPageNumber ($a_number)
 getPageNumber ()
 setSearchFilter ($a_filter)
 getSearchFilter ()
 __getClientId ()
 Create a unique client id.
 send ()
 Send message to remote rpc server and get response.
 __prepareQueryParams ()
 __preparePingParams ()
 __prepareIndexFileParams ()
 __prepareIndexHTLMParams ()
 __prepareFlushIndex ()
 setResultIds ($a_ids)
 set result ids
 getResultIds ()
 get result ids
- Public Member Functions inherited from ilRPCServerAdapter
 ilRPCServerAdapter ()
 setResponseTimeout ($a_response_timeout)
 __checkPear ()
 __initClient ()
 Create RPC client object.
 __initMessage ($a_message_name, $params)
 Create RPC message object.

Data Fields

 $mode = ''
 $files = array()
 $query_str = ''
 $page_number
 $filter = ''
- Data Fields inherited from ilRPCServerAdapter
 $response_timeout = RPC_TIMEOUT
 $log = null
 $db = null
 $err = null
 $settings_obj = null
 $rpc_client = null
 $rpc_message = null

Protected Member Functions

 __prepareSearchParams ()
 Prepare search parameters.
 __prepareHighlightParams ()
 Prepare search parameters.
 __prepareRefreshSettingsParams ()
 getClientKey ()
 Get client key.

Detailed Description

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

Member Function Documentation

ilLuceneRPCAdapter::__getClientId ( )

Create a unique client id.

Since the lucene index can be used from multiple ILIAS-Installations it must be unique over installations

Returns
string client_identifier

Definition at line 105 of file class.ilLuceneRPCAdapter.php.

Referenced by __prepareFlushIndex(), __prepareIndexFileParams(), __prepareIndexHTLMParams(), __preparePingParams(), and __prepareQueryParams().

{
global $ilias;
// TODO: handle problem if nic_key isn't set
return $ilias->getSetting('nic_key').'_'.CLIENT_ID;
}

+ Here is the caller graph for this function:

ilLuceneRPCAdapter::__prepareFlushIndex ( )

Definition at line 213 of file class.ilLuceneRPCAdapter.php.

References __getClientId(), ilRPCServerAdapter\__initMessage(), and ilRPCServerAdapter\setResponseTimeout().

Referenced by send().

{
$this->setResponseTimeout(5);
$this->__initMessage('Indexer.ilClearIndex',array(new XML_RPC_Value($this->__getClientId(),"string")));
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLuceneRPCAdapter::__prepareHighlightParams ( )
protected

Prepare search parameters.

Definition at line 239 of file class.ilLuceneRPCAdapter.php.

References ilRPCServerAdapter\__initMessage(), getClientKey(), getQueryString(), getResultIds(), and ilRPCServerAdapter\setResponseTimeout().

Referenced by send().

{
$this->setResponseTimeout(5);
$objIds = array();
foreach($this->getResultIds() as $obj_id)
{
$objIds[] = new XML_RPC_Value($obj_id,'int');
}
$this->__initMessage('RPCSearchHandler.highlight',array(
new XML_RPC_Value($this->getClientKey(),'string'),
new XML_RPC_VAlue($objIds,'array'),
new XML_RPC_Value($this->getQueryString(),'string')));
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLuceneRPCAdapter::__prepareIndexFileParams ( )

Definition at line 185 of file class.ilLuceneRPCAdapter.php.

References __getClientId(), ilRPCServerAdapter\__initMessage(), getFiles(), and ilRPCServerAdapter\setResponseTimeout().

Referenced by send().

{
$this->setResponseTimeout(5);
foreach($this->getFiles() as $obj_id => $fname)
{
$struct[$obj_id] = new XML_RPC_Value($fname,"string");
}
$params = array(new XML_RPC_Value($this->__getClientId(),"string"),
new XML_RPC_Value($struct,"struct"));
$this->__initMessage('Indexer.ilFileIndexer',$params);
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLuceneRPCAdapter::__prepareIndexHTLMParams ( )

Definition at line 200 of file class.ilLuceneRPCAdapter.php.

References __getClientId(), ilRPCServerAdapter\__initMessage(), getHTLMs(), and ilRPCServerAdapter\setResponseTimeout().

Referenced by send().

{
$this->setResponseTimeout(5);
foreach($this->getHTLMs() as $obj_id => $fname)
{
$struct[$obj_id] = new XML_RPC_Value($fname,"string");
}
$this->__initMessage('Indexer.ilHTLMIndexer',array(new XML_RPC_Value($this->__getClientId(),"string"),
new XML_RPC_Value($struct,"struct")));
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLuceneRPCAdapter::__preparePingParams ( )

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

References __getClientId(), ilRPCServerAdapter\__initMessage(), and ilRPCServerAdapter\setResponseTimeout().

Referenced by send().

{
$this->setResponseTimeout(5);
$this->__initMessage('Searcher.ilPing',array(new XML_RPC_Value($this->__getClientId(),"string")));
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLuceneRPCAdapter::__prepareQueryParams ( )

Definition at line 162 of file class.ilLuceneRPCAdapter.php.

References $filter, __getClientId(), ilRPCServerAdapter\__initMessage(), getQueryString(), getSearchFilter(), and ilRPCServerAdapter\setResponseTimeout().

Referenced by send().

{
$this->setResponseTimeout(5);
$filter = array();
foreach($this->getSearchFilter() as $obj_type)
{
$filter[] = new XML_RPC_Value($obj_type,'string');
}
$this->__initMessage('Searcher.ilSearch',array(new XML_RPC_Value($this->__getClientId(),"string"),
new XML_RPC_Value($this->getQueryString(),"string"),
new XML_RPC_Value($filter,'array')));
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLuceneRPCAdapter::__prepareRefreshSettingsParams ( )
protected

Definition at line 257 of file class.ilLuceneRPCAdapter.php.

References ilRPCServerAdapter\__initMessage(), getClientKey(), and ilRPCServerAdapter\setResponseTimeout().

Referenced by send().

{
$this->setResponseTimeout(5);
$this->__initMessage('RPCAdministration.refreshSettings',array(
new XML_RPC_Value($this->getClientKey(),'string')));
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLuceneRPCAdapter::__prepareSearchParams ( )
protected

Prepare search parameters.

Definition at line 225 of file class.ilLuceneRPCAdapter.php.

References ilRPCServerAdapter\__initMessage(), getClientKey(), getPageNumber(), getQueryString(), and ilRPCServerAdapter\setResponseTimeout().

Referenced by send().

{
$this->setResponseTimeout(5);
$this->__initMessage('RPCSearchHandler.search',array(
new XML_RPC_Value($this->getClientKey(),'string'),
new XML_RPC_Value($this->getQueryString(),'string'),
new XML_RPC_Value($this->getPageNumber(),'int')));
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLuceneRPCAdapter::getClientKey ( )
protected

Get client key.

Returns
string client key

Definition at line 290 of file class.ilLuceneRPCAdapter.php.

References $ilSetting.

Referenced by __prepareHighlightParams(), __prepareRefreshSettingsParams(), and __prepareSearchParams().

{
global $ilSetting;
return CLIENT_ID.'_'.$ilSetting->get('inst_id',0);
}

+ Here is the caller graph for this function:

& ilLuceneRPCAdapter::getFiles ( )

Definition at line 61 of file class.ilLuceneRPCAdapter.php.

Referenced by __prepareIndexFileParams().

{
return $this->files ? $this->files : array();
}

+ Here is the caller graph for this function:

& ilLuceneRPCAdapter::getHTLMs ( )

Definition at line 69 of file class.ilLuceneRPCAdapter.php.

Referenced by __prepareIndexHTLMParams().

{
return $this->htlms;
}

+ Here is the caller graph for this function:

ilLuceneRPCAdapter::getMode ( )

Definition at line 53 of file class.ilLuceneRPCAdapter.php.

References $mode.

Referenced by send().

{
return $this->mode;
}

+ Here is the caller graph for this function:

ilLuceneRPCAdapter::getPageNumber ( )

Definition at line 86 of file class.ilLuceneRPCAdapter.php.

References $page_number.

Referenced by __prepareSearchParams().

{
}

+ Here is the caller graph for this function:

ilLuceneRPCAdapter::getQueryString ( )

Definition at line 78 of file class.ilLuceneRPCAdapter.php.

References $query_str.

Referenced by __prepareHighlightParams(), __prepareQueryParams(), and __prepareSearchParams().

{
}

+ Here is the caller graph for this function:

ilLuceneRPCAdapter::getResultIds ( )

get result ids

Returns

Definition at line 280 of file class.ilLuceneRPCAdapter.php.

Referenced by __prepareHighlightParams().

{
return $this->result_ids ? $this->result_ids : array();
}

+ Here is the caller graph for this function:

ilLuceneRPCAdapter::getSearchFilter ( )

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

Referenced by __prepareQueryParams().

{
return $this->filter ? $this->filter : array();
}

+ Here is the caller graph for this function:

ilLuceneRPCAdapter::ilLuceneRPCAdapter ( )

Definition at line 44 of file class.ilLuceneRPCAdapter.php.

References ilRPCServerAdapter\ilRPCServerAdapter().

+ Here is the call graph for this function:

ilLuceneRPCAdapter::send ( )

Send message to remote rpc server and get response.

Returns
object result object. Type is depend on the calles method

protected

Reimplemented from ilRPCServerAdapter.

Definition at line 115 of file class.ilLuceneRPCAdapter.php.

References ilRPCServerAdapter\__initClient(), __prepareFlushIndex(), __prepareHighlightParams(), __prepareIndexFileParams(), __prepareIndexHTLMParams(), __preparePingParams(), __prepareQueryParams(), __prepareRefreshSettingsParams(), __prepareSearchParams(), and getMode().

{
$this->__initClient();
switch($this->getMode())
{
case 'ping':
break;
case 'file':
break;
case 'query':
break;
case 'htlm':
break;
case 'flush':
break;
// BEGIN PATCH Lucene search
case 'search':
break;
case 'highlight':
break;
case 'refreshSettings':
break;
// END PATCH Lucene Search
default:
$this->log->write('ilLuceneRPCHandler(): No valid mode given');
return false;
}
return parent::send();
}

+ Here is the call graph for this function:

ilLuceneRPCAdapter::setFiles ( $files)

Definition at line 57 of file class.ilLuceneRPCAdapter.php.

References $files.

{
$this->files =& $files;
}
ilLuceneRPCAdapter::setHTLMs ( $htlms)

Definition at line 65 of file class.ilLuceneRPCAdapter.php.

{
$this->htlms = $htlms;
}
ilLuceneRPCAdapter::setMode (   $a_mode)

Definition at line 49 of file class.ilLuceneRPCAdapter.php.

{
$this->mode = $a_mode;
}
ilLuceneRPCAdapter::setPageNumber (   $a_number)

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

{
$this->page_number = $a_number;
}
ilLuceneRPCAdapter::setQueryString (   $a_str)

Definition at line 74 of file class.ilLuceneRPCAdapter.php.

{
$this->query_str = $a_str;
}
ilLuceneRPCAdapter::setResultIds (   $a_ids)

set result ids

Parameters
arrayarray of obj ids
Returns

Definition at line 271 of file class.ilLuceneRPCAdapter.php.

{
$this->result_ids = $a_ids;
}
ilLuceneRPCAdapter::setSearchFilter (   $a_filter)

Definition at line 91 of file class.ilLuceneRPCAdapter.php.

{
$this->filter = $a_filter;
}

Field Documentation

ilLuceneRPCAdapter::$files = array()

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

Referenced by setFiles().

ilLuceneRPCAdapter::$filter = ''

Definition at line 41 of file class.ilLuceneRPCAdapter.php.

Referenced by __prepareQueryParams().

ilLuceneRPCAdapter::$mode = ''

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

Referenced by getMode().

ilLuceneRPCAdapter::$page_number

Definition at line 40 of file class.ilLuceneRPCAdapter.php.

Referenced by getPageNumber().

ilLuceneRPCAdapter::$query_str = ''

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

Referenced by getQueryString().


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