Package org.ametys.cms.search.model.impl
Class ReferencingAggregatorCriterionDefinition<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.DefaultSearchModelCriterionDefinition<T>
org.ametys.cms.search.model.impl.AbstractStaticSearchModelCriterionDefinition<T>
org.ametys.cms.search.model.impl.ReferencingAggregatorCriterionDefinition<T>
- Type Parameters:
T
- Type of the criteria values
- All Implemented Interfaces:
Comparable<ModelItem>
,CriterionDefinition<T>
,SearchModelCriterionDefinition<T>
,ElementDefinition<T>
,ModelItem
,Labelable
,ModifiableLabelable
,Component
,Configurable
,Contextualizable
,Serviceable
public class ReferencingAggregatorCriterionDefinition<T>
extends AbstractStaticSearchModelCriterionDefinition<T>
implements Contextualizable
Aggregate multiple referencing criterion definitions as a unique criterion definition.
The resulting query is an OR query on all the terms.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContentTypeExtensionPoint
The content type extension pointprotected ContentTypesHelper
The helper for convenient methods on content typesprotected Context
The avalon contextprotected List
<SearchModelCriterionDefinition<T>> The aggregated criteriaprotected ServiceManager
The service managerprotected SearchModelCriterionDefinitionHelper
The helper for search model criterion definitionprotected String
the criterion type identifierstatic final String
Prefix for name of referencing aggregator criterion definitionFields inherited from class org.ametys.cms.search.model.impl.AbstractStaticSearchModelCriterionDefinition
_criterionTypeExtensionPoint
Fields inherited from class org.ametys.cms.search.model.impl.DefaultSearchModelCriterionDefinition
_operator
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Map
<String, I18nizableText> Retrieves the default widget parameters for the criterionprotected void
_setTypeId
(String typeId) Set the criterion's type identifiervoid
configure
(Configuration configuration) void
contextualize
(Context context) protected List
<SearchModelCriterionDefinition<T>> Retrieves the aggregated criteriagetName()
Get the name.Get the criterion Operator.getQuery
(Object value, Query.Operator customOperator, Map<String, Object> allValues, String language, Map<String, Object> contextualParameters) Get theQuery
associated to the given value.protected String
Retrieves the id of the property's typevoid
service
(ServiceManager manager) protected void
setCriteria
(List<SearchModelCriterionDefinition<T>> criteria) Set the criteria to aggregate.void
Sets the model of the elementMethods inherited from class org.ametys.cms.search.model.impl.AbstractStaticSearchModelCriterionDefinition
getType, setMultipleOperandOperator, setOperator
Methods inherited from class org.ametys.cms.search.model.impl.DefaultSearchModelCriterionDefinition
_getDefaultOperator, _toJSON, copyTo, getModel, toSAX
Methods inherited from class org.ametys.cms.search.model.impl.AbstractCriterionDefinition
_defaultValueToJSON, _getCriterionDefinitionHelper, _getDefaultWidget, convertQueryValue, getJoinedPaths, getMultipleOperandOperator, getQueryContext, getSolrFacetFieldName, 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
Methods inherited from class org.ametys.runtime.model.AbstractModelItem
_getModelItemHelper, _shouldJSONBeEmpty, _widgetParameterToSAX, addItemChecker, compareTo, disableConditionsToJSON, equals, getDescription, getDisableConditions, getItemCheckers, getLabel, getParent, getPath, getPluginName, hashCode, setContext, setDescription, setDisableConditions, setLabel, 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, getSolrFacetFieldName
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
Methods inherited from interface org.ametys.runtime.model.ModelItem
addItemChecker, getDisableConditions, getItemCheckers, getParent, getPath, getPluginName, getWidget, getWidgetParameters, setDisableConditions, setParent, setPluginName, setType, setWidget, setWidgetParameters, toJSON
Methods inherited from interface org.ametys.runtime.util.ModifiableLabelable
setDescription, setLabel, setName
-
Field Details
-
CRITERION_DEFINITION_AGGREGATOR_PREFIX
Prefix for name of referencing aggregator criterion definition- See Also:
-
_manager
The service manager -
_context
The avalon context -
_contentTypeExtensionPoint
The content type extension point -
_contentTypesHelper
The helper for convenient methods on content types -
_searchModelCriterionDefinitionHelper
The helper for search model criterion definition -
_criteria
The aggregated criteria -
_typeId
the criterion type identifier
-
-
Constructor Details
-
ReferencingAggregatorCriterionDefinition
-
-
Method Details
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractStaticSearchModelCriterionDefinition<T>
- Throws:
ServiceException
-
configure
- Specified by:
configure
in interfaceConfigurable
- Overrides:
configure
in classAbstractStaticSearchModelCriterionDefinition<T>
- Throws:
ConfigurationException
-
getQuery
public Query getQuery(Object value, Query.Operator customOperator, Map<String, Object> allValues, String language, Map<String, Object> contextualParameters) Description copied from interface:CriterionDefinition
Get theQuery
associated to the given value.- Specified by:
getQuery
in interfaceCriterionDefinition<T>
- Overrides:
getQuery
in classDefaultSearchModelCriterionDefinition<T>
- Parameters:
value
- The user-submitted value (or the default value if not set) for this criterion.customOperator
- In advanced search mode, the operator chosen by the user.null
to use the criterion-defined operator (simple search mode).allValues
- All the user-submitted values.language
- The current search language.contextualParameters
- the search contextual parameters.- Returns:
Query
associated to the given value.
-
getName
Description copied from interface:Labelable
Get the name.- Specified by:
getName
in interfaceLabelable
- Overrides:
getName
in classAbstractModelItem
- Returns:
- the name.
-
getCriteria
Retrieves the aggregated criteria- Returns:
- the aggregated criteria
-
setCriteria
Set the criteria to aggregate.- Parameters:
criteria
- the criteria to aggregate.
-
setModel
Description copied from interface:ModelItem
Sets the model of the element- Specified by:
setModel
in interfaceModelItem
- Overrides:
setModel
in classAbstractModelItem
- Parameters:
model
- the model to set
-
_getDefaultWidgetParameters
Description copied from class:AbstractCriterionDefinition
Retrieves the default widget parameters for the criterion- Overrides:
_getDefaultWidgetParameters
in classAbstractCriterionDefinition<T>
- Returns:
- the default widget parameters for the criterion
-
getOperator
Description copied from interface:SearchModelCriterionDefinition
Get the criterion Operator.- Specified by:
getOperator
in interfaceSearchModelCriterionDefinition<T>
- Overrides:
getOperator
in classDefaultSearchModelCriterionDefinition<T>
- Returns:
- the criterion Operator.
-
_setTypeId
Set the criterion's type identifier- Parameters:
typeId
- the type identifier to set
-
getTypeId
Description copied from class:AbstractStaticSearchModelCriterionDefinition
Retrieves the id of the property's type- Specified by:
getTypeId
in classAbstractStaticSearchModelCriterionDefinition<T>
- Returns:
- the id of the property's type
-