ILIAS  trunk Revision v11.0_alpha-1846-g895b5f47236
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilLuceneUserSearchGUI Class Reference

GUI for Lucene user search More...

+ Inheritance diagram for ilLuceneUserSearchGUI:
+ Collaboration diagram for ilLuceneUserSearchGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 executeCommand ()
 Execute Command. More...
 
 prepareOutput ()
 
- Public Member Functions inherited from ilSearchBaseGUI
 __construct ()
 
 prepareOutput ()
 
 initStandardSearchForm (int $a_mode)
 
 handleCommand (string $a_cmd)
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
 delete ()
 Show delete confirmation. More...
 
 cancelDelete ()
 Cancel delete. More...
 
 cancelObject ()
 
 cancelMoveLinkObject ()
 
 performDelete ()
 
 cut ()
 
 link ()
 
 paste ()
 
 showLinkIntoMultipleObjectsTree ()
 
 showPasteTree ()
 
 showMoveIntoObjectTree ()
 
 performPasteIntoMultipleObjects ()
 
 clear ()
 clear clipboard More...
 
 enableAdministrationPanel ()
 
 disableAdministrationPanel ()
 
 keepObjectsInClipboardObject ()
 
 addLocator ()
 
 autoComplete ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Protected Member Functions

 getType ()
 Get type of search (details | fast) More...
 
 getDetails ()
 Needed for base class search form. More...
 
 remoteSearch ()
 Search from main menu. More...
 
 showSavedResults ()
 Show saved results. More...
 
 search ()
 Search (button pressed) More...
 
 performSearch ()
 Perform search. More...
 
 getTabs ()
 get tabs More...
 
 initUserSearchCache ()
 Init user search cache. More...
 
 showSearchForm ()
 Show search form. More...
 
- Protected Member Functions inherited from ilSearchBaseGUI
 initPageNumberFromQuery ()
 
 addPager ($result, string $a_session_key)
 
 buildSearchAreaPath (int $a_root_node)
 
 getSearchCache ()
 
 loadCreationFilter ()
 
 renderSearch (string $term, int $root_node=0)
 
 renderFilter (int $root_node)
 
 initFilter (int $mode)
 
 getStringArrayTransformation ()
 

Protected Attributes

ilTabsGUI $tabs
 
ilHelpGUI $help
 
- Protected Attributes inherited from ilSearchBaseGUI
ilUserSearchCache $search_cache
 
string $search_mode = ''
 
ilSearchSettings $settings
 
ilPropertyFormGUI $form = null
 
ilSearchFilterGUI $search_filter = null
 
array $search_filter_data = null
 
ClipboardManager $clipboard
 
ViewManager $container_view_manager
 
ilFavouritesManager $favourites
 
ilCtrl $ctrl
 
ILIAS $ilias
 
ilLanguage $lng
 
ilGlobalTemplateInterface $tpl
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilTree $tree
 
GlobalHttpState $http
 
Factory $refinery
 
ilLogger $logger
 
string $prev_link = ''
 
string $next_link = ''
 

Additional Inherited Members

- Data Fields inherited from ilSearchBaseGUI
const SEARCH_FAST = 1
 
const SEARCH_DETAILS = 2
 
const SEARCH_AND = 'and'
 
const SEARCH_OR = 'or'
 
const SEARCH_FORM_LUCENE = 1
 
const SEARCH_FORM_STANDARD = 2
 
const SEARCH_FORM_USER = 3
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilLuceneUserSearchGUI::__construct ( )

Constructor.

Definition at line 38 of file class.ilLuceneUserSearchGUI.php.

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\help(), initUserSearchCache(), and ILIAS\Repository\tabs().

39  {
40  global $DIC;
41 
42  $this->tabs = $DIC->tabs();
43  $this->help = $DIC->help();
45  $this->initUserSearchCache();
46  }
initUserSearchCache()
Init user search cache.
global $DIC
Definition: shib_login.php:22
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilLuceneUserSearchGUI::executeCommand ( )

Execute Command.

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

References $user_id, ILIAS\Repository\ctrl(), ilSearchBaseGUI\handleCommand(), ILIAS\FileDelivery\http(), ilSearchBaseGUI\initStandardSearchForm(), prepareOutput(), ILIAS\Repository\refinery(), and ilSearchBaseGUI\SEARCH_FORM_USER.

