ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilMailLuceneSearcher Class Reference
+ Collaboration diagram for ilMailLuceneSearcher:

Public Member Functions

 __construct (ilLuceneQueryParser $query_parser, ilMailSearchResult $result)
 
 search ($user_id, $mail_folder_id)
 

Protected Attributes

 $query_parser
 
 $result
 
 $settings
 

Detailed Description

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

Definition at line 9 of file class.ilMailLuceneSearcher.php.

Constructor & Destructor Documentation

◆ __construct()

ilMailLuceneSearcher::__construct ( ilLuceneQueryParser  $query_parser,
ilMailSearchResult  $result 
)

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

References $DIC, $query_parser, $result, and settings().

30  {
31  global $DIC;
32 
33  $this->settings = $DIC->settings();
34 
35  $this->query_parser = $query_parser;
36  $this->result = $result;
37  }
settings()
Definition: settings.php:2
global $DIC
Definition: saml.php:7
+ Here is the call graph for this function:

Member Function Documentation

◆ search()

ilMailLuceneSearcher::search (   $user_id,
  $mail_folder_id 
)
Parameters
int$user_id
int$mail_folder_id
Exceptions
Exception

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

References $parser, $xml, ilRpcClientFactory\factory(), ilLoggerFactory\getLogger(), and settings().

45  {
46  if (!$this->query_parser->getQuery()) {
47  throw new ilException('mail_search_query_missing');
48  }
49 
50  try {
51  include_once 'Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
52  $xml = ilRpcClientFactory::factory('RPCSearchHandler')->searchMail(
53  CLIENT_ID . '_' . $this->settings->get('inst_id', 0),
54  (int) $user_id,
55  (string) $this->query_parser->getQuery(),
56  (int) $mail_folder_id
57  );
58  } catch (Exception $e) {
59  require_once './Services/Logging/classes/public/class.ilLoggerFactory.php';
60  ilLoggerFactory::getLogger('mail')->critical($e->getMessage());
61  throw $e;
62  }
63 
64  include_once 'Services/Mail/classes/class.ilMailSearchLuceneResultParser.php';
65  $parser = new ilMailSearchLuceneResultParser($this->result, $xml);
66  $parser->parse();
67  }
settings()
Definition: settings.php:2
static factory($a_package, $a_timeout=0)
Creates an ilRpcClient instance to our ilServer.
$parser
Definition: BPMN2Parser.php:23
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:

Field Documentation

◆ $query_parser

ilMailLuceneSearcher::$query_parser
protected

Definition at line 14 of file class.ilMailLuceneSearcher.php.

Referenced by __construct().

◆ $result

ilMailLuceneSearcher::$result
protected

Definition at line 19 of file class.ilMailLuceneSearcher.php.

Referenced by __construct().

◆ $settings

ilMailLuceneSearcher::$settings
protected

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


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