Class SaxEnumeratedCriteriaComponent
java.lang.Object
org.ametys.web.frontoffice.search.requesttime.impl.SaxEnumeratedCriteriaComponent
- All Implemented Interfaces:
SearchComponent
,Serviceable
- Direct Known Subclasses:
SaxDegreeUniversityEnumeratedCriteriaComponent
SearchComponent
for saxing number of results for each values of enumerated criteria-
Field Summary
Modifier and TypeFieldDescriptionprotected RightManager
The right managerprotected SearchComponentHelper
The helper for search componentprotected SearcherFactory
The searcher factoryFields 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 TypeMethodDescriptionprotected Collection<FacetDefinition>
_getFacetDefinitions
(SearchServiceInstance serviceInstance) Transform each enumerated criteria in facet definition to have the number of result for each enumerated valuesprotected void
_saxCountEnumeratedCriteria
(ContentHandler contentHandler, Parameters parameters, Collection<FacetDefinition> facets, SearchResults<AmetysObject> searchResults, String currentLang) SAX the enumerated criteriaprotected void
_saxFacetItemWithCount
(ContentHandler contentHandler, FacetDefinition facet, Map<String, Integer> valuesForCurrentFacetDef, String lang) SAX the facet items with the countprotected void
_setRight
(SearcherFactory.Searcher searcher, SearchComponentArguments args) Set right to the searchervoid
Executes the component.int
priority()
Get the priority of the component.void
service
(ServiceManager manager) boolean
Returnstrue
if the component must beexecuted
.
-
Field Details
-
_searcherFactory
The searcher factory -
_searchComponentHelper
The helper for search component -
_rightManager
The right manager
-
-
Constructor Details
-
SaxEnumeratedCriteriaComponent
public SaxEnumeratedCriteriaComponent()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
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
-
_getFacetDefinitions
Transform each enumerated criteria in facet definition to have the number of result for each enumerated values- Parameters:
serviceInstance
- the service instance- Returns:
- the collection of facet defintion
-
_setRight
Set right to the searcher- Parameters:
searcher
- the searcherargs
- the arguments
-
_saxCountEnumeratedCriteria
protected void _saxCountEnumeratedCriteria(ContentHandler contentHandler, Parameters parameters, Collection<FacetDefinition> facets, SearchResults<AmetysObject> searchResults, String currentLang) throws SAXException SAX the enumerated criteria- Parameters:
contentHandler
- the content handlerparameters
- the parametersfacets
- The facetssearchResults
- The search resultscurrentLang
- The current language- Throws:
SAXException
- if an error occurs while SAXing
-
_saxFacetItemWithCount
protected void _saxFacetItemWithCount(ContentHandler contentHandler, FacetDefinition facet, Map<String, Integer> valuesForCurrentFacetDef, String lang) throws SAXExceptionSAX the facet items with the count- Parameters:
contentHandler
- the content handlerfacet
- the facet definitionvaluesForCurrentFacetDef
- The values for the current facet definitionlang
- The current language- Throws:
SAXException
- if an error occurs while SAXing
-