ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilLuceneIndexer Class Reference
+ Inheritance diagram for ilLuceneIndexer:
+ Collaboration diagram for ilLuceneIndexer:

Public Member Functions

 getId ()
 Get id. More...
 
 getTitle ()
 Get title. More...
 
 getDescription ()
 Get description. More...
 
 getDefaultScheduleType ()
 Get schedule type. More...
 
 getDefaultScheduleValue ()
 Get schedule value. More...
 
 hasAutoActivation ()
 Is to be activated on "installation". More...
 
 hasFlexibleSchedule ()
 Can the schedule be configured? More...
 
 run ()
 Run job. More...
 
- Public Member Functions inherited from ilCronJob
 isActive ($a_ts_last_run, $a_schedule_type, $a_schedule_value, $a_manual=false)
 Is job currently active? More...
 
 getScheduleType ()
 Get current schedule type (if flexible) More...
 
 getScheduleValue ()
 Get current schedule value (if flexible) More...
 
 setSchedule ($a_type, $a_value)
 Update current schedule (if flexible) More...
 
 getValidScheduleTypes ()
 Get all available schedule types. More...
 
 getTitle ()
 Get title. More...
 
 getDescription ()
 Get description. More...
 
 isManuallyExecutable ()
 Defines whether or not a cron job can be started manually. More...
 
 hasCustomSettings ()
 Has cron job any custom setting which can be edited? More...
 
 addCustomSettingsToForm (ilPropertyFormGUI $a_form)
 Add custom settings to form. More...
 
 saveCustomSettings (ilPropertyFormGUI $a_form)
 Save custom settings. More...
 
 addToExternalSettingsForm ($a_form_id, array &$a_fields, $a_is_active)
 Add external settings to form. More...
 
 activationWasToggled ($a_currently_active)
 Cron job status was changed. More...
 
 getId ()
 Get id. More...
 
 hasAutoActivation ()
 Is to be activated on "installation". More...
 
 hasFlexibleSchedule ()
 Can the schedule be configured? More...
 
 getDefaultScheduleType ()
 Get schedule type. More...
 
 getDefaultScheduleValue ()
 Get schedule value. More...
 
 run ()
 Run job. More...
 

Static Public Member Functions

static updateLuceneIndex ($a_obj_ids)
 Update lucene index. More...
 

Protected Attributes

 $timeout = 60
 

Additional Inherited Members

- Data Fields inherited from ilCronJob
const SCHEDULE_TYPE_DAILY = 1
 
const SCHEDULE_TYPE_IN_MINUTES = 2
 
const SCHEDULE_TYPE_IN_HOURS = 3
 
const SCHEDULE_TYPE_IN_DAYS = 4
 
const SCHEDULE_TYPE_WEEKLY = 5
 
const SCHEDULE_TYPE_MONTHLY = 6
 
const SCHEDULE_TYPE_QUARTERLY = 7
 
const SCHEDULE_TYPE_YEARLY = 8
 
- Protected Member Functions inherited from ilCronJob
 checkSchedule ($a_ts_last_run, $a_schedule_type, $a_schedule_value)
 

Detailed Description

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

Member Function Documentation

◆ getDefaultScheduleType()

ilLuceneIndexer::getDefaultScheduleType ( )

Get schedule type.

Returns
int

Reimplemented from ilCronJob.

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

42 {
44 }
const SCHEDULE_TYPE_DAILY

References ilCronJob\SCHEDULE_TYPE_DAILY.

◆ getDefaultScheduleValue()

ilLuceneIndexer::getDefaultScheduleValue ( )

Get schedule value.

Returns
int|array

Reimplemented from ilCronJob.

Definition at line 46 of file class.ilLuceneIndexer.php.

47 {
48 return;
49 }

◆ getDescription()

ilLuceneIndexer::getDescription ( )

Get description.

Returns
string

Reimplemented from ilCronJob.

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

35 {
36 global $lng;
37
38 return $lng->txt("cron_lucene_index_info");
39 }
global $lng
Definition: privfeed.php:17

References $lng.

◆ getId()

ilLuceneIndexer::getId ( )

Get id.

Returns
string

