Class ContentSearchCriterionDefinition
java.lang.Object
org.ametys.runtime.parameter.Parameter<MetadataType>
org.ametys.web.frontoffice.search.metamodel.impl.AbstractDefaultSearchCriterionDefinition
org.ametys.web.frontoffice.search.metamodel.impl.ContentSearchCriterionDefinition
- All Implemented Interfaces:
SearchCriterionDefinition
- Direct Known Subclasses:
ContentAttributeContentSearchCriterionDefinition
,TagSearchCriterionDefinition
SearchCriterionDefinition
for ContentSearchable
proposing a search criterion (based on a SearchUICriterion
).-
Field Summary
Modifier and TypeFieldDescriptionprotected Optional<ContentType>
The content type on which this criterion definition applies.protected SearchUICriterion
The SearchUICriterion -
Constructor Summary
ConstructorDescriptionContentSearchCriterionDefinition
(String id, String pluginName, Optional<Searchable> searchable, SearchUICriterion criterion, Optional<ContentType> contentType, Optional<Validator> validator) Default constructor -
Method Summary
Modifier and TypeMethodDescriptionGets the prefix labels, sometimes useful (such as for displaying all criterion definitions) for grouping information.getEmptyValueQuery
(String language, Map<String, Object> contextualParameters) Gets the query for testing the value is emptygetQuery
(Object value, Query.Operator operator, String language, Map<String, Object> contextualParameters) Gets the query associated to the given valueGets theSearchUICriterion
associated to this definitiontoJSON()
Gets the JSON representation of this criterion definitionMethods inherited from class org.ametys.web.frontoffice.search.metamodel.impl.AbstractDefaultSearchCriterionDefinition
dispose, getEnumeratedValues, getSearchable, isEnumerated, isTooBigForStaticEnumerator
Methods inherited from class org.ametys.runtime.parameter.Parameter
getDefaultValue, getDescription, getEnumerator, getId, getLabel, getPluginName, getType, getValidator, getWidget, getWidgetParameters, setDefaultValue, setDescription, setEnumerator, setId, setLabel, setPluginName, setType, setValidator, setWidget, setWidgetParameters
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.web.frontoffice.search.metamodel.SearchCriterionDefinition
getId, getLabel, getType, getValidator, getWidget, getWidgetParameters
-
Field Details
-
_searchUICriterion
The SearchUICriterion -
_contentType
The content type on which this criterion definition applies. Can be empty if it applies to all types of contents.
-
-
Constructor Details
-
ContentSearchCriterionDefinition
public ContentSearchCriterionDefinition(String id, String pluginName, Optional<Searchable> searchable, SearchUICriterion criterion, Optional<ContentType> contentType, Optional<Validator> validator) Default constructor- Parameters:
id
- The idpluginName
- The plugin namesearchable
- theSearchable
criterion
- The linkedSearchUICriterion
contentType
- The content type on which this criterion definition applies. Can be empty if it applies to all types of contents.validator
- The validator
-
-
Method Details
-
getSearchUICriterion
Gets theSearchUICriterion
associated to this definition- Returns:
- the
SearchUICriterion
associated to this definition
-
getContextPrefixLabels
Description copied from interface:SearchCriterionDefinition
Gets the prefix labels, sometimes useful (such as for displaying all criterion definitions) for grouping information.- Returns:
- The prefix labels (can be empty)
-
toJSON
Description copied from interface:SearchCriterionDefinition
Gets the JSON representation of this criterion definition- Specified by:
toJSON
in interfaceSearchCriterionDefinition
- Overrides:
toJSON
in classAbstractDefaultSearchCriterionDefinition
- Returns:
- the JSON representation of this criterion definition
- Throws:
Exception
- if an exception occurs
-
getQuery
public Query getQuery(Object value, Query.Operator operator, String language, Map<String, Object> contextualParameters) Description copied from interface:SearchCriterionDefinition
Gets the query associated to the given value- Parameters:
value
- the valueoperator
- the operatorlanguage
- The current search language.contextualParameters
- the search contextual parameters.- Returns:
- the query associated to the given value
-
getEmptyValueQuery
Description copied from interface:SearchCriterionDefinition
Gets the query for testing the value is empty- Parameters:
language
- The current search language.contextualParameters
- the search contextual parameters.- Returns:
- the query for testing the value is empty
-