ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilMailLuceneSearcher.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
10 {
14  protected $query_parser;
15 
19  protected $result;
20 
24  protected $settings;
25 
30  {
31  global $DIC;
32 
33  $this->settings = $DIC->settings();
34 
35  $this->query_parser = $query_parser;
36  $this->result = $result;
37  }
38 
44  public function search($user_id, $mail_folder_id)
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  }
68 }
settings()
Definition: settings.php:2
search($user_id, $mail_folder_id)
__construct(ilLuceneQueryParser $query_parser, ilMailSearchResult $result)
global $DIC
Definition: saml.php:7
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.