Class FacetSearchComponent
java.lang.Object
org.ametys.web.frontoffice.search.requesttime.impl.FacetSearchComponent
- All Implemented Interfaces:
SearchComponent
SearchComponent
for executing the search with facets.-
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 TypeMethodDescriptioncheckValidInputs
(Collection<FacetDefinition> serviceFacets, Map<String, List<String>> userFacets, boolean isFromUserPref, Logger logger) Checks the user inputs are validvoid
Executes the component.int
priority()
Get the priority of the component.boolean
Returnstrue
if the component must beexecuted
.
-
Constructor Details
-
FacetSearchComponent
public FacetSearchComponent()
-
-
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 Map<String,List<String>> checkValidInputs(Collection<FacetDefinition> serviceFacets, Map<String, List<String>> userFacets, boolean isFromUserPref, Logger logger) throws org.ametys.web.frontoffice.search.requesttime.impl.InvalidUserInputExceptionChecks the user inputs are valid- Parameters:
serviceFacets
- The facets of the service instanceuserFacets
- The user input facetsisFromUserPref
-true
if the facets are from user pref. Then return only the valid input, otherwise throw an exceptionlogger
- The logger- Returns:
- the filtered user facets
- Throws:
org.ametys.web.frontoffice.search.requesttime.impl.InvalidUserInputException
- if at least user one input is invalid
-