ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 ()
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
 delete ()
 Show delete confirmation. More...
 
 cancelDelete ()
 Cancel delete. More...
 
 performDelete ()
 
 cut ()
 
 showLinkIntoMultipleObjectsTree ()
 
 showMoveIntoObjectTree ()
 
 showPasteTree ()
 
 performPasteIntoMultipleObjects ()
 
 paste ()
 
 clear ()
 clear clipboard More...
 
 enableAdministrationPanel ()
 
 disableAdministrationPanel ()
 
 cancelMoveLinkObject ()
 
 keepObjectsInClipboardObject ()
 
- 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

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

@ilCtrl_Calls ilLuceneUserSearchGUI: ILIAS\User\Profile\PublicProfileGUI @ilCtrl_IsCalledBy ilLuceneUserSearchGUI: ilSearchControllerGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilLuceneUserSearchGUI::__construct ( )

Constructor.

Reimplemented from ilSearchBaseGUI.

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

38 {
39 global $DIC;
40
41 $this->tabs = $DIC->tabs();
42 $this->help = $DIC->help();
44 $this->initUserSearchCache();
45 }
initUserSearchCache()
Init user search cache.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilLuceneUserSearchGUI::executeCommand ( )

Execute Command.

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

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

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

+ Here is the call graph for this function:

◆ getDetails()

ilLuceneUserSearchGUI::getDetails ( )
protected

Needed for base class search form.

Todo:
rename

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

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

◆ getTabs()

ilLuceneUserSearchGUI::getTabs ( )
protected

get tabs

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

194 : void
195 {
196 $this->help->setScreenIdComponent("src_luc");
197
198 $this->tabs->addTarget('search', $this->ctrl->getLinkTargetByClass('illucenesearchgui'));
199
200 if (ilSearchSettings::getInstance()->isLuceneUserSearchEnabled()) {
201 $this->tabs->addTarget('search_user', $this->ctrl->getLinkTargetByClass('illuceneusersearchgui'));
202 }
203
204 $this->tabs->setTabActive('search_user');
205 }

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

Referenced by prepareOutput().

+ 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 96 of file class.ilLuceneUserSearchGUI.php.

96 : int
97 {
99 }

References ilSearchBaseGUI\SEARCH_DETAILS.

◆ initUserSearchCache()

ilLuceneUserSearchGUI::initUserSearchCache ( )
protected

Init user search cache.

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

210 : void
211 {
212 $this->search_cache = ilUserSearchCache::_getInstance($this->user->getId());
213 $this->search_cache->switchSearchType(ilUserSearchCache::LUCENE_USER_SEARCH);
214 $page_number = $this->initPageNumberFromQuery();
215 if ($page_number) {
216 $this->search_cache->setResultPageNumber($page_number);
217 }
218
219 if ($this->http->wrapper()->post()->has('term')) {
220 $query = $this->http->wrapper()->post()->retrieve(
221 'term',
222 $this->refinery->kindlyTo()->string()
223 );
224 $this->search_cache->setQuery($query);
225 $this->search_cache->setItemFilter(array());
226 $this->search_cache->setMimeFilter(array());
227 $this->search_cache->save();
228 }
229 }
static _getInstance(int $a_usr_id)

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

Referenced by __construct().

+ 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 169 of file class.ilLuceneUserSearchGUI.php.

169 : void
170 {
171 $qp = new ilLuceneQueryParser($this->search_cache->getQuery());
172 $qp->parse();
173 $searcher = ilLuceneSearcher::getInstance($qp);
174 $searcher->setType(ilLuceneSearcher::TYPE_USER);
175 $searcher->search();
176
177 $this->showSearchForm();
178
179 $user_table = new ilRepositoryUserResultTableGUI(
180 $this,
181 'performSearch',
182 false,
184 );
185 $user_table->setLuceneResult($searcher->getResult());
186 $user_table->parseUserIds($searcher->getResult()->getCandidates());
187
188 $this->tpl->setVariable('SEARCH_RESULTS', $user_table->getHTML());
189 }
static getInstance(ilLuceneQueryParser $qp)
Get singleton instance.

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

Referenced by search(), and showSavedResults().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareOutput()

ilLuceneUserSearchGUI::prepareOutput ( )

Reimplemented from ilSearchBaseGUI.

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

83 : void
84 {
85 parent::prepareOutput();
86 $this->getTabs();
87 }

References getTabs().

Referenced by executeCommand().

+ 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 114 of file class.ilLuceneUserSearchGUI.php.

114 : void
115 {
116 $root_id = 0;
117 if ($this->http->wrapper()->post()->has('root_id')) {
118 $root_id = $this->http->wrapper()->post()->retrieve(
119 'root_id',
120 $this->refinery->kindlyTo()->int()
121 );
122 }
123 $queryString = '';
124 if ($this->http->wrapper()->post()->has('queryString')) {
125 $queryString = $this->http->wrapper()->post()->retrieve(
126 'queryString',
127 $this->refinery->kindlyTo()->string()
128 );
129 }
130 $this->search_cache->setRoot($root_id);
131 $this->search_cache->setQuery($queryString);
132 $this->search_cache->save();
133 $this->search();
134 }
search()
Search (button pressed)

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

+ Here is the call graph for this function:

◆ search()

ilLuceneUserSearchGUI::search ( )
protected

Search (button pressed)

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

149 : void
150 {
151 if (!$this->form->checkInput()) {
152 $this->search_cache->deleteCachedEntries();
153 // Reset details
155 $this->showSearchForm();
156 return;
157 }
158 ilSession::clear('max_page');
159 $this->search_cache->deleteCachedEntries();
160
161 // Reset details
163 $this->performSearch();
164 }
static clear(string $a_var)
static resetDetails()
As long as static::resetDetails is not possible this method is final.
form( $class_path, string $cmd, string $submit_caption="")

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

Referenced by remoteSearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showSavedResults()

ilLuceneUserSearchGUI::showSavedResults ( )
protected

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

136 : void
137 {
138 if (strlen($this->search_cache->getQuery())) {
139 $this->performSearch();
140 return;
141 }
142
143 $this->showSearchForm();
144 }

References performSearch(), and showSearchForm().

+ Here is the call graph for this function:

◆ showSearchForm()

ilLuceneUserSearchGUI::showSearchForm ( )
protected

Show search form.

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

237 {
238 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.lucene_usr_search.html', 'components/ILIAS/Search');
239 $this->renderSearch($this->search_cache->getQuery());
240
241 return true;
242 }
renderSearch(string $term, int $root_node=0)

References ilSearchBaseGUI\renderSearch().

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

+ 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 32 of file class.ilLuceneUserSearchGUI.php.

◆ $tabs

ilTabsGUI ilLuceneUserSearchGUI::$tabs
protected

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


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