Class SortSearchComponent
java.lang.Object
org.ametys.web.frontoffice.search.requesttime.impl.SortSearchComponent
- All Implemented Interfaces:
SearchComponent
SearchComponent
for specifying the sort in the search.-
Field Summary
Fields inherited from interface org.ametys.web.frontoffice.search.requesttime.SearchComponent
DISABLE_DEFAULT_SAX_PARAMETER_NAME, MAX_PRIORITY, MIN_PRIORITY, SEARCH_PRIORITY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkValidInputs
(Map<String, SortDefinition> serviceProposedSortsById, List<Pair<String, Sort.Order>> userSorts) Checks the user inputs are validvoid
Executes the component.int
priority()
Get the priority of the component.protected void
Sets the SEARCH_LOCALE attribute in requestboolean
Returnstrue
if the component must beexecuted
.
-
Constructor Details
-
SortSearchComponent
public SortSearchComponent()
-
-
Method Details
-
priority
Description copied from interface:SearchComponent
Get the priority of the component. The lowest one will be executed first, and so on.- Specified by:
priority
in interfaceSearchComponent
- Returns:
- the priority of the component
-
supports
Description copied from interface:SearchComponent
Returnstrue
if the component must beexecuted
.- Specified by:
supports
in interfaceSearchComponent
- Parameters:
args
- the arguments- Returns:
true
if the component must beexecuted
.
-
execute
Description copied from interface:SearchComponent
Executes the component.- Specified by:
execute
in interfaceSearchComponent
- Parameters:
args
- the arguments- Throws:
Exception
- if an exception occurs. Other search components will be attempted to be executed
-
checkValidInputs
protected void checkValidInputs(Map<String, SortDefinition> serviceProposedSortsById, List<Pair<String, throws org.ametys.web.frontoffice.search.requesttime.impl.InvalidUserInputExceptionSort.Order>> userSorts) Checks the user inputs are valid- Parameters:
serviceProposedSortsById
- The proposed sorts of the service instanceuserSorts
- The user input sorts- Throws:
org.ametys.web.frontoffice.search.requesttime.impl.InvalidUserInputException
- if at least user one input is invalid
-
setSearchLanguageAttribute
Sets the SEARCH_LOCALE attribute in request- Parameters:
args
- the arguments
-