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 ModelItemTypeExtensionPoint
The extension point containing all available criterion typesprotected SearchServiceCriterionDefinitionHelper
The search service criterion definition helperFields inherited from class org.ametys.cms.search.model.impl.AbstractCriterionDefinition
_criterionDefinitionHelper, _joinedPaths, _multipleOperandOperator, _solrFacetFieldName
Fields inherited from class org.ametys.runtime.model.DefaultElementDefinition
_logger
Fields inherited from class org.ametys.runtime.model.AbstractModelItem
__context, __serviceManager
Fields inherited from interface org.ametys.runtime.model.ElementDefinition
CONFIG_DEFAULT_VALUE_TYPE
Fields inherited from interface org.ametys.runtime.model.ModelItem
ITEM_PATH_SEPARATOR
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ModelItemTypeExtensionPoint
Retrieves theModelItemTypeExtensionPoint
for available criterion typesprotected SearchServiceCriterionDefinitionHelper
Retrieves the search service criterion definition helper_toJSON
(DefinitionContext context) Converts the model item in a JSON mapprotected void
dispose()
Releases and destroys any resource it owns.getRestrictedEnumerator
(Map<String, Object> contextualParameters) Gets theRestrictedEnumerator
used by the final user to fill the criterion.Gets the (Searchable
) the criterion belongs to.boolean
Determines if this criterion definition is enumeratedprotected boolean
Determines if the current criterion definition is enumerated but can contain too much datavoid
setSearchable
(Searchable searchable) Sets the (Searchable
) the criterion belongs to.Methods inherited from class org.ametys.cms.search.model.impl.AbstractCriterionDefinition
_defaultValueToJSON, _getCriterionDefinitionHelper, _getDefaultWidget, _getDefaultWidgetParameters, convertQueryValue, getJoinedPaths, getMultipleOperandOperator, getQuery, getQueryContext, getSolrFacetFieldName, getType, getWidget, getWidgetParameters, setJoinedPaths, setSolrFacetFieldName
Methods inherited from class org.ametys.runtime.model.DefaultElementDefinition
_getDefaultValues, _widgetToJSON, _widgetToSAX, getCustomEnumerator, getCustomValidator, getDefaultValue, getEnumerator, getEnumeratorConfiguration, getParsedDefaultValues, getValidator, getValidatorConfiguration, isMultiple, of, setCustomEnumerator, setCustomValidator, setDefaultValue, setEnumerator, setEnumeratorConfiguration, setMultiple, setParsedDefaultValues, setType, setValidator, setValidatorConfiguration, setWidget, setWidgetParameters, toSAX
Methods 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, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface org.ametys.cms.search.model.CriterionDefinition
convertQueryValue, getJoinedPaths, getQuery, getQuery, getQuery, getSolrFacetFieldName, getType
Methods 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, setValidatorConfiguration
Methods inherited from interface org.ametys.runtime.util.Labelable
getDescription, getLabel, getName
Methods 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, toSAX
Methods inherited from interface org.ametys.runtime.util.ModifiableLabelable
setDescription, setLabel, setName
Methods 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:SearchServiceCriterionDefinition
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 interfaceSearchServiceCriterionDefinition<T>
- Returns:
- the (
Searchable
) the criterion belongs to.
-
setSearchable
Description copied from interface:SearchServiceCriterionDefinition
Sets the (Searchable
) the criterion belongs to.- Specified by:
setSearchable
in interfaceSearchServiceCriterionDefinition<T>
- Parameters:
searchable
- theSearchable
to set
-
isEnumerated
Description copied from interface:SearchServiceCriterionDefinition
Determines if this criterion definition is enumerated- Specified by:
isEnumerated
in interfaceSearchServiceCriterionDefinition<T>
- Returns:
true
if this criterion definition is enumerated,false
otherwise
-
isTooBigForStaticEnumerator
Determines if the current criterion definition is enumerated but can contain too much data- Returns:
true
if the criterion definition can contain too much data,false
otherwise
-
getRestrictedEnumerator
Description copied from interface:SearchServiceCriterionDefinition
Gets theRestrictedEnumerator
used by the final user to fill the criterion. Values of thisEnumerator
can be restricted according to entered values during service configuration- Specified by:
getRestrictedEnumerator
in interfaceSearchServiceCriterionDefinition<T>
- Parameters:
contextualParameters
- The contextual parameters- Returns:
- the enumerated entries
-
_toJSON
Description copied from class:AbstractModelItem
Converts the model item in a JSON map- Overrides:
_toJSON
in 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 theModelItemTypeExtensionPoint
for available criterion types- Returns:
- the
ModelItemTypeExtensionPoint
for available criterion types
-
_getSearchServiceCriterionDefinitionHelper
Retrieves the search service criterion definition helper- Returns:
- the search service criterion definition helper
-