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 SearchServiceCriterionDefinitionHelper
The search service criterion definition helperFields inherited from class org.ametys.cms.search.model.impl.ReferencingCriterionDefinition
_contentSearchHelper, _contentTypeExtensionPoint, _contentTypeIds, _criterionTypeExtensionPoint, _reference, _referencePath, NONE_VALUE
Fields 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
ConstructorsConstructorDescriptionReferencingSearchServiceCriterionDefinition
(ElementDefinition reference, String referencePath, ContentType baseContentType) Constructor used to create a FO criterion definition on a referenced item -
Method Summary
Modifier and TypeMethodDescriptionprotected SearchServiceCriterionDefinitionHelper
Retrieves 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 theRestrictedEnumerator
used by the final user to fill the criterion.Gets the (Searchable
) the criterion belongs to.Retrieves the validator.boolean
Determines if this criterion definition is enumeratedboolean
Test if the element is multiple.protected 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.ReferencingCriterionDefinition
_getContentSearchHelper, _getContentTypeExtensionPoint, _getCriterionTypeExtensionPoint, _getDefaultEnumerator, _getDefaultWidget, _getDefaultWidgetParameters, _getFacetFieldNameSuffix, _getRootCriterionConfiguration, _isFacetable, convertQueryValue, getContentTypeIds, getDescription, getEnumerator, getJoinedPaths, getLabel, getQuery, getReference, getReferencePath, getSolrFacetFieldName, getType, setContentTypeIds, setReference, setReferencePath
Methods inherited from class org.ametys.cms.search.model.impl.AbstractCriterionDefinition
_defaultValueToJSON, _getCriterionDefinitionHelper, getMultipleOperandOperator, getQueryContext, getWidget, getWidgetParameters, setJoinedPaths, setSolrFacetFieldName
Methods inherited from class org.ametys.runtime.model.DefaultElementDefinition
_getDefaultValues, _widgetToJSON, _widgetToSAX, getCustomEnumerator, getCustomValidator, getDefaultValue, getEnumeratorConfiguration, getParsedDefaultValues, getValidatorConfiguration, 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, getDisableConditions, getItemCheckers, 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, getValidatorConfiguration, isEditable, 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
-
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: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
-
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:SearchServiceCriterionDefinition
Gets the prefix labels, sometimes useful (such as for displaying all criterion definitions) for grouping information.- Specified by:
getContextPrefixLabels
in interfaceSearchServiceCriterionDefinition<T>
- Returns:
- The prefix labels (can be empty)
-
isMultiple
Description copied from interface:ElementDefinition
Test if the element is multiple.- Specified by:
isMultiple
in interfaceElementDefinition<T>
- Overrides:
isMultiple
in classDefaultElementDefinition<T>
- Returns:
true
if the metadata is multiple.
-
getValidator
Description copied from interface:ElementDefinition
Retrieves the validator.- Specified by:
getValidator
in interfaceElementDefinition<T>
- Overrides:
getValidator
in classDefaultElementDefinition<T>
- Returns:
- the validator or
null
if none is defined.
-
getEmptyValueQuery
Description copied from interface:SearchServiceCriterionDefinition
Gets the query for testing the value is empty- Specified by:
getEmptyValueQuery
in 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: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
-
_getSearchServiceCriterionDefinitionHelper
Retrieves the search service criterion definition helper- Returns:
- the search service criterion definition helper
-