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 SummaryFieldsModifier and TypeFieldDescriptionprotected ContentSearchHelperThe content search helperprotected RightManagerThe right managerprotected SearchComponentHelperThe helper for search componentprotected SearcherFactoryThe searcher factoryFields inherited from interface org.ametys.web.frontoffice.search.requesttime.SearchComponentDISABLE_DEFAULT_SAX_PARAMETER_NAME, MAX_PRIORITY, MIN_PRIORITY, SEARCH_PRIORITY
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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 searchervoidExecutes the component.intGet the priority for the component.voidservice(ServiceManager manager) booleanCheck if an element is supportedMethods inherited from class org.ametys.web.frontoffice.search.requesttime.AbstractSearchComponentgetId, setPluginInfoMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabledgetLogger, setLogger
- 
Field Details- 
_searcherFactoryThe searcher factory
- 
_searchComponentHelperThe helper for search component
- 
_rightManagerThe right manager
- 
_contentSearchHelperThe content search helper
 
- 
- 
Constructor Details- 
SaxEnumeratedCriteriaComponentpublic SaxEnumeratedCriteriaComponent()
 
- 
- 
Method Details- 
service- Specified by:
- servicein interface- Serviceable
- Throws:
- ServiceException
 
- 
getPriorityDescription 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.- Specified by:
- getPriorityin interface- Prioritizable
- Returns:
- the priority
 
- 
supportsDescription copied from interface:SupporterCheck if an element is supported- Specified by:
- supportsin interface- Supporter<SearchComponentArguments>
- Parameters:
- args- The element
- Returns:
- trueif the element is supported,- falseotherwise
 
- 
executeDescription copied from interface:SearchComponentExecutes the component.- Specified by:
- executein interface- SearchComponent
- Parameters:
- args- the arguments
- Throws:
- Exception- if an exception occurs. Other search components will be attempted to be executed
 
- 
_getFacetDefinitionsprotected 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
 
- 
_setRightSet right to the searcher- Parameters:
- searcher- the searcher
- args- the arguments
 
- 
_saxCountEnumeratedCriteriaprotected 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 handler
- parameters- the parameters
- facets- The facets
- searchResults- The search results
- contextualParameters- The contextual parameters
- Throws:
- SAXException- if an error occurs while generating SAX events
 
- 
_getFacetValuesprotected <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 facet
- criterion- the criterion corresponding to the current facet
- contextualParameters- the contextual parameters
- Returns:
- the values of the current facet
 
- 
_saxFacetItemsWithCountprotected 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 handler
- facet- the facet definition
- valuesForCurrentFacetDef- The values for the current facet definition
- contextualParameters- The contextual parameters
- Throws:
- SAXException- if an error occurs while generating SAX events
 
- 
_saxFacetItemWithCountprotected void _saxFacetItemWithCount(ContentHandler contentHandler, I18nizableText facetLabel, String value, Integer count) throws SAXException SAX the facet item with the count- Parameters:
- contentHandler- the content handler
- facetLabel- the facet label
- value- the value for the current facet item
- count- the value count
- Throws:
- SAXException- if an error occurs while generating SAX events
 
 
-