ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilObjectSearchFactory.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
24 include_once 'Services/Search/classes/class.ilSearchSettings.php';
38 {
39 
46  public static function _getObjectSearchInstance($query_parser)
47  {
48  include_once './Services/Search/classes/class.ilSearchSettings.php';
49 
50  $search_settings = new ilSearchSettings();
51 
52  if ($search_settings->enabledIndex()) {
53  // FULLTEXT
54  include_once 'Services/Search/classes/Fulltext/class.ilFulltextObjectSearch.php';
55  return new ilFulltextObjectSearch($query_parser);
56  } else {
57  // LIKE
58  include_once 'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
59  return new ilLikeObjectSearch($query_parser);
60  }
61  }
62 
66  public static function getByTypeSearchInstance($a_object_type, $a_query_parser)
67  {
68  switch ($a_object_type) {
69  case 'wiki':
70  return self::_getWikiContentSearchInstance($a_query_parser);
71 
72  case 'frm':
73  return self::_getForumSearchInstance($a_query_parser);
74 
75  case 'lm':
76  return self::_getLMContentSearchInstance($a_query_parser);
77 
78  default:
79  return self::_getObjectSearchInstance($a_query_parser);
80  }
81  }
82 
89  public static function _getMetaDataSearchInstance($query_parser)
90  {
91  if (ilSearchSettings::getInstance()->enabledIndex()) {
92  include_once 'Services/Search/classes/Fulltext/class.ilFulltextMetaDataSearch.php';
93  return new ilFulltextMetaDataSearch($query_parser);
94  } else {
95  include_once 'Services/Search/classes/Like/class.ilLikeMetaDataSearch.php';
96  return new ilLikeMetaDataSearch($query_parser);
97  }
98  }
99 
106  public static function _getLMContentSearchInstance($query_parser)
107  {
108  if (ilSearchSettings::getInstance()->enabledIndex()) {
109  include_once 'Services/Search/classes/Fulltext/class.ilFulltextLMContentSearch.php';
110  return new ilFulltextLMContentSearch($query_parser);
111  } else {
112  include_once './Services/Search/classes/Like/class.ilLikeLMContentSearch.php';
113  return new ilLikeLMContentSearch($query_parser);
114  }
115  }
116 
123  public static function _getForumSearchInstance($query_parser)
124  {
125  if (ilSearchSettings::getInstance()->enabledIndex()) {
126  include_once 'Services/Search/classes/Fulltext/class.ilFulltextForumSearch.php';
127  return new ilFulltextForumSearch($query_parser);
128  } else {
129  include_once 'Services/Search/classes/Like/class.ilLikeForumSearch.php';
130  return new ilLikeForumSearch($query_parser);
131  }
132  }
133 
140  public static function _getGlossaryDefinitionSearchInstance($query_parser)
141  {
142  if (ilSearchSettings::getInstance()->enabledIndex()) {
143  include_once 'Services/Search/classes/Fulltext/class.ilFulltextGlossaryDefinitionSearch.php';
144  return new ilFulltextGlossaryDefinitionSearch($query_parser);
145  } else {
146  include_once 'Services/Search/classes/Like/class.ilLikeGlossaryDefinitionSearch.php';
147  return new ilLikeGlossaryDefinitionSearch($query_parser);
148  }
149  }
150 
157  public static function _getExerciseSearchInstance($query_parser)
158  {
159  if (ilSearchSettings::getInstance()->enabledIndex()) {
160  include_once 'Services/Search/classes/Fulltext/class.ilFulltextExerciseSearch.php';
161  return new ilFulltextExerciseSearch($query_parser);
162  } else {
163  include_once 'Services/Search/classes/Like/class.ilLikeExerciseSearch.php';
164  return new ilLikeExerciseSearch($query_parser);
165  }
166  }
167 
174  public static function _getMediacastSearchInstance($query_parser)
175  {
176  if (ilSearchSettings::getInstance()->enabledIndex()) {
177  include_once 'Services/Search/classes/Fulltext/class.ilFulltextMediaCastSearch.php';
178  return new ilFulltextMediaCastSearch($query_parser);
179  } else {
180  include_once 'Services/Search/classes/Like/class.ilLikeMediaCastSearch.php';
181  return new ilLikeMediaCastSearch($query_parser);
182  }
183  }
184 
191  public static function _getTestSearchInstance($query_parser)
192  {
193  if (ilSearchSettings::getInstance()->enabledIndex()) {
194  include_once 'Services/Search/classes/Fulltext/class.ilFulltextTestSearch.php';
195  return new ilFulltextTestSearch($query_parser);
196  } else {
197  include_once 'Services/Search/classes/Like/class.ilLikeTestSearch.php';
198  return new ilLikeTestSearch($query_parser);
199  }
200  }
201 
208  public static function _getMediaPoolSearchInstance($query_parser)
209  {
210  if (ilSearchSettings::getInstance()->enabledIndex()) {
211  include_once 'Services/Search/classes/Fulltext/class.ilFulltextMediaPoolSearch.php';
212  return new ilFulltextMediaPoolSearch($query_parser);
213  } else {
214  include_once 'Services/Search/classes/Like/class.ilLikeMediaPoolSearch.php';
215  return new ilLikeMediaPoolSearch($query_parser);
216  }
217  }
218 
225  public static function _getAdvancedSearchInstance($query_parser)
226  {
227  if (ilSearchSettings::getInstance()->enabledIndex()) {
228  include_once 'Services/Search/classes/Fulltext/class.ilFulltextAdvancedSearch.php';
229  return new ilFulltextAdvancedSearch($query_parser);
230  } else {
231  include_once './Services/Search/classes/Like/class.ilLikeAdvancedSearch.php';
232  return new ilLikeAdvancedSearch($query_parser);
233  }
234  }
235 
242  public static function _getWebresourceSearchInstance($query_parser)
243  {
244  if (ilSearchSettings::getInstance()->enabledIndex()) {
245  include_once 'Services/Search/classes/Fulltext/class.ilFulltextWebresourceSearch.php';
246  return new ilFulltextWebresourceSearch($query_parser);
247  } else {
248  include_once 'Services/Search/classes/Like/class.ilLikeWebresourceSearch.php';
249  return new ilLikeWebresourceSearch($query_parser);
250  }
251  }
252 
259  public static function _getUserSearchInstance($query_parser)
260  {
261  include_once 'Services/Search/classes/Like/class.ilLikeUserSearch.php';
262  return new ilLikeUserSearch($query_parser);
263  }
264 
271  public static function _getUserDefinedFieldSearchInstance($query_parser)
272  {
273  include_once 'Services/Search/classes/Like/class.ilLikeUserDefinedFieldSearch.php';
274  return new ilLikeUserDefinedFieldSearch($query_parser);
275  }
276 
277  public static function getUserMultiFieldSearchInstance($query_parser)
278  {
279  include_once './Services/Search/classes/Like/class.ilLikeUserMultiFieldSearch.php';
280  return new ilLikeUserMultiFieldSearch($query_parser);
281  }
282 
289  public static function _getWikiContentSearchInstance($query_parser)
290  {
291  if (ilSearchSettings::getInstance()->enabledIndex()) {
292  include_once 'Services/Search/classes/Fulltext/class.ilFulltextWikiContentSearch.php';
293  return new ilFulltextWikiContentSearch($query_parser);
294  } else {
295  include_once 'Services/Search/classes/Like/class.ilLikeWikiContentSearch.php';
296  return new ilLikeWikiContentSearch($query_parser);
297  }
298  }
299 
308  public static function _getAdvancedMDSearchInstance($query_parser)
309  {
310  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDLikeSearch.php');
311  return new ilAdvancedMDLikeSearch($query_parser);
312  }
313 
318  public static function getUserOrgUnitAssignmentInstance($query_parser)
319  {
320  include_once './Services/Search/classes/Like/class.ilLikeUserOrgUnitSearch.php';
321  return new ilLikeUserOrgUnitSearch($query_parser);
322  }
323 }
static _getWikiContentSearchInstance($query_parser)
get reference of ilFulltextWikiContentSearch
static _getAdvancedSearchInstance($query_parser)
get reference of ilFulltextAdvancedSearch
static _getWebresourceSearchInstance($query_parser)
get reference of ilFulltextWebresourceSearch
Class ilFulltextMediaCastSearch.
static _getMediaPoolSearchInstance($query_parser)
get reference of ilFulltextMediapoolSearch
static getUserMultiFieldSearchInstance($query_parser)
static _getAdvancedMDSearchInstance($query_parser)
get advanced meta data search instance
static _getUserSearchInstance($query_parser)
get reference of ilLikeUserSearch
static _getForumSearchInstance($query_parser)
get reference of ilFulltextForumSearch
static _getExerciseSearchInstance($query_parser)
get reference of ilFulltextExerciseSearch
static _getMediacastSearchInstance($query_parser)
get reference of ilFulltextMediacastSearch
static _getGlossaryDefinitionSearchInstance($query_parser)
get reference of ilFulltextGlossaryDefinitionSearch
static _getMetaDataSearchInstance($query_parser)
get reference of ilFulltext/LikeMetaDataSearch.
static getByTypeSearchInstance($a_object_type, $a_query_parser)
Class ilFulltextWikiContentSearch.
static _getLMContentSearchInstance($query_parser)
get reference of ilFulltextLMContentSearch
static _getObjectSearchInstance($query_parser)
get reference of ilFulltext/LikeObjectSearch.
Class ilLikeMediaCastSearch.
static _getTestSearchInstance($query_parser)
get reference of ilFulltextTestSearch
Description of class class.
static getUserOrgUnitAssignmentInstance($query_parser)
get orgunit search instance
static _getUserDefinedFieldSearchInstance($query_parser)
get reference of ilLikeUserDefinedFieldSearch