Class AbstractDefaultSearchCriterionDefinition
java.lang.Object
org.ametys.runtime.parameter.Parameter<MetadataType>
org.ametys.web.frontoffice.search.metamodel.impl.AbstractDefaultSearchCriterionDefinition
- All Implemented Interfaces:
SearchCriterionDefinition
- Direct Known Subclasses:
ContentSearchCriterionDefinition
,DublinCoreSearchCriterionDefinition
,PageSearchCriterionDefinition
,PageTitleSearchCriterionDefinition
,SitemapSearchCriterionDefinition
,SiteSearchCriterionDefinition
,WordingSearchCriterionDefinition
public abstract class AbstractDefaultSearchCriterionDefinition
extends Parameter<MetadataType>
implements SearchCriterionDefinition
Default implementation of
SearchCriterionDefinition
-
Constructor Summary
ConstructorDescriptionAbstractDefaultSearchCriterionDefinition
(String id, String pluginName, I18nizableText label, MetadataType type, Optional<String> widget, Optional<Map<String, I18nizableText>> widgetParams, Optional<Enumerator> enumerator, Optional<Validator> validator, Optional<Object> defaultValue, Optional<Searchable> searchable) Constructs aSearchCriterionDefinition
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
dispose()
Releases and destroys any resource it owns.getEnumeratedValues
(Map<String, Object> contextualParameters) Gets the enumerated entries.Gets the (Searchable
) the criterion belongs to.boolean
Returnstrue
if this criterion definition is enumeratedboolean
Returnstrue
if this criterion definition is enumerated but can contains too much datatoJSON()
Gets the JSON representation of this criterion definitionMethods 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
getContextPrefixLabels, getEmptyValueQuery, getId, getLabel, getQuery, getType, getValidator, getWidget, getWidgetParameters
-
Constructor Details
-
AbstractDefaultSearchCriterionDefinition
public AbstractDefaultSearchCriterionDefinition(String id, String pluginName, I18nizableText label, MetadataType type, Optional<String> widget, Optional<Map<String, I18nizableText>> widgetParams, Optional<Enumerator> enumerator, Optional<Validator> validator, Optional<Object> defaultValue, Optional<Searchable> searchable) Constructs aSearchCriterionDefinition
- Parameters:
id
- The idpluginName
- The plugin namelabel
- The labeltype
- The typewidget
- The widgetwidgetParams
- The widget parametersenumerator
- The enumeratorvalidator
- The validatordefaultValue
- The default valuesearchable
- theSearchable
-
-
Method Details
-
getSearchable
Description copied from interface:SearchCriterionDefinition
Gets the (Searchable
) the criterion belongs to.
Important: if the criterion definition is brought by a specific Searchable, then this searchable must be returned in a non-emptyOptional
. If the criterion definition is brought bySearchServiceCommonImpls
, then anOptional.empty()
must be returned.- Specified by:
getSearchable
in interfaceSearchCriterionDefinition
- Returns:
- the (
Searchable
) the criterion belongs to.
-
isEnumerated
Description copied from interface:SearchCriterionDefinition
Returnstrue
if this criterion definition is enumerated- Specified by:
isEnumerated
in interfaceSearchCriterionDefinition
- Returns:
true
if this criterion definition is enumerated
-
isTooBigForStaticEnumerator
Description copied from interface:SearchCriterionDefinition
Returnstrue
if this criterion definition is enumerated but can contains too much data- Specified by:
isTooBigForStaticEnumerator
in interfaceSearchCriterionDefinition
- Returns:
true
if this criterion definition is enumerated but can contains too much data
-
getEnumeratedValues
Description copied from interface:SearchCriterionDefinition
Gets the enumerated entries.
Must be non-empty
ifSearchCriterionDefinition.isEnumerated()
returnstrue
.- Specified by:
getEnumeratedValues
in interfaceSearchCriterionDefinition
- Parameters:
contextualParameters
- The contextual parameters- Returns:
- the enumerated entries
-
toJSON
Description copied from interface:SearchCriterionDefinition
Gets the JSON representation of this criterion definition- Specified by:
toJSON
in interfaceSearchCriterionDefinition
- Returns:
- the JSON representation of this criterion definition
- Throws:
Exception
- if an exception occurs
-
dispose
Releases and destroys any resource it owns.
-