Class SearchComponentArguments
- java.lang.Object
-
- org.ametys.web.frontoffice.search.requesttime.SearchComponentArguments
-
public class SearchComponentArguments extends Object
Wrapper of arguments passed toSearchComponent#execute
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSearchComponentArguments(ContentHandler contentHandler, Parameters generatorParameters, SearchServiceInstance serviceInstance, SearchService service, SearchUserInputs userInputs, Request request, Response response, Pagination pagination, Site currentSite, Page currentPage, String currentLang, boolean launchSearch, SearcherFactory.Searcher searcher, org.slf4j.Logger logger, SearchServiceDebugModeHelper.DebugMode debugMode)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContentHandlercontentHandler()Gets the content handlerStringcurrentLang()Gets the current langPagecurrentPage()Gets the current pageSitecurrentSite()Gets the current siteOptional<SearchServiceDebugModeHelper.DebugMode>debugMode()Gets the debug modeOptional<SearchResults<AmetysObject>>enumeratedResults()Gets the enumerated results of the search.ParametersgeneratorParameters()Gets the parameters of the generator, allowing to change some behaviors depending on the URL the request comes frombooleanisDebug()Returnstrueif debug is activatedbooleanlaunchSearch()Returnstrueif the search has to be launchorg.slf4j.Loggerlogger()Gets the loggerPaginationpagination()Gets the paginationRequestrequest()Gets the current requestResponseresponse()Gets the responseOptional<SearchResults<AmetysObject>>results()Gets the results of the search.SearcherFactory.Searchersearcher()Gets the searcherSearchServiceservice()Gets the search serviceSearchServiceInstanceserviceInstance()Gets the search service instancevoidsetEnumeratedResults(SearchResults<AmetysObject> enumeratedResults)Sets the enumerated resultsvoidsetResults(SearchResults<AmetysObject> results)Sets the resultsvoidupdateUserInputs(SearchUserInputs userInputs)Update the user inputsSearchUserInputsuserInputs()Gets the user inputs
-
-
-
Constructor Detail
-
SearchComponentArguments
protected SearchComponentArguments(ContentHandler contentHandler, Parameters generatorParameters, SearchServiceInstance serviceInstance, SearchService service, SearchUserInputs userInputs, Request request, Response response, Pagination pagination, Site currentSite, Page currentPage, String currentLang, boolean launchSearch, SearcherFactory.Searcher searcher, org.slf4j.Logger logger, SearchServiceDebugModeHelper.DebugMode debugMode)
Constructor- Parameters:
contentHandler- the content handlergeneratorParameters- the parameters of the generatorserviceInstance- the search service instanceservice- the search serviceuserInputs- the user inputsrequest- the current requestresponse- the responsepagination- the paginationcurrentSite- the current sitecurrentPage- the current pagecurrentLang- the current langlaunchSearch-trueif the search has to be launchsearcher- the searcherlogger- the loggerdebugMode- the debug mode. Can be null
-
-
Method Detail
-
contentHandler
public ContentHandler contentHandler()
Gets the content handler- Returns:
- the content handler
-
generatorParameters
public Parameters generatorParameters()
Gets the parameters of the generator, allowing to change some behaviors depending on the URL the request comes from- Returns:
- the parameters of the generator
-
serviceInstance
public SearchServiceInstance serviceInstance()
Gets the search service instance- Returns:
- the search service instance
-
service
public SearchService service()
Gets the search service- Returns:
- the search service
-
userInputs
public SearchUserInputs userInputs()
Gets the user inputs- Returns:
- the user inputs
-
updateUserInputs
public void updateUserInputs(SearchUserInputs userInputs)
Update the user inputs- Parameters:
userInputs- the user inputs
-
pagination
public Pagination pagination()
Gets the pagination- Returns:
- the pagination
-
currentSite
public Site currentSite()
Gets the current site- Returns:
- the current site
-
currentPage
public Page currentPage()
Gets the current page- Returns:
- the current page
-
currentLang
public String currentLang()
Gets the current lang- Returns:
- the current lang
-
launchSearch
public boolean launchSearch()
Returnstrueif the search has to be launch- Returns:
trueif the search has to be launch
-
setResults
public void setResults(SearchResults<AmetysObject> results)
Sets the results- Parameters:
results- the results
-
results
public Optional<SearchResults<AmetysObject>> results()
Gets the results of the search. Can be empty if search has not been executed yet- Returns:
- the results of the search, or an empty optional if search has not been executed yet
-
setEnumeratedResults
public void setEnumeratedResults(SearchResults<AmetysObject> enumeratedResults)
Sets the enumerated results- Parameters:
enumeratedResults- the enumerated results
-
enumeratedResults
public Optional<SearchResults<AmetysObject>> enumeratedResults()
Gets the enumerated results of the search. Can be empty if enumerated search has not been executed yet or computeCriteriaCounts parameter isfalse- Returns:
- the enumerated results of the search, or an empty optional if enumerated search has not been executed yet or computeCriteriaCounts parameter is
false
-
searcher
public SearcherFactory.Searcher searcher()
Gets the searcher- Returns:
- the searcher
-
logger
public org.slf4j.Logger logger()
Gets the logger- Returns:
- the logger
-
isDebug
public boolean isDebug()
Returnstrueif debug is activated- Returns:
trueif debug is activated
-
debugMode
public Optional<SearchServiceDebugModeHelper.DebugMode> debugMode()
Gets the debug mode- Returns:
- the debug mode
-
-