Class AbstractSearchServiceCriterionDefinition<T>
java.lang.Object
org.ametys.runtime.model.AbstractModelItem
org.ametys.runtime.model.DefaultElementDefinition<T>
org.ametys.cms.search.model.impl.AbstractCriterionDefinition<T>
org.ametys.web.frontoffice.search.metamodel.impl.AbstractSearchServiceCriterionDefinition<T>
- Type Parameters:
T- Type of the criterion value
- All Implemented Interfaces:
Comparable<ModelItem>,CriterionDefinition<T>,ElementDefinition<T>,ModelItem,Labelable,ModifiableLabelable,SearchServiceCriterionDefinition<T>
- Direct Known Subclasses:
DublinCoreCriterionDefinition,PageCriterionDefinition,PageTitleCriterionDefinition,SiteCriterionDefinition,SitemapCriterionDefinition,WordingCriterionDefinition
public abstract class AbstractSearchServiceCriterionDefinition<T>
extends AbstractCriterionDefinition<T>
implements SearchServiceCriterionDefinition<T>
Default implementation of
SearchServiceCriterionDefinition-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ModelItemTypeExtensionPointThe extension point containing all available criterion typesprotected SearchServiceCriterionDefinitionHelperThe search service criterion definition helperFields inherited from class org.ametys.cms.search.model.impl.AbstractCriterionDefinition
_criterionDefinitionHelper, _joinedPaths, _multipleOperandOperator, _solrFacetFieldNameFields inherited from class org.ametys.runtime.model.DefaultElementDefinition
_loggerFields inherited from class org.ametys.runtime.model.AbstractModelItem
__context, __serviceManagerFields inherited from interface org.ametys.runtime.model.ElementDefinition
CONFIG_DEFAULT_VALUE_TYPEFields inherited from interface org.ametys.runtime.model.ModelItem
ITEM_PATH_SEPARATOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ModelItemTypeExtensionPointRetrieves theModelItemTypeExtensionPointfor available criterion typesprotected SearchServiceCriterionDefinitionHelperRetrieves the search service criterion definition helper_toJSON(DefinitionContext context) Converts the model item in a JSON mapprotected voiddispose()Releases and destroys any resource it owns.getRestrictedEnumerator(Map<String, Object> contextualParameters) Gets theRestrictedEnumeratorused by the final user to fill the criterion.Gets the (Searchable) the criterion belongs to.booleanDetermines if this criterion definition is enumeratedprotected booleanDetermines if the current criterion definition is enumerated but can contain too much datavoidsetSearchable(Searchable searchable) Sets the (Searchable) the criterion belongs to.Methods inherited from class org.ametys.cms.search.model.impl.AbstractCriterionDefinition
_getCriterionDefinitionHelper, _getDefaultWidget, _getDefaultWidgetParameters, convertQueryValue, getJoinedPaths, getMultipleOperandOperator, getQuery, getQueryContext, getSolrFacetFieldName, getType, getWidget, getWidgetParameters, setJoinedPaths, setSolrFacetFieldNameMethods inherited from class org.ametys.runtime.model.DefaultElementDefinition
_defaultValueToJSON, _getDefaultValues, _getSimpleDefaultValue, _widgetToJSON, _widgetToSAX, getCustomEnumerator, getCustomValidator, getDefaultValue, getEnumerator, getEnumeratorConfiguration, getParsedDefaultValues, getValidator, getValidatorConfiguration, isMultiple, of, setCustomEnumerator, setCustomValidator, setDefaultValue, setEnumerator, setEnumeratorConfiguration, setMultiple, setParsedDefaultValues, setType, setValidator, setValidatorConfiguration, setWidget, setWidgetParameters, toSAXMethods inherited from class org.ametys.runtime.model.AbstractModelItem
_getModelItemHelper, _shouldJSONBeEmpty, _widgetParameterToSAX, addItemChecker, compareTo, disableConditionsToJSON, equals, getDescription, getDisableConditions, getItemCheckers, getLabel, getModel, getName, getParent, getPath, getPluginName, hashCode, setContext, setDescription, setDisableConditions, setLabel, setModel, setName, setParent, setPluginName, setServiceManager, toJSON, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface org.ametys.cms.search.model.CriterionDefinition
convertQueryValue, getJoinedPaths, getQuery, getQuery, getQuery, getSolrFacetFieldName, getTypeMethods inherited from interface org.ametys.runtime.model.ElementDefinition
getCustomEnumerator, getCustomValidator, getDefaultValue, getEnumerator, getEnumeratorConfiguration, getParsedDefaultValues, getValidator, getValidatorConfiguration, isEditable, isMultiple, setCustomEnumerator, setCustomValidator, setDefaultValue, setEnumerator, setEnumeratorConfiguration, setMultiple, setParsedDefaultValues, setValidator, setValidatorConfigurationMethods inherited from interface org.ametys.runtime.util.Labelable
getDescription, getLabel, getNameMethods inherited from interface org.ametys.runtime.model.ModelItem
addItemChecker, getDisableConditions, getItemCheckers, getModel, getParent, getPath, getPluginName, getWidget, getWidgetParameters, setDisableConditions, setModel, setParent, setPluginName, setType, setWidget, setWidgetParameters, toJSON, toSAXMethods inherited from interface org.ametys.runtime.util.ModifiableLabelable
setDescription, setLabel, setNameMethods inherited from interface org.ametys.web.frontoffice.search.metamodel.SearchServiceCriterionDefinition
convertRestrictedValue, facetValueToSAX, getContextPrefixLabels, getEmptyValueQuery
-
Field Details
-
_criterionTypeExtensionPoint
The extension point containing all available criterion types -
_searchServiceCriterionDefinitionHelper
The search service criterion definition helper
-
-
Constructor Details
-
AbstractSearchServiceCriterionDefinition
-
-
Method Details
-
getSearchable
Description copied from interface:SearchServiceCriterionDefinitionGets 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:
getSearchablein interfaceSearchServiceCriterionDefinition<T>- Returns:
- the (
Searchable) the criterion belongs to.
-
setSearchable
Description copied from interface:SearchServiceCriterionDefinitionSets the (Searchable) the criterion belongs to.- Specified by:
setSearchablein interfaceSearchServiceCriterionDefinition<T>- Parameters:
searchable- theSearchableto set
-
isEnumerated
Description copied from interface:SearchServiceCriterionDefinitionDetermines if this criterion definition is enumerated- Specified by:
isEnumeratedin interfaceSearchServiceCriterionDefinition<T>- Returns:
trueif this criterion definition is enumerated,falseotherwise
-
isTooBigForStaticEnumerator
Determines if the current criterion definition is enumerated but can contain too much data- Returns:
trueif the criterion definition can contain too much data,falseotherwise
-
getRestrictedEnumerator
Description copied from interface:SearchServiceCriterionDefinitionGets theRestrictedEnumeratorused by the final user to fill the criterion. Values of thisEnumeratorcan be restricted according to entered values during service configuration- Specified by:
getRestrictedEnumeratorin interfaceSearchServiceCriterionDefinition<T>- Parameters:
contextualParameters- The contextual parameters- Returns:
- the enumerated entries
-
_toJSON
Description copied from class:AbstractModelItemConverts the model item in a JSON map- Overrides:
_toJSONin classDefaultElementDefinition<T>- Parameters:
context- the context of the definition- Returns:
- The model item as a JSON map
-
dispose
Releases and destroys any resource it owns. -
_getCriterionTypeExtensionPoint
Retrieves theModelItemTypeExtensionPointfor available criterion types- Returns:
- the
ModelItemTypeExtensionPointfor available criterion types
-
_getSearchServiceCriterionDefinitionHelper
Retrieves the search service criterion definition helper- Returns:
- the search service criterion definition helper
-