ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
ILIAS\Search\GUI\Lucene\SearchStateHandlerImpl Class Reference
+ Inheritance diagram for ILIAS\Search\GUI\Lucene\SearchStateHandlerImpl:
+ Collaboration diagram for ILIAS\Search\GUI\Lucene\SearchStateHandlerImpl:

Public Member Functions

 __construct (protected ilSearchSettings $settings, protected LOMServices $lom_services, HTTP $http, Refinery $refinery)
 
 fetchRequestedRemoteSearchTerm ()
 propably needs to be replaced with a completely different mechanism when switching to KS More...
 
 fetchFilter (URI $action)
 
 fetchCache (int $usr_id)
 
 loadFilterToCache (ilSearchFilterGUI $filter, ilUserSearchCache $cache)
 
- Public Member Functions inherited from ILIAS\Search\GUI\AbstractSearchStateHandlerImpl
 __construct (protected HTTP $http, protected Refinery $refinery)
 
 fetchMaxPage ()
 
 resetMaxPage ()
 
 updateMaxPage (int $max_page)
 
 fetchRequestedPage ()
 
 fetchSortation ()
 
 fetchRequestedSearchTerm ()
 propably needs to be replaced with a completely different mechanism when switching to KS More...
 
 fetchRequestedRemoteSearchTerm ()
 propably needs to be replaced with a completely different mechanism when switching to KS More...
 
 fetchRequestedAutoCompleteSearchTerm ()
 propably needs to be replaced with a completely different mechanism when switching to KS More...
 
 fetchRequestedRemoteScope ()
 propably needs to be replaced with a completely different mechanism when switching to KS More...
 
 fetchCache (int $usr_id)
 
 fetchFilter (URI $action)
 
 loadFilterToCache (ilSearchFilterGUI $filter, ilUserSearchCache $cache)
 
 fetchMaxPage ()
 
 resetMaxPage ()
 
 updateMaxPage (int $max_page)
 
 fetchRequestedPage ()
 
 fetchSortation ()
 
 fetchRequestedSearchTerm ()
 
 fetchRequestedRemoteSearchTerm ()
 
 fetchRequestedAutoCompleteSearchTerm ()
 
 fetchRequestedRemoteScope ()
 
 fetchCache (int $usr_id)
 
 fetchFilter (URI $action)
 
 loadFilterToCache (ilSearchFilterGUI $filter, ilUserSearchCache $cache)
 

Detailed Description

Definition at line 33 of file SearchStateHandlerImpl.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Search\GUI\Lucene\SearchStateHandlerImpl::__construct ( protected ilSearchSettings  $settings,
protected LOMServices  $lom_services,
HTTP  $http,
Refinery  $refinery 
)

Definition at line 35 of file SearchStateHandlerImpl.php.

40 {
42 }
$http
Definition: deliver.php:30
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $http, ILIAS\UI\examples\Layout\Page\Mail\$refinery, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ fetchCache()

ILIAS\Search\GUI\Lucene\SearchStateHandlerImpl::fetchCache ( int  $usr_id)

Reimplemented from ILIAS\Search\GUI\AbstractSearchStateHandlerImpl.

Definition at line 63 of file SearchStateHandlerImpl.php.

64 {
65 $cache = ilUserSearchCache::_getInstance($usr_id);
66 $cache->switchSearchType(ilUserSearchCache::LUCENE_DEFAULT);
67 return $cache;
68 }
Class for storing search result.
static _getInstance(int $a_usr_id)

References ilUserSearchCache\_getInstance(), and ilUserSearchCache\LUCENE_DEFAULT.

+ Here is the call graph for this function:

◆ fetchFilter()

ILIAS\Search\GUI\Lucene\SearchStateHandlerImpl::fetchFilter ( URI  $action)

Reimplemented from ILIAS\Search\GUI\AbstractSearchStateHandlerImpl.

Definition at line 58 of file SearchStateHandlerImpl.php.

59 {
60 return new ilSearchFilterGUI($action, true);
61 }

◆ fetchRequestedRemoteSearchTerm()

ILIAS\Search\GUI\Lucene\SearchStateHandlerImpl::fetchRequestedRemoteSearchTerm ( )

propably needs to be replaced with a completely different mechanism when switching to KS

Reimplemented from ILIAS\Search\GUI\AbstractSearchStateHandlerImpl.

Definition at line 44 of file SearchStateHandlerImpl.php.

44 : string
45 {
46 if ($this->http->wrapper()->post()->has('queryString')) {
47 $term = $this->http->wrapper()->post()->retrieve(
48 'queryString',
49 $this->refinery->kindlyTo()->string()
50 );
51 $qp = new ilLuceneQueryParser($term);
52 $qp->parseAutoWildcard();
53 return $qp->getQuery();
54 }
55 return '';
56 }
static http()
Fetches the global http state from ILIAS.

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

+ Here is the call graph for this function:

◆ loadFilterToCache()

ILIAS\Search\GUI\Lucene\SearchStateHandlerImpl::loadFilterToCache ( ilSearchFilterGUI  $filter,
ilUserSearchCache  $cache 
)

Reimplemented from ILIAS\Search\GUI\AbstractSearchStateHandlerImpl.

Definition at line 70 of file SearchStateHandlerImpl.php.

70 : void
71 {
72 $search_filter_data = $filter->getData();
73
74 $cache->setRoot((int) ($search_filter_data['search_scope'] ?? ROOT_FOLDER_ID));
75
76 $creation_filter = [];
77 if (
78 $this->settings->isDateFilterEnabled() &&
79 isset($search_filter_data['search_date'])
80 ) {
81 $creation_filter['date_start'] = $search_filter_data['search_date'][0];
82 $creation_filter['date_end'] = $search_filter_data['search_date'][1];
83 }
84 $cache->setCreationFilter($creation_filter);
85
86 $types_from_filter = (array) ($search_filter_data['search_type'] ?? []);
87
88 $enabled_types = [];
89 foreach ($this->settings->getEnabledLuceneItemFilterDefinitions() as $type => $data) {
90 if (in_array($type, $types_from_filter)) {
91 $enabled_types[$type] = 1;
92 }
93 }
94 $cache->setItemFilter($enabled_types);
95
96 $enabled_mime_types = [];
97 foreach ($this->settings->getEnabledLuceneMimeFilterDefinitions() as $mime_type => $data) {
98 if (in_array($mime_type, $types_from_filter)) {
99 $enabled_mime_types[$mime_type] = 1;
100 }
101 }
102 $cache->setMimeFilter($enabled_mime_types);
103
104 $copyright_filter = [];
105 if (
106 $this->lom_services->copyrightHelper()->isCopyrightSelectionActive() &&
107 isset($search_filter_data['search_copyright'])
108 ) {
109 $copyright_filter = $search_filter_data['search_copyright'];
110 }
111 $cache->setCopyrightFilter(...$copyright_filter);
112 }
setCreationFilter(array $a_filter)
setItemFilter(array $a_filter)
setMimeFilter(array $a_filter)
setRoot(int $a_root)
set root node of search
setCopyrightFilter(string ... $copyright_identifiers)
const ROOT_FOLDER_ID
Definition: constants.php:32

References $data, ilSearchFilterGUI\getData(), ROOT_FOLDER_ID, ilUserSearchCache\setCopyrightFilter(), ilUserSearchCache\setCreationFilter(), ilUserSearchCache\setItemFilter(), ilUserSearchCache\setMimeFilter(), ilUserSearchCache\setRoot(), and ILIAS\Repository\settings().

+ Here is the call graph for this function:

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