Class SaxEnumeratedCriteriaComponent
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.web.frontoffice.search.requesttime.AbstractSearchComponent
org.ametys.web.frontoffice.search.requesttime.impl.SaxEnumeratedCriteriaComponent
- All Implemented Interfaces:
LogEnabled
,PluginAware
,Prioritizable
,Supporter<SearchComponentArguments>
,SearchComponent
,Serviceable
- Direct Known Subclasses:
SaxDegreeUniversityEnumeratedCriteriaComponent
SearchComponent
for saxing number of results for each values of enumerated criteria-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContentSearchHelper
The content search helperprotected 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
Constructors -
Method Summary
Modifier and TypeMethodDescription_getFacetDefinitions
(SearchServiceInstance serviceInstance) Transform each enumerated criteria in facet definition to have the number of result for each enumerated values_getFacetValues
(Map<String, Integer> facetResult, SearchServiceCriterion<T> criterion, Map<String, Object> contextualParameters) Retrieves the values of the current facetprotected void
_saxCountEnumeratedCriteria
(ContentHandler contentHandler, Parameters parameters, Map<SearchServiceFacetDefinition, SearchServiceCriterion> facets, SearchResults<AmetysObject> searchResults, Map<String, Object> contextualParameters) SAX the enumerated criteriaprotected void
_saxFacetItemsWithCount
(ContentHandler contentHandler, SearchServiceFacetDefinition facet, Map<String, Integer> valuesForCurrentFacetDef, Map<String, Object> contextualParameters) SAX the facet items with the countprotected void
_saxFacetItemWithCount
(ContentHandler contentHandler, I18nizableText facetLabel, String value, Integer count) SAX the facet item with the countprotected void
_setRight
(SearcherFactory.Searcher searcher, SearchComponentArguments args) Set right to the searchervoid
Executes the component.int
Get the priority for the component.void
service
(ServiceManager manager) boolean
Check if an element is supportedMethods inherited from class org.ametys.web.frontoffice.search.requesttime.AbstractSearchComponent
getId, setPluginInfo
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_searcherFactory
The searcher factory -
_searchComponentHelper
The helper for search component -
_rightManager
The right manager -
_contentSearchHelper
The content search helper
-
-
Constructor Details
-
SaxEnumeratedCriteriaComponent
public SaxEnumeratedCriteriaComponent()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getPriority
Description copied from interface:Prioritizable
Get the priority for the component. On components usingPrioritizable
interface, each implementation define the order. In most cases, less is the number, more prior is the component.- Specified by:
getPriority
in interfacePrioritizable
- Returns:
- the priority
-
supports
Description copied from interface:Supporter
Check if an element is supported- Specified by:
supports
in interfaceSupporter<SearchComponentArguments>
- Parameters:
args
- The element- Returns:
true
if the element is supported,false
otherwise
-
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
protected Map<SearchServiceFacetDefinition,SearchServiceCriterion> _getFacetDefinitions(SearchServiceInstance serviceInstance) 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 definition
-
_setRight
Set right to the searcher- Parameters:
searcher
- the searcherargs
- the arguments
-
_saxCountEnumeratedCriteria
protected void _saxCountEnumeratedCriteria(ContentHandler contentHandler, Parameters parameters, Map<SearchServiceFacetDefinition, SearchServiceCriterion> facets, SearchResults<AmetysObject> searchResults, Map<String, throws SAXExceptionObject> contextualParameters) SAX the enumerated criteria- Parameters:
contentHandler
- the content handlerparameters
- the parametersfacets
- The facetssearchResults
- The search resultscontextualParameters
- The contextual parameters- Throws:
SAXException
- if an error occurs while generating SAX events
-
_getFacetValues
protected <T> Map<String,Integer> _getFacetValues(Map<String, Integer> facetResult, SearchServiceCriterion<T> criterion, Map<String, Object> contextualParameters) Retrieves the values of the current facet- Type Parameters:
T
- Type of the criterion value- Parameters:
facetResult
- the result of the current facetcriterion
- the criterion corresponding to the current facetcontextualParameters
- the contextual parameters- Returns:
- the values of the current facet
-
_saxFacetItemsWithCount
protected void _saxFacetItemsWithCount(ContentHandler contentHandler, SearchServiceFacetDefinition facet, Map<String, Integer> valuesForCurrentFacetDef, Map<String, throws SAXExceptionObject> contextualParameters) SAX the facet items with the count- Parameters:
contentHandler
- the content handlerfacet
- the facet definitionvaluesForCurrentFacetDef
- The values for the current facet definitioncontextualParameters
- The contextual parameters- Throws:
SAXException
- if an error occurs while generating SAX events
-
_saxFacetItemWithCount
protected void _saxFacetItemWithCount(ContentHandler contentHandler, I18nizableText facetLabel, String value, Integer count) throws SAXException SAX the facet item with the count- Parameters:
contentHandler
- the content handlerfacetLabel
- the facet labelvalue
- the value for the current facet itemcount
- the value count- Throws:
SAXException
- if an error occurs while generating SAX events
-