Class ReferencingSearchServiceCriterionDefinition<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.cms.search.model.impl.ReferencingCriterionDefinition<T>
org.ametys.web.frontoffice.search.metamodel.impl.ReferencingSearchServiceCriterionDefinition<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:
ContentReferencingSearchServiceCriterionDefinition,TagCriterionDefinition
public class ReferencingSearchServiceCriterionDefinition<T>
extends ReferencingCriterionDefinition<T>
implements SearchServiceCriterionDefinition<T>
SearchServiceCriterionDefinition for ContentSearchable searching on a model item.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SearchServiceCriterionDefinitionHelperThe search service criterion definition helperFields inherited from class org.ametys.cms.search.model.impl.ReferencingCriterionDefinition
_contentSearchHelper, _contentTypeExtensionPoint, _contentTypeIds, _criterionTypeExtensionPoint, _reference, _referencePath, NONE_VALUEFields 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
ConstructorsConstructorDescriptionReferencingSearchServiceCriterionDefinition(ElementDefinition reference, String referencePath, ContentType baseContentType) Constructor used to create a FO criterion definition on a referenced item -
Method Summary
Modifier and TypeMethodDescriptionprotected SearchServiceCriterionDefinitionHelperRetrieves the search service criterion definition helper_toJSON(DefinitionContext context) Converts the model item in a JSON mapGets 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 emptygetFacetLabel(String value, Map<String, Object> contextualParameters) Get the label of a facet value.getRestrictedEnumerator(Map<String, Object> contextualParameters) Gets theRestrictedEnumeratorused by the final user to fill the criterion.Gets the (Searchable) the criterion belongs to.Retrieves the validator.booleanDetermines if this criterion definition is enumeratedbooleanTest if the element is multiple.protected 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.ReferencingCriterionDefinition
_getContentSearchHelper, _getContentTypeExtensionPoint, _getCriterionTypeExtensionPoint, _getDefaultEnumerator, _getDefaultWidget, _getDefaultWidgetParameters, _getFacetFieldNameSuffix, _getRootCriterionConfiguration, _isFacetable, convertQueryValue, getContentTypeIds, getDescription, getEnumerator, getJoinedPaths, getLabel, getQuery, getReference, getReferencePath, getSolrFacetFieldName, getType, setContentTypeIds, setReference, setReferencePathMethods inherited from class org.ametys.cms.search.model.impl.AbstractCriterionDefinition
_getCriterionDefinitionHelper, getMultipleOperandOperator, getQueryContext, getWidget, getWidgetParameters, setJoinedPaths, setSolrFacetFieldNameMethods inherited from class org.ametys.runtime.model.DefaultElementDefinition
_defaultValueToJSON, _getDefaultValues, _getSimpleDefaultValue, _widgetToJSON, _widgetToSAX, getCustomEnumerator, getCustomValidator, getDefaultValue, getEnumeratorConfiguration, getParsedDefaultValues, getValidatorConfiguration, 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, getDisableConditions, getItemCheckers, 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, getValidatorConfiguration, isEditable, 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
-
Field Details
-
_searchServiceCriterionDefinitionHelper
The search service criterion definition helper
-
-
Constructor Details
-
ReferencingSearchServiceCriterionDefinition
public ReferencingSearchServiceCriterionDefinition(ElementDefinition reference, String referencePath, ContentType baseContentType) Constructor used to create a FO criterion definition on a referenced item- Parameters:
reference- the item referenced by this criterionreferencePath- the path of the criterion's referencebaseContentType- the content type defining the reference
-
-
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
-
getFacetLabel
public Optional<I18nizableText> getFacetLabel(String value, Map<String, Object> contextualParameters) Get the label of a facet value.- Parameters:
value- the facet value.contextualParameters- the contextual parameters- Returns:
- the label, or null if the value does not exist.
-
getContextPrefixLabels
Description copied from interface:SearchServiceCriterionDefinitionGets the prefix labels, sometimes useful (such as for displaying all criterion definitions) for grouping information.- Specified by:
getContextPrefixLabelsin interfaceSearchServiceCriterionDefinition<T>- Returns:
- The prefix labels (can be empty)
-
isMultiple
Description copied from interface:ElementDefinitionTest if the element is multiple.- Specified by:
isMultiplein interfaceElementDefinition<T>- Overrides:
isMultiplein classDefaultElementDefinition<T>- Returns:
trueif the metadata is multiple.
-
getValidator
Description copied from interface:ElementDefinitionRetrieves the validator.- Specified by:
getValidatorin interfaceElementDefinition<T>- Overrides:
getValidatorin classDefaultElementDefinition<T>- Returns:
- the validator or
nullif none is defined.
-
getEmptyValueQuery
Description copied from interface:SearchServiceCriterionDefinitionGets the query for testing the value is empty- Specified by:
getEmptyValueQueryin interfaceSearchServiceCriterionDefinition<T>- Parameters:
language- The current search language.contextualParameters- the search contextual parameters.- Returns:
- the query for testing the value is empty
-
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
-
_getSearchServiceCriterionDefinitionHelper
Retrieves the search service criterion definition helper- Returns:
- the search service criterion definition helper
-