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 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
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContentHandler
contentHandler()
Gets the content handlerString
currentLang()
Gets the current langPage
currentPage()
Gets the current pageSite
currentSite()
Gets the current siteOptional<SearchServiceDebugModeHelper.DebugMode>
debugMode()
Gets the debug modeOptional<SearchResults<AmetysObject>>
enumeratedResults()
Gets the enumerated results of the search.Parameters
generatorParameters()
Gets the parameters of the generator, allowing to change some behaviors depending on the URL the request comes fromboolean
isDebug()
Returnstrue
if debug is activatedboolean
launchSearch()
Returnstrue
if the search has to be launchorg.slf4j.Logger
logger()
Gets the loggerPagination
pagination()
Gets the paginationRequest
request()
Gets the current requestResponse
response()
Gets the responseOptional<SearchResults<AmetysObject>>
results()
Gets the results of the search.SearcherFactory.Searcher
searcher()
Gets the searcherSearchService
service()
Gets the search serviceSearchServiceInstance
serviceInstance()
Gets the search service instancevoid
setEnumeratedResults(SearchResults<AmetysObject> enumeratedResults)
Sets the enumerated resultsvoid
setResults(SearchResults<AmetysObject> results)
Sets the resultsvoid
updateUserInputs(SearchUserInputs userInputs)
Update the user inputsSearchUserInputs
userInputs()
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
-true
if 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()
Returnstrue
if the search has to be launch- Returns:
true
if 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()
Returnstrue
if debug is activated- Returns:
true
if debug is activated
-
debugMode
public Optional<SearchServiceDebugModeHelper.DebugMode> debugMode()
Gets the debug mode- Returns:
- the debug mode
-
-