Class SaxFormSearchComponent
- java.lang.Object
-
- org.ametys.web.frontoffice.search.requesttime.impl.SaxFormSearchComponent
-
- All Implemented Interfaces:
SearchComponent
public class SaxFormSearchComponent extends Object implements SearchComponent
SearchComponent
for saxing form
-
-
Field Summary
Fields Modifier and Type Field Description private static String
__IS_MINIMAL_FORM_SAX_PARAMETER_NAME
-
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 SaxFormSearchComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
_addAttributesForSelectedSort(AttributesImpl attrs, Sort.Order direction, int number)
private Map<String,Object>
_contextualParameters(Site currentSite)
void
execute(SearchComponentArguments args)
Executes the component.protected boolean
isMinimalFormSax(Parameters parameters)
Returnstrue
if the Generator is parameterized with a minimal form saxint
priority()
Get the priority of the component.protected void
saxEnumeratorEntries(ContentHandler contentHandler, FOSearchCriterion criterion, String language, Site currentSite)
SAXEnumerator
entriesprotected void
saxEnumeratorEntry(ContentHandler contentHandler, Map.Entry<Object,I18nizableText> enumeratorEntry)
SAXEnumerator
entryprotected void
saxFacets(ContentHandler contentHandler, Parameters parameters, Collection<FacetDefinition> facets, Map<String,List<String>> userFacets, Optional<SearchResults<AmetysObject>> searchResults, String currentLang)
SAX the facetsprotected void
saxFormFields(ContentHandler contentHandler, Parameters parameters, List<FOSearchCriterion> nonStaticCriteria, String language, Site currentSite)
SAX the form search criteriaprotected void
saxFormSingleValue(ContentHandler contentHandler, Attributes attrs, Object singleUserCriterion)
SAX a single value of a form search criterionprotected void
saxFormValue(ContentHandler contentHandler, Attributes attrs, Object userCriterion)
SAX the values of a form search criterionprotected void
saxFormValues(ContentHandler contentHandler, Parameters parameters, List<FOSearchCriterion> nonStaticCriteria, Map<String,Object> userCriteria)
SAX the form search criteria valuesprotected void
saxSorts(ContentHandler contentHandler, Parameters parameters, List<Pair<SortDefinition,Sort.Order>> initialSorts, Collection<SortDefinition> sortsToPropose, List<Pair<String,Sort.Order>> userSorts)
SAX the sortsboolean
supports(SearchComponentArguments args)
Returnstrue
if the component must beexecuted
.
-
-
-
Field Detail
-
__IS_MINIMAL_FORM_SAX_PARAMETER_NAME
private static final String __IS_MINIMAL_FORM_SAX_PARAMETER_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SaxFormSearchComponent
public SaxFormSearchComponent()
-
-
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
-
isMinimalFormSax
protected boolean isMinimalFormSax(Parameters parameters)
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<FOSearchCriterion> nonStaticCriteria, String language, Site currentSite) throws Exception
SAX the form search criteria
-
saxEnumeratorEntries
protected void saxEnumeratorEntries(ContentHandler contentHandler, FOSearchCriterion criterion, String language, Site currentSite) throws Exception
SAXEnumerator
entries
-
_contextualParameters
private Map<String,Object> _contextualParameters(Site currentSite)
-
saxEnumeratorEntry
protected void saxEnumeratorEntry(ContentHandler contentHandler, Map.Entry<Object,I18nizableText> enumeratorEntry) throws Exception
SAXEnumerator
entry- Parameters:
contentHandler
- the content handlerenumeratorEntry
- the enumerator entry- Throws:
Exception
- if an exception occurs
-
saxFormValues
protected void saxFormValues(ContentHandler contentHandler, Parameters parameters, List<FOSearchCriterion> nonStaticCriteria, Map<String,Object> userCriteria) throws SAXException
SAX the form search 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 search 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 search 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<FacetDefinition> facets, Map<String,List<String>> userFacets, Optional<SearchResults<AmetysObject>> searchResults, String currentLang) throws SAXException
SAX the facets- Parameters:
contentHandler
- the content handlerparameters
- the parametersfacets
- The facetsuserFacets
- The user input facetssearchResults
- The search resultscurrentLang
- The current lang- Throws:
SAXException
- if an error occurs while SAXing
-
saxSorts
protected void saxSorts(ContentHandler contentHandler, Parameters parameters, List<Pair<SortDefinition,Sort.Order>> initialSorts, Collection<SortDefinition> sortsToPropose, List<Pair<String,Sort.Order>> userSorts) throws SAXException
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
-
_addAttributesForSelectedSort
private void _addAttributesForSelectedSort(AttributesImpl attrs, Sort.Order direction, int number)
-
-