ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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...
 

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 36 of file class.ilLuceneIndexer.php.

37 {
39 }
const SCHEDULE_TYPE_DAILY

References ilCronJob\SCHEDULE_TYPE_DAILY.

◆ getDefaultScheduleValue()

ilLuceneIndexer::getDefaultScheduleValue ( )

Get schedule value.

Returns
int|array

Reimplemented from ilCronJob.

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

42 {
43 return;
44 }

◆ getDescription()

ilLuceneIndexer::getDescription ( )

Get description.

Returns
string

Reimplemented from ilCronJob.

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

30 {
31 global $lng;
32
33 return $lng->txt("cron_lucene_index_info");
34 }
global $lng
Definition: privfeed.php:40

References $lng.

◆ getId()

ilLuceneIndexer::getId ( )

Get id.

Returns
string

Reimplemented from ilCronJob.

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

18 {
19 return "src_lucene_indexer";
20 }

◆ getTitle()

ilLuceneIndexer::getTitle ( )

Get title.

Returns
string

Reimplemented from ilCronJob.

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

23 {
24 global $lng;
25
26 return $lng->txt("cron_lucene_index");
27 }

References $lng.

◆ hasAutoActivation()

ilLuceneIndexer::hasAutoActivation ( )

Is to be activated on "installation".

Returns
boolean

Reimplemented from ilCronJob.

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

47 {
48 return false;
49 }

◆ hasFlexibleSchedule()

ilLuceneIndexer::hasFlexibleSchedule ( )

Can the schedule be configured?

Returns
boolean

Reimplemented from ilCronJob.

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

52 {
53 return true;
54 }

◆ run()

ilLuceneIndexer::run ( )

Run job.

Returns
ilCronJobResult

Reimplemented from ilCronJob.

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

57 {
58 global $ilSetting;
59
61 $error_message = null;
62
63 try
64 {
65 include_once './Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
66 ilRpcClientFactory::factory('RPCIndexHandler')->index(
67 CLIENT_ID.'_'.$ilSetting->get('inst_id',0),
68 true
69 );
70 }
72 {
73 $error_message = $e->getMessage();
74 }
75 catch(Exception $e)
76 {
77 $error_message = $e->getMessage();
78 }
79
81 if($error_message)
82 {
83 // #16035 - currently no way to discern the severity of the exception
84 $result->setMessage($error_message);
86 }
87 else
88 {
90 }
91 $result->setStatus($status);
92 return $result;
93 }
$result
Cron job result data container.
static factory($a_package)
Create an XML_RPC2 client instance.
global $ilSetting
Definition: privfeed.php:40

References $ilSetting, $result, ilRpcClientFactory\factory(), 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
type$a_obj_ids

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

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

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:

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