Class SaxResultsSearchComponent
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.web.frontoffice.search.requesttime.AbstractSearchComponent
org.ametys.web.frontoffice.search.requesttime.impl.SaxResultsSearchComponent
- All Implemented Interfaces:
LogEnabled,PluginAware,Prioritizable,Supporter<SearchComponentArguments>,SearchComponent
- Direct Known Subclasses:
CalendarSearchComponent
SearchComponent for saxing results-
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidExecutes the component.intGet the priority for the component.protected SearchResults<AmetysObject> Gets the resultsprotected Optional<ReturnableSaxer> getSaxer(AmetysObject hit, SearchComponentArguments args, List<Returnable> returnables, AdditionalParameterValueMap additionalParameterValues) Gets theSaxerto use for SAXing the given hitprotected voidsaxHit(SearchResult<AmetysObject> result, int number, SearchComponentArguments args, List<Returnable> returnables, AdditionalParameterValueMap additionalParameterValues) SAX the result hitprotected voidsaxHits(SearchResults<AmetysObject> results, int start, SearchComponentArguments args, List<Returnable> returnables, AdditionalParameterValueMap additionalParameterValues) SAX the result hitsprotected voidsaxPagination(int totalHits, Pagination pagination, ContentHandler contentHandler) SAX elements for paginationbooleanCheck if an element is supportedprotected inttotal(SearchResults<AmetysObject> results, SearchServiceInstance serviceInstance) The total of resultsMethods inherited from class org.ametys.web.frontoffice.search.requesttime.AbstractSearchComponent
getId, setPluginInfoMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Constructor Details
-
SaxResultsSearchComponent
public SaxResultsSearchComponent()
-
-
Method Details
-
getPriority
Description copied from interface:PrioritizableGet the priority for the component. On components usingPrioritizableinterface, each implementation define the order. In most cases, less is the number, more prior is the component.- Returns:
- the priority
-
supports
Description copied from interface:SupporterCheck if an element is supported- Parameters:
args- The element- Returns:
trueif the element is supported,falseotherwise
-
execute
Description copied from interface:SearchComponentExecutes the component.- Parameters:
args- the arguments- Throws:
Exception- if an exception occurs. Other search components will be attempted to be executed
-
getResults
Gets the results- Parameters:
args- The arguments- Returns:
- the results
-
total
The total of results- Parameters:
results- The resultsserviceInstance- The search service instance- Returns:
- The total of results
-
saxHits
protected void saxHits(SearchResults<AmetysObject> results, int start, SearchComponentArguments args, List<Returnable> returnables, AdditionalParameterValueMap additionalParameterValues) throws SAXException SAX the result hits- Parameters:
results- The search resultsstart- The start index of searchargs- The argumentsreturnables- The returnablesadditionalParameterValues- The additional parameter values- Throws:
SAXException- If an error occurs while SAXing
-
saxHit
protected void saxHit(SearchResult<AmetysObject> result, int number, SearchComponentArguments args, List<Returnable> returnables, AdditionalParameterValueMap additionalParameterValues) throws SAXException SAX the result hit- Parameters:
result- The search resultnumber- The hit numberargs- The argumentsreturnables- The returnablesadditionalParameterValues- The additional parameter values- Throws:
SAXException- If an error occurs while SAXing
-
getSaxer
protected Optional<ReturnableSaxer> getSaxer(AmetysObject hit, SearchComponentArguments args, List<Returnable> returnables, AdditionalParameterValueMap additionalParameterValues) Gets theSaxerto use for SAXing the given hit- Parameters:
hit- The hit to SAXargs- The argumentsreturnables- The returnables for the current search service instanceadditionalParameterValues- The additional parameter values- Returns:
- the
Saxerto use for SAXing the given hit
-
saxPagination
protected void saxPagination(int totalHits, Pagination pagination, ContentHandler contentHandler) throws SAXException SAX elements for pagination- Parameters:
totalHits- The total number of resultpagination- The pagination objectcontentHandler- The content handler- Throws:
SAXException- SAXException If an error occurs while SAXing
-