Interface SearchServiceCriterionDefinition<T>
- Type Parameters:
T
- Type of the criterion value
- All Superinterfaces:
Comparable<ModelItem>
,CriterionDefinition<T>
,ElementDefinition<T>
,Labelable
,ModelItem
,ModifiableLabelable
- All Known Implementing Classes:
AbstractSearchServiceCriterionDefinition
,ContentReferencingSearchServiceCriterionDefinition
,DegreeUniversityCriterionDefinition
,DublinCoreCriterionDefinition
,PageCriterionDefinition
,PageTitleCriterionDefinition
,ReferencingSearchServiceCriterionDefinition
,ResourceFormatCriterionDefinition
,SiteCriterionDefinition
,SitemapCriterionDefinition
,TagCriterionDefinition
,TitleOrWordingCriterionDefinition
,WordingCriterionDefinition
A potential criterion definition proposed to the creator of an instance of search service.
-
Field Summary
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
-
Method Summary
Modifier and TypeMethodDescriptiondefault T
convertRestrictedValue
(Object value) Converts the given value forRestrictedEnumerator
default String
facetValueToSAX
(String value, Map<String, Object> contextualParameters) Retrieves the facet value to use for SAX eventsdefault List
<I18nizableText> Gets 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 emptygetRestrictedEnumerator
(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 enumeratedvoid
setSearchable
(Searchable searchable) Sets the (Searchable
) the criterion belongs to.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
-
Method Details
-
getContextPrefixLabels
Gets the prefix labels, sometimes useful (such as for displaying all criterion definitions) for grouping information.- Returns:
- The prefix labels (can be empty)
-
getSearchable
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.- Returns:
- the (
Searchable
) the criterion belongs to.
-
setSearchable
Sets the (Searchable
) the criterion belongs to.- Parameters:
searchable
- theSearchable
to set
-
isEnumerated
boolean isEnumerated()Determines if this criterion definition is enumerated- Returns:
true
if this criterion definition is enumerated,false
otherwise
-
getRestrictedEnumerator
Gets theRestrictedEnumerator
used by the final user to fill the criterion. Values of thisEnumerator
can be restricted according to entered values during service configuration- Parameters:
contextualParameters
- The contextual parameters- Returns:
- the enumerated entries
-
convertRestrictedValue
Converts the given value forRestrictedEnumerator
- Parameters:
value
- the value to convert- Returns:
- the converted value
-
getEmptyValueQuery
Gets the query for testing the value is empty- Parameters:
language
- The current search language.contextualParameters
- the search contextual parameters.- Returns:
- the query for testing the value is empty
-
facetValueToSAX
Retrieves the facet value to use for SAX events- Parameters:
value
- the facet valuecontextualParameters
- the contextual parameters- Returns:
- the facet value to use for SAX events
-