Class SearchUserInputsRetriever
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.web.frontoffice.search.requesttime.input.SearchUserInputsRetriever
-
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
public class SearchUserInputsRetriever extends AbstractLogEnabled implements Component, Serviceable
TheSearchUserInputs
retriever.
-
-
Field Summary
Fields Modifier and Type Field Description protected CurrentUserProvider
_currentUserProvider
The current user providerprotected JSONUtils
_jsonUtils
The JSON utilsprotected UserPreferencesManager
_userPrefsManager
The user preferences managerstatic String
ROLE
The avalon role
-
Constructor Summary
Constructors Constructor Description SearchUserInputsRetriever()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SearchUserInputs
_getCurrentSearchUserInputs(String serviceId)
Get the current search user inputs for the given service.SearchUserInputs
getUserInputs(Request request, boolean isFormSubmitted, SearchServiceInstance serviceInstance)
Get the user inputs.void
service(ServiceManager manager)
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_currentUserProvider
protected CurrentUserProvider _currentUserProvider
The current user provider
-
_userPrefsManager
protected UserPreferencesManager _userPrefsManager
The user preferences manager
-
_jsonUtils
protected JSONUtils _jsonUtils
The JSON utils
-
-
Constructor Detail
-
SearchUserInputsRetriever
public SearchUserInputsRetriever()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getUserInputs
public SearchUserInputs getUserInputs(Request request, boolean isFormSubmitted, SearchServiceInstance serviceInstance)
Get the user inputs. Implementation depends on the search parameters.- Parameters:
request
- The requestisFormSubmitted
-true
if the form has been submittedserviceInstance
- The search service instance- Returns:
- The search user inputs (criteria, facets, sorts)
-
_getCurrentSearchUserInputs
protected SearchUserInputs _getCurrentSearchUserInputs(String serviceId)
Get the current search user inputs for the given service.- Parameters:
serviceId
- The service ID- Returns:
- A
SearchUserInputs
object if the user is authenticated and have saved filters for this service. Otherwise, it returnsnull
.
-
-