public class ContentSearchCriterionDefinition extends AbstractDefaultSearchCriterionDefinition
SearchCriterionDefinition
for ContentSearchable
proposing a search criterion (based on a SearchUICriterion
).Modifier and Type | Field and Description |
---|---|
protected Optional<ContentType> |
_contentType
The content type on which this criterion definition applies.
|
protected SearchUICriterion |
_searchUICriterion
The SearchUICriterion
|
Constructor and Description |
---|
ContentSearchCriterionDefinition(String id,
String pluginName,
Optional<Searchable> searchable,
SearchUICriterion criterion,
Optional<ContentType> contentType)
Default constructor
|
Modifier and Type | Method and Description |
---|---|
List<I18nizableText> |
getContextPrefixLabels()
Gets the prefix labels, sometimes useful (such as for displaying all criterion definitions) for grouping information.
|
Query |
getQuery(Object value,
Query.Operator operator,
String language,
Map<String,Object> contextualParameters)
Gets the query associated to the given value
|
SearchUICriterion |
getSearchUICriterion()
Gets the
SearchUICriterion associated to this definition |
Map<String,Object> |
toJSON()
Gets the JSON representation of this criterion definition
|
dispose, getEnumeratedValues, getSearchable, isEnumerated
getDefaultValue, getDescription, getEnumerator, getId, getLabel, getPluginName, getType, getValidator, getWidget, getWidgetParameters, setDefaultValue, setDescription, setEnumerator, setId, setLabel, setPluginName, setType, setValidator, setWidget, setWidgetParameters
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getId, getLabel, getType, getValidator, getWidget, getWidgetParameters
protected SearchUICriterion _searchUICriterion
protected Optional<ContentType> _contentType
public ContentSearchCriterionDefinition(String id, String pluginName, Optional<Searchable> searchable, SearchUICriterion criterion, Optional<ContentType> contentType)
id
- The idpluginName
- The plugin namesearchable
- the Searchable
criterion
- The linked SearchUICriterion
contentType
- The content type on which this criterion definition applies. Can be empty if it applies to all types of contents.public SearchUICriterion getSearchUICriterion()
SearchUICriterion
associated to this definitionSearchUICriterion
associated to this definitionpublic List<I18nizableText> getContextPrefixLabels()
SearchCriterionDefinition
public Map<String,Object> toJSON() throws Exception
SearchCriterionDefinition
toJSON
in interface SearchCriterionDefinition
toJSON
in class AbstractDefaultSearchCriterionDefinition
Exception
- if an exception occurspublic Query getQuery(Object value, Query.Operator operator, String language, Map<String,Object> contextualParameters)
SearchCriterionDefinition
value
- the valueoperator
- the operatorlanguage
- The current search language.contextualParameters
- the search contextual parameters.