51  : void
52  {
53  $next_class = $this->ctrl->getNextClass($this);
54  $cmd = $this->ctrl->getCmd();
55 
56  $this->prepareOutput();
57  switch ($next_class) {
58  case "ilpublicuserprofilegui":
59 
60  $user_id = 0;
61  if ($this->http->wrapper()->query()->has('user_id')) {
62  $user_id = $this->http->wrapper()->query()->retrieve(
63  'user_id',
64  $this->refinery->kindlyTo()->int()
65  );
66  }
67  $profile = new ilPublicUserProfileGUI($user_id);
68  $profile->setBackUrl($this->ctrl->getLinkTarget($this, 'showSavedResults'));
69  $ret = $this->ctrl->forwardCommand($profile);
70  $this->tpl->setContent($ret);
71  break;
72 
73 
74  default:
76  if (!$cmd) {
77  $cmd = "showSavedResults";
78  }
79  $this->handleCommand($cmd);
80  break;
81  }
82  }
handleCommand(string $a_cmd)
GUI class for public user profile presentation.
static http()
Fetches the global http state from ILIAS.
initStandardSearchForm(int $a_mode)
+ Here is the call graph for this function:

◆ getDetails()

ilLuceneUserSearchGUI::getDetails ( )
protected

Needed for base class search form.

Todo:
rename

Definition at line 106 of file class.ilLuceneUserSearchGUI.php.

106  : array
107  {
108  return $this->search_cache->getItemFilter();
109  }

◆ getTabs()

ilLuceneUserSearchGUI::getTabs ( )
protected

get tabs

Definition at line 200 of file class.ilLuceneUserSearchGUI.php.

References ILIAS\Repository\ctrl(), ilLuceneAdvancedSearchFields\getInstance(), ilSearchSettings\getInstance(), ILIAS\Repository\help(), and ILIAS\Repository\tabs().

Referenced by prepareOutput().

