Package org.ametys.cms.search.model
Interface CriterionDefinitionAwareElementDefinition<T,C,X extends ModelAwareDataAwareAmetysObject>
- Type Parameters:
T
- Type of the element valueC
- Type of criterionX
- type of ametys object supported by this definition
- All Superinterfaces:
Comparable<ModelItem>
,ElementDefinition<T>
,IndexationAwareElementDefinition<T,
,X> Labelable
,ModelItem
,ModifiableLabelable
- All Known Implementing Classes:
AbstractDateTimeIndexableSystemProperty
,AbstractElementsReferencingProperty
,AbstractIndexableContentProperty
,AbstractIndexableProperty
,AbstractIndexableStaticProperty
,AbstractIndexableSystemProperty
,AbstractMultiTypedValuesProperty
,AbstractMultiValuesProperty
,AbstractUserIndexableSystemProperty
,CollectionsSystemProperty
,CommentsSystemProperty
,ComposedSingleModelItemsProperty
,ComputedStepHolderProperty
,ContainerMCCWorkflowStatusProperty
,ContentElementReferencingProperty
,ContentIdSystemProperty
,ContentPrivacySystemProperty
,ContentTypeSystemProperty
,ContributorSystemProperty
,CreationDateSystemProperty
,CreatorSystemProperty
,DegreeOrderProperty
,DegreeTypeProperty
,DisplayCodeProperty
,ElementReferencingProperty
,EnumeratingProperty
,FirstValidationSystemProperty
,FirstValidatorSystemProperty
,FulltextSystemProperty
,HasLiveVersionSystemProperty
,InvalidContainerDataProperty
,LanguageSystemProperty
,LastMajorValidationSystemProperty
,LastMajorValidatorSystemProperty
,LastModifiedSystemProperty
,LastValidationSystemProperty
,LastValidatorSystemProperty
,MemberProjectProperty
,MultiContentValuesProperty
,MultiStringValuesProperty
,NearestOrgUnitsProperty
,ODFPrimaryContentTypeProperty
,OrgUnitAncestorProperty
,OrphanSystemProperty
,OverridenThematicsProperty
,PagesSystemProperty
,ParentContentSystemProperty
,ParentProgramsProperty
,ParentSubProgramsProperty
,PinProperty
,ProfiledGroupsTagsSystemProperty
,ProgramMCCWorkflowStatusProperty
,SharedProperty
,SharedSystemProperty
,SiteSystemProperty
,SiteTypeSystemProperty
,SubProgramParentProgramProperty
,TagsSystemProperty
,TagsSystemProperty
,TrashElementSiteProperty
,ViewBasedFullTextSystemProperty
,WorkflowNameSystemProperty
,WorkflowStepSystemProperty
,WorkflowStepSystemProperty
public interface CriterionDefinitionAwareElementDefinition<T,C,X extends ModelAwareDataAwareAmetysObject>
extends IndexationAwareElementDefinition<T,X>
Interface for
ElementDefinition
supporting referencing criteria-
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 Object
Converts the given value to have the right typed value to give to thegetQuery(Object, Operator, String, Map)
methodGet the type to use when rendering the element as a criteriondefault Enumerator
<C> getDefaultCriterionEnumerator
(Configuration configuration, ThreadSafeComponentManager<Enumerator> enumeratorManager) Get the enumerator to use when rendering this item as a criterion, if no other enumerator is specified on criteriondefault Query.Operator
Get the operator to use when rendering this item as a criterion, if no other operator is specified on criteriondefault String
Get the widget to use when rendering this item as a criterion, if no other widget is specified on criteriondefault Map
<String, I18nizableText> getDefaultCriterionWidgetParameters
(Configuration configuration) Get the widget parameters to use when rendering this item as a criterion If some other parameters are specified on criterion, all parameters are used If a parameter with the same name is specified on criterion, this parameter is used, not the default onedefault Query
getQuery
(Object value, Query.Operator operator, String language, Map<String, Object> contextualParameters) Get theQuery
associated to the given value.Methods inherited from interface java.lang.Comparable
compareTo
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.cms.search.model.IndexationAwareElementDefinition
getSolrFacetFieldName, getSolrFieldName, getSolrSortFieldName, getType, getValue, indexValue, isFacetable, isSortable
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
-
getDefaultCriterionEnumerator
default Enumerator<C> getDefaultCriterionEnumerator(Configuration configuration, ThreadSafeComponentManager<Enumerator> enumeratorManager) throws ConfigurationException Get the enumerator to use when rendering this item as a criterion, if no other enumerator is specified on criterion- Parameters:
configuration
- The enumerator configuration.enumeratorManager
- ComponentManager for the criterion'sEnumerator
- Returns:
- The enumerator or
null
if there is no default enumerator for the criterion - Throws:
ConfigurationException
- If an error occurs while initializing the enumerator
-
getCriterionType
Get the type to use when rendering the element as a criterion- Returns:
- the type to use for a criterion
-
convertQueryValue
default Object convertQueryValue(Object value, String language, Map<String, Object> contextualParameters) throws BadItemTypeExceptionConverts the given value to have the right typed value to give to thegetQuery(Object, Operator, String, Map)
method- Parameters:
value
- the value to convertlanguage
- The current search language.contextualParameters
- the search contextual parameters.- Returns:
- the value, converted to a well typed value
- Throws:
BadItemTypeException
- if the given value can not be converted
-
getQuery
default Query getQuery(Object value, Query.Operator operator, String language, Map<String, Object> contextualParameters) Get theQuery
associated to the given value.- Parameters:
value
- the user-submitted value for this item.operator
- In advanced search mode, the operator chosen by the user.null
to use the criterion-defined operator (simple search mode).language
- The current search language.contextualParameters
- the search contextual parameters.- Returns:
- The
Query
associated to the given value.
-
getDefaultCriterionWidget
Get the widget to use when rendering this item as a criterion, if no other widget is specified on criterion- Returns:
- The widget to use, or
null
if no specific widget is necessary by default.
-
getDefaultCriterionWidgetParameters
Get the widget parameters to use when rendering this item as a criterion If some other parameters are specified on criterion, all parameters are used If a parameter with the same name is specified on criterion, this parameter is used, not the default one- Parameters:
configuration
- The widget parameters configuration- Returns:
- The default widget parameters to use, or an empty Map if no specific widget parameters are necessary by default.
-
getDefaultCriterionOperator
Get the operator to use when rendering this item as a criterion, if no other operator is specified on criterion- Returns:
- The default operator to use
-