Class SaxFormSearchComponent
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.web.frontoffice.search.requesttime.AbstractSearchComponent
org.ametys.web.frontoffice.search.requesttime.impl.SaxFormSearchComponent
- All Implemented Interfaces:
LogEnabled
,PluginAware
,Prioritizable
,Supporter<SearchComponentArguments>
,SearchComponent
,Serviceable
- Direct Known Subclasses:
CalendarSaxFormSearchComponent
SearchComponent
for saxing form-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContentHelper
The content helperprotected AmetysObjectResolver
The Ametys object resolverFields 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 TypeMethodDescriptionprotected boolean
_isMandatory
(SearchServiceCriterion criterion) Check if the given criterion is mandatoryvoid
Executes the component.int
Get the priority for the component.protected boolean
isMinimalFormSax
(Parameters parameters) Returnstrue
if the Generator is parameterized with a minimal form saxprotected <T> void
saxEnumeratorEntries
(ContentHandler contentHandler, SearchServiceCriterion<T> criterion, Map<String, Object> contextualParameters, boolean computeCriteriaCounts) SAXEnumerator
entriesprotected <T> void
saxEnumeratorEntry
(ContentHandler contentHandler, SearchServiceCriterionDefinition<T> criterionDef, Map.Entry<T, I18nizableText> enumeratorEntry) SAXEnumerator
entryprotected void
saxFacet
(ContentHandler contentHandler, I18nizableText facetLabel, String value, Integer count, List<String> selectedFacets) SAX the facetprotected void
saxFacets
(ContentHandler contentHandler, Parameters parameters, Collection<SearchServiceFacetDefinition> facets, Map<String, List<String>> userFacets, Optional<SearchResults<AmetysObject>> searchResults, Map<String, Object> contextualParameters) SAX the facetsprotected void
saxFormFields
(ContentHandler contentHandler, Parameters parameters, List<SearchServiceCriterion> nonStaticCriteria, Map<String, Object> contextualParameters, boolean computeCriteriaCounts) SAX the form criteriaprotected void
saxFormSingleValue
(ContentHandler contentHandler, Attributes attrs, Object singleUserCriterion) SAX a single value of a form criterionprotected void
saxFormValue
(ContentHandler contentHandler, Attributes attrs, Object userCriterion) SAX the values of a form criterionprotected void
saxFormValues
(ContentHandler contentHandler, Parameters parameters, List<SearchServiceCriterion> nonStaticCriteria, Map<String, Object> userCriteria) SAX the form criteria valuesprotected void
saxSorts
(ContentHandler contentHandler, Parameters parameters, List<Pair<SearchServiceSortDefinition, SortOrder>> initialSorts, Collection<SearchServiceSortDefinition> sortsToPropose, List<Pair<String, SortOrder>> userSorts) SAX the sortsvoid
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
-
_resolver
The Ametys object resolver -
_contentHelper
The content helper
-
-
Constructor Details
-
SaxFormSearchComponent
public SaxFormSearchComponent()
-
-
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
-
isMinimalFormSax
Returnstrue
if the Generator is parameterized with a minimal form sax- Parameters:
parameters
- the parameters- Returns:
true
if the Generator is parameterized with a minimal form sax
-
saxFormFields
protected void saxFormFields(ContentHandler contentHandler, Parameters parameters, List<SearchServiceCriterion> nonStaticCriteria, Map<String, Object> contextualParameters, boolean computeCriteriaCounts) throws ExceptionSAX the form criteria -
_isMandatory
Check if the given criterion is mandatory- Parameters:
criterion
- the criterion to check- Returns:
true
if the given criterion is mandatory,false
otherwise
-
saxEnumeratorEntries
protected <T> void saxEnumeratorEntries(ContentHandler contentHandler, SearchServiceCriterion<T> criterion, Map<String, Object> contextualParameters, boolean computeCriteriaCounts) throws ExceptionSAXEnumerator
entries -
saxEnumeratorEntry
protected <T> void saxEnumeratorEntry(ContentHandler contentHandler, SearchServiceCriterionDefinition<T> criterionDef, Map.Entry<T, I18nizableText> enumeratorEntry) throws ExceptionSAXEnumerator
entry- Type Parameters:
T
- Type of the criterion value- Parameters:
contentHandler
- the content handlercriterionDef
- the criterion definitionenumeratorEntry
- the enumerator entry- Throws:
Exception
- if an exception occurs
-
saxFormValues
protected void saxFormValues(ContentHandler contentHandler, Parameters parameters, List<SearchServiceCriterion> nonStaticCriteria, Map<String, Object> userCriteria) throws SAXExceptionSAX the form criteria values- Parameters:
contentHandler
- the content handlerparameters
- the parametersnonStaticCriteria
- the non-static
criteriauserCriteria
- The user input criteria- Throws:
SAXException
- if an error occurs while SAXing
-
saxFormValue
protected void saxFormValue(ContentHandler contentHandler, Attributes attrs, Object userCriterion) throws SAXException SAX the values of a form criterion- Parameters:
contentHandler
- the content handlerattrs
- The XML attributesuserCriterion
- The user input criterion value (is a List if multiple)- Throws:
SAXException
- if an error occurs while SAXing
-
saxFormSingleValue
protected void saxFormSingleValue(ContentHandler contentHandler, Attributes attrs, Object singleUserCriterion) throws SAXException SAX a single value of a form criterion- Parameters:
contentHandler
- the content handlerattrs
- The XML attributessingleUserCriterion
- The user input criterion single value- Throws:
SAXException
- if an error occurs while SAXing
-
saxFacets
protected void saxFacets(ContentHandler contentHandler, Parameters parameters, Collection<SearchServiceFacetDefinition> facets, Map<String, List<String>> userFacets, Optional<SearchResults<AmetysObject>> searchResults, Map<String, throws SAXExceptionObject> contextualParameters) SAX the facets- Parameters:
contentHandler
- the content handlerparameters
- the parametersfacets
- The facetsuserFacets
- The user input facetssearchResults
- The search resultscontextualParameters
- The contextual parameters- Throws:
SAXException
- if an error occurs while SAXing
-
saxFacet
protected void saxFacet(ContentHandler contentHandler, I18nizableText facetLabel, String value, Integer count, List<String> selectedFacets) throws SAXException SAX the facet- Parameters:
contentHandler
- the content handlerfacetLabel
- the facet labelvalue
- the value for the current facet itemcount
- the value countselectedFacets
- the facets selected by the user- Throws:
SAXException
- if an error occurs while generating SAX events
-
saxSorts
protected void saxSorts(ContentHandler contentHandler, Parameters parameters, List<Pair<SearchServiceSortDefinition, SortOrder>> initialSorts, Collection<SearchServiceSortDefinition> sortsToPropose, List<Pair<String, throws SAXExceptionSortOrder>> userSorts) SAX the sorts- Parameters:
contentHandler
- the content handlerparameters
- the parametersinitialSorts
- The initial sortssortsToPropose
- The sorts to proposeuserSorts
- The user input sorts- Throws:
SAXException
- if an error occurs while SAXing
-