200  : void
201  {
202  $this->help->setScreenIdComponent("src_luc");
203 
204  $this->tabs->addTarget('search', $this->ctrl->getLinkTargetByClass('illucenesearchgui'));
205 
206  if (ilSearchSettings::getInstance()->isLuceneUserSearchEnabled()) {
207  $this->tabs->addTarget('search_user', $this->ctrl->getLinkTargetByClass('illuceneusersearchgui'));
208  }
209 
211 
212  if (
213  !ilSearchSettings::getInstance()->getHideAdvancedSearch() and
214  $fields->getActiveFields()) {
215  $this->tabs->addTarget('search_advanced', $this->ctrl->getLinkTargetByClass('illuceneadvancedsearchgui'));
216  }
217 
218  $this->tabs->setTabActive('search_user');
219  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getType()

ilLuceneUserSearchGUI::getType ( )
protected

Get type of search (details | fast)

Todo:
rename Needed for base class search form

Definition at line 97 of file class.ilLuceneUserSearchGUI.php.

97  : int
98  {
99  return self::SEARCH_DETAILS;
100  }

◆ initUserSearchCache()

ilLuceneUserSearchGUI::initUserSearchCache ( )
protected

Init user search cache.

Definition at line 224 of file class.ilLuceneUserSearchGUI.php.

References ilUserSearchCache\_getInstance(), ILIAS\FileDelivery\http(), ilSearchBaseGUI\initPageNumberFromQuery(), ilUserSearchCache\LUCENE_USER_SEARCH, ILIAS\Repository\refinery(), and ILIAS\Repository\user().

Referenced by __construct().

224  : void
225  {
226  $this->search_cache = ilUserSearchCache::_getInstance($this->user->getId());
227  $this->search_cache->switchSearchType(ilUserSearchCache::LUCENE_USER_SEARCH);
228  $page_number = $this->initPageNumberFromQuery();
229  if ($page_number) {
230  $this->search_cache->setResultPageNumber($page_number);
231  }
232 
233  if ($this->http->wrapper()->post()->has('term')) {
234  $query = $this->http->wrapper()->post()->retrieve(
235  'term',
236  $this->refinery->kindlyTo()->string()
237  );
238  $this->search_cache->setQuery($query);
239  $this->search_cache->setItemFilter(array());
240  $this->search_cache->setMimeFilter(array());
241  $this->search_cache->save();
242  }
243  }
static _getInstance(int $a_usr_id)
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ performSearch()

ilLuceneUserSearchGUI::performSearch ( )
protected

Perform search.

Definition at line 175 of file class.ilLuceneUserSearchGUI.php.

References ilLuceneSearcher\getInstance(), ilLuceneQueryParser\parse(), showSearchForm(), ilRepositoryUserResultTableGUI\TYPE_GLOBAL_SEARCH, and ilLuceneSearcher\TYPE_USER.

Referenced by search(), and showSavedResults().

175  : void
176  {
177  $qp = new ilLuceneQueryParser($this->search_cache->getQuery());
178  $qp->parse();
179  $searcher = ilLuceneSearcher::getInstance($qp);
180  $searcher->setType(ilLuceneSearcher::TYPE_USER);
181  $searcher->search();
182 
183  $this->showSearchForm();
184 
185  $user_table = new ilRepositoryUserResultTableGUI(
186  $this,
187  'performSearch',
188  false,
190  );
191  $user_table->setLuceneResult($searcher->getResult());
192  $user_table->parseUserIds($searcher->getResult()->getCandidates());
193 
194  $this->tpl->setVariable('SEARCH_RESULTS', $user_table->getHTML());
195  }
parse()
parse query string
static getInstance(ilLuceneQueryParser $qp)
Get singleton instance.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareOutput()

ilLuceneUserSearchGUI::prepareOutput ( )

Definition at line 84 of file class.ilLuceneUserSearchGUI.php.

References getTabs().

Referenced by executeCommand().

84  : void
85  {
86  parent::prepareOutput();
87  $this->getTabs();
88  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remoteSearch()

ilLuceneUserSearchGUI::remoteSearch ( )
protected

Search from main menu.

Definition at line 115 of file class.ilLuceneUserSearchGUI.php.

References ILIAS\FileDelivery\http(), ILIAS\Repository\refinery(), and search().

115  : void
116  {
117  $root_id = 0;
118  if ($this->http->wrapper()->post()->has('root_id')) {
119  $root_id = $this->http->wrapper()->post()->retrieve(
120  'root_id',
121  $this->refinery->kindlyTo()->int()
122  );
123  }
124  $queryString = '';
125  if ($this->http->wrapper()->post()->has('queryString')) {
126  $queryString = $this->http->wrapper()->post()->retrieve(
127  'queryString',
128  $this->refinery->kindlyTo()->string()
129  );
130  }
131  $this->search_cache->setRoot($root_id);
132  $this->search_cache->setQuery($queryString);
133  $this->search_cache->save();
134  $this->search();
135  }
search()
Search (button pressed)
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

◆ search()

ilLuceneUserSearchGUI::search ( )
protected

Search (button pressed)

Returns
void

Definition at line 155 of file class.ilLuceneUserSearchGUI.php.

References ilSession\clear(), ILIAS\Repository\form(), performSearch(), ilSubItemListGUI\resetDetails(), and showSearchForm().

Referenced by remoteSearch().

155  : void
156  {
157  if (!$this->form->checkInput()) {
158  $this->search_cache->deleteCachedEntries();
159  // Reset details
161  $this->showSearchForm();
162  return;
163  }
164  ilSession::clear('max_page');
165  $this->search_cache->deleteCachedEntries();
166 
167  // Reset details
169  $this->performSearch();
170  }
static resetDetails()
As long as static::resetDetails is not possible this method is final.
form( $class_path, string $cmd, string $submit_caption="")
static clear(string $a_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showSavedResults()

ilLuceneUserSearchGUI::showSavedResults ( )
protected

Show saved results.

Returns
void

Definition at line 141 of file class.ilLuceneUserSearchGUI.php.

References performSearch(), and showSearchForm().

141  : void
142  {
143  if (strlen($this->search_cache->getQuery())) {
144  $this->performSearch();
145  return;
146  }
147 
148  $this->showSearchForm();
149  }
+ Here is the call graph for this function:

◆ showSearchForm()

ilLuceneUserSearchGUI::showSearchForm ( )
protected

Show search form.

Returns
boolean

Definition at line 251 of file class.ilLuceneUserSearchGUI.php.

References ilSearchBaseGUI\renderSearch().

Referenced by performSearch(), search(), and showSavedResults().

252  {
253  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.lucene_usr_search.html', 'components/ILIAS/Search');
254  $this->renderSearch($this->search_cache->getQuery());
255 
256  return true;
257  }
renderSearch(string $term, int $root_node=0)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $help

ilHelpGUI ilLuceneUserSearchGUI::$help
protected

Definition at line 33 of file class.ilLuceneUserSearchGUI.php.

◆ $tabs

ilTabsGUI ilLuceneUserSearchGUI::$tabs
protected

Definition at line 32 of file class.ilLuceneUserSearchGUI.php.


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