Class SaxResultsSearchComponent
- java.lang.Object
-
- org.ametys.web.frontoffice.search.requesttime.impl.SaxResultsSearchComponent
-
- All Implemented Interfaces:
SearchComponent
public class SaxResultsSearchComponent extends Object implements SearchComponent
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 Constructor Description SaxResultsSearchComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute(SearchComponentArguments args)
Executes the component.protected SearchResults<AmetysObject>
getResults(SearchComponentArguments args)
Gets the resultsprotected Optional<ReturnableSaxer>
getSaxer(AmetysObject hit, SearchComponentArguments args, List<Returnable> returnables, AdditionalParameterValueMap additionalParameterValues)
Gets theSaxer
to use for SAXing the given hitint
priority()
Get the priority of the component.protected void
saxHit(SearchResult<AmetysObject> result, int number, SearchComponentArguments args, List<Returnable> returnables, AdditionalParameterValueMap additionalParameterValues)
SAX the result hitprotected void
saxHits(SearchResults<AmetysObject> results, int start, SearchComponentArguments args, List<Returnable> returnables, AdditionalParameterValueMap additionalParameterValues)
SAX the result hitsprotected void
saxPagination(int totalHits, Pagination pagination, ContentHandler contentHandler)
SAX elements for paginationboolean
supports(SearchComponentArguments args)
Returnstrue
if the component must beexecuted
.protected int
total(SearchResults<AmetysObject> results, SearchServiceInstance serviceInstance)
The total of results
-
-
-
Constructor Detail
-
SaxResultsSearchComponent
public SaxResultsSearchComponent()
-
-
Method Detail
-
priority
public int 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
public boolean supports(SearchComponentArguments args)
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
public void execute(SearchComponentArguments args) throws Exception
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
-
getResults
protected SearchResults<AmetysObject> getResults(SearchComponentArguments args)
Gets the results- Parameters:
args
- The arguments- Returns:
- the results
-
total
protected int total(SearchResults<AmetysObject> results, SearchServiceInstance serviceInstance)
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 theSaxer
to 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
Saxer
to 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
-
-