ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilLuceneUserSearchGUI Class Reference
+ 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 ()
 
 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 35 of file class.ilLuceneUserSearchGUI.php.

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

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

Member Function Documentation

◆ executeCommand()

ilLuceneUserSearchGUI::executeCommand ( )

Execute Command.

Definition at line 48 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.

48  : void
49  {
50  $next_class = $this->ctrl->getNextClass($this);
51  $cmd = $this->ctrl->getCmd();
52 
53  $this->prepareOutput();
54  switch ($next_class) {
55  case "ilpublicuserprofilegui":
56 
57  $user_id = 0;
58  if ($this->http->wrapper()->query()->has('user_id')) {
59  $user_id = $this->http->wrapper()->query()->retrieve(
60  'user_id',
61  $this->refinery->kindlyTo()->int()
62  );
63  }
64  $profile = new ilPublicUserProfileGUI($user_id);
65  $profile->setBackUrl($this->ctrl->getLinkTarget($this, 'showSavedResults'));
66  $ret = $this->ctrl->forwardCommand($profile);
67  $this->tpl->setContent($ret);
68  break;
69 
70 
71  default:
73  if (!$cmd) {
74  $cmd = "showSavedResults";
75  }
76  $this->handleCommand($cmd);
77  break;
78  }
79  }
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 103 of file class.ilLuceneUserSearchGUI.php.

103  : array
104  {
105  return $this->search_cache->getItemFilter();
106  }

◆ getTabs()

ilLuceneUserSearchGUI::getTabs ( )
protected

get tabs

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

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

Referenced by prepareOutput().

192  : void
193  {
194  $this->help->setScreenIdComponent("src_luc");
195 
196  $this->tabs->addTarget('search', $this->ctrl->getLinkTargetByClass('illucenesearchgui'));
197 
198  if (ilSearchSettings::getInstance()->isLuceneUserSearchEnabled()) {
199  $this->tabs->addTarget('search_user', $this->ctrl->getLinkTargetByClass('illuceneusersearchgui'));
200  }
201 
202  $this->tabs->setTabActive('search_user');
203  }
+ 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 94 of file class.ilLuceneUserSearchGUI.php.

94  : int
95  {
96  return self::SEARCH_DETAILS;
97  }

◆ initUserSearchCache()

ilLuceneUserSearchGUI::initUserSearchCache ( )
protected

Init user search cache.

Definition at line 208 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().

208  : void
209  {
210  $this->search_cache = ilUserSearchCache::_getInstance($this->user->getId());
211  $this->search_cache->switchSearchType(ilUserSearchCache::LUCENE_USER_SEARCH);
212  $page_number = $this->initPageNumberFromQuery();
213  if ($page_number) {
214  $this->search_cache->setResultPageNumber($page_number);
215  }
216 
217  if ($this->http->wrapper()->post()->has('term')) {
218  $query = $this->http->wrapper()->post()->retrieve(
219  'term',
220  $this->refinery->kindlyTo()->string()
221  );
222  $this->search_cache->setQuery($query);
223  $this->search_cache->setItemFilter(array());
224  $this->search_cache->setMimeFilter(array());
225  $this->search_cache->save();
226  }
227  }
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 167 of file class.ilLuceneUserSearchGUI.php.

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

Referenced by search(), and showSavedResults().

167  : void
168  {
169  $qp = new ilLuceneQueryParser($this->search_cache->getQuery());
170  $qp->parse();
171  $searcher = ilLuceneSearcher::getInstance($qp);
172  $searcher->setType(ilLuceneSearcher::TYPE_USER);
173  $searcher->search();
174 
175  $this->showSearchForm();
176 
177  $user_table = new ilRepositoryUserResultTableGUI(
178  $this,
179  'performSearch',
180  false,
182  );
183  $user_table->setLuceneResult($searcher->getResult());
184  $user_table->parseUserIds($searcher->getResult()->getCandidates());
185 
186  $this->tpl->setVariable('SEARCH_RESULTS', $user_table->getHTML());
187  }
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 81 of file class.ilLuceneUserSearchGUI.php.

References getTabs().

Referenced by executeCommand().

81  : void
82  {
83  parent::prepareOutput();
84  $this->getTabs();
85  }
+ 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 112 of file class.ilLuceneUserSearchGUI.php.

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

112  : void
113  {
114  $root_id = 0;
115  if ($this->http->wrapper()->post()->has('root_id')) {
116  $root_id = $this->http->wrapper()->post()->retrieve(
117  'root_id',
118  $this->refinery->kindlyTo()->int()
119  );
120  }
121  $queryString = '';
122  if ($this->http->wrapper()->post()->has('queryString')) {
123  $queryString = $this->http->wrapper()->post()->retrieve(
124  'queryString',
125  $this->refinery->kindlyTo()->string()
126  );
127  }
128  $this->search_cache->setRoot($root_id);
129  $this->search_cache->setQuery($queryString);
130  $this->search_cache->save();
131  $this->search();
132  }
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)

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

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

Referenced by remoteSearch().

147  : void
148  {
149  if (!$this->form->checkInput()) {
150  $this->search_cache->deleteCachedEntries();
151  // Reset details
153  $this->showSearchForm();
154  return;
155  }
156  ilSession::clear('max_page');
157  $this->search_cache->deleteCachedEntries();
158 
159  // Reset details
161  $this->performSearch();
162  }
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

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

References performSearch(), and showSearchForm().

134  : void
135  {
136  if (strlen($this->search_cache->getQuery())) {
137  $this->performSearch();
138  return;
139  }
140 
141  $this->showSearchForm();
142  }
+ Here is the call graph for this function:

◆ showSearchForm()

ilLuceneUserSearchGUI::showSearchForm ( )
protected

Show search form.

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

References ilSearchBaseGUI\renderSearch().

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

235  {
236  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.lucene_usr_search.html', 'components/ILIAS/Search');
237  $this->renderSearch($this->search_cache->getQuery());
238 
239  return true;
240  }
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 30 of file class.ilLuceneUserSearchGUI.php.

◆ $tabs

ilTabsGUI ilLuceneUserSearchGUI::$tabs
protected

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


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