Reimplemented from ilCronJob.

Definition at line 22 of file class.ilLuceneIndexer.php.

23 {
24 return "src_lucene_indexer";
25 }

◆ getTitle()

ilLuceneIndexer::getTitle ( )

Get title.

Returns
string

Reimplemented from ilCronJob.

Definition at line 27 of file class.ilLuceneIndexer.php.

28 {
29 global $lng;
30
31 return $lng->txt("cron_lucene_index");
32 }

References $lng.

◆ hasAutoActivation()

ilLuceneIndexer::hasAutoActivation ( )

Is to be activated on "installation".

Returns
boolean

Reimplemented from ilCronJob.

Definition at line 51 of file class.ilLuceneIndexer.php.

52 {
53 return false;
54 }

◆ hasFlexibleSchedule()

ilLuceneIndexer::hasFlexibleSchedule ( )

Can the schedule be configured?

Returns
boolean

Reimplemented from ilCronJob.

Definition at line 56 of file class.ilLuceneIndexer.php.

57 {
58 return true;
59 }

◆ run()

ilLuceneIndexer::run ( )

Run job.

Returns
ilCronJobResult

Reimplemented from ilCronJob.

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

62 {
63 global $ilSetting;
64
66 $error_message = null;
67
68 try {
69 include_once './Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
70 ilRpcClientFactory::factory('RPCIndexHandler', 60)->index(
71 CLIENT_ID . '_' . $ilSetting->get('inst_id', 0),
72 true
73 );
74 } catch (Exception $e) {
75 $error_message = $e->getMessage();
76
77 if ($e instanceof ilRpcClientException && $e->getCode() == 28) {
78 ilLoggerFactory::getLogger('src')->info('Connection timed out after ' . $this->timeout . ' seconds. ' .
79 'Indexing will continoue without a proper return message. View ilServer log if you think there are problems while indexing.');
80 $error_message = null;
81 }
82 }
83
85 if ($error_message) {
86 // #16035 - currently no way to discern the severity of the exception
87 $result->setMessage($error_message);
89 } else {
91 }
92 $result->setStatus($status);
93 return $result;
94 }
$result
Cron job result data container.
static getLogger($a_component_id)
Get component logger.
Class ilRpcClientException.
static factory($a_package, $a_timeout=0)
Creates an ilRpcClient instance to our ilServer.
global $ilSetting
Definition: privfeed.php:17

References $ilSetting, $result, ilRpcClientFactory\factory(), ilLoggerFactory\getLogger(), ilCronJobResult\STATUS_FAIL, ilCronJobResult\STATUS_NO_ACTION, and ilCronJobResult\STATUS_OK.

+ Here is the call graph for this function:

◆ updateLuceneIndex()

static ilLuceneIndexer::updateLuceneIndex (   $a_obj_ids)
static

Update lucene index.

Parameters
int[]$a_obj_ids
Returns
bool

Definition at line 102 of file class.ilLuceneIndexer.php.

103 {
104 global $ilSetting;
105 include_once './Services/Search/classes/class.ilSearchSettings.php';
106 if (!ilSearchSettings::getInstance()->isLuceneUserSearchEnabled()) {
107 return false;
108 }
109
110 try {
111 ilLoggerFactory::getLogger('src')->info('Lucene update index call BEGIN --- ');
112
113 include_once './Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
114 ilRpcClientFactory::factory('RPCIndexHandler', 1)->indexObjects(
115 CLIENT_ID . '_' . $ilSetting->get('inst_id', 0),
116 $a_obj_ids
117 );
118 ilLoggerFactory::getLogger('src')->info('Lucene update index call --- END');
119 } catch (Exception $e) {
120 $error_message = $e->getMessage();
121 ilLoggerFactory::getLogger('src')->error($error_message);
122 return false;
123 }
124
125 return true;
126 }

References $ilSetting, ilRpcClientFactory\factory(), ilSearchSettings\getInstance(), and ilLoggerFactory\getLogger().

Referenced by ilPersonalProfileGUI\saveProfile(), and ilPersonalProfileGUI\savePublicProfile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $timeout

ilLuceneIndexer::$timeout = 60
protected

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


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