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 ContentTypeExtensionPointThe content type extension pointprotected ContentTypesHelperThe helper for convenient methods on content typesprotected ContextThe avalon contextprotected List<SearchModelCriterionDefinition<T>> The aggregated criteriaprotected ServiceManagerThe service managerprotected SearchModelCriterionDefinitionHelperThe helper for search model criterion definitionprotected Stringthe criterion type identifierstatic final StringPrefix for name of referencing aggregator criterion definitionFields inherited from class org.ametys.cms.search.model.impl.AbstractStaticSearchModelCriterionDefinition
_criterionTypeExtensionPointFields inherited from class org.ametys.cms.search.model.impl.DefaultSearchModelCriterionDefinition
_operatorFields 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
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 identifiervoidconfigure(Configuration configuration) voidcontextualize(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 theQueryassociated to the given value.protected StringRetrieves the id of the property's typevoidservice(ServiceManager manager) protected voidsetCriteria(List<SearchModelCriterionDefinition<T>> criteria) Set the criteria to aggregate.voidSets the model of the elementMethods inherited from class org.ametys.cms.search.model.impl.AbstractStaticSearchModelCriterionDefinition
getType, setMultipleOperandOperator, setOperatorMethods inherited from class org.ametys.cms.search.model.impl.DefaultSearchModelCriterionDefinition
_getDefaultOperator, _toJSON, copyTo, getModel, toSAXMethods inherited from class org.ametys.cms.search.model.impl.AbstractCriterionDefinition
_getCriterionDefinitionHelper, _getDefaultWidget, convertQueryValue, getJoinedPaths, getMultipleOperandOperator, getQueryContext, getSolrFacetFieldName, getWidget, getWidgetParameters, setJoinedPaths, setSolrFacetFieldNameMethods inherited from class org.ametys.runtime.model.DefaultElementDefinition
_defaultValueToJSON, _getDefaultValues, _getSimpleDefaultValue, _widgetToJSON, _widgetToSAX, getCustomEnumerator, getCustomValidator, getDefaultValue, getEnumerator, getEnumeratorConfiguration, getParsedDefaultValues, getValidator, getValidatorConfiguration, isMultiple, of, setCustomEnumerator, setCustomValidator, setDefaultValue, setEnumerator, setEnumeratorConfiguration, setMultiple, setParsedDefaultValues, setType, setValidator, setValidatorConfiguration, setWidget, setWidgetParametersMethods 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, 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, getSolrFacetFieldNameMethods 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, setValidatorConfigurationMethods inherited from interface org.ametys.runtime.util.Labelable
getDescription, getLabelMethods inherited from interface org.ametys.runtime.model.ModelItem
addItemChecker, getDisableConditions, getItemCheckers, getParent, getPath, getPluginName, getWidget, getWidgetParameters, setDisableConditions, setParent, setPluginName, setType, setWidget, setWidgetParameters, toJSONMethods 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:
contextualizein interfaceContextualizable- Throws:
ContextException
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractStaticSearchModelCriterionDefinition<T>- Throws:
ServiceException
-
configure
- Specified by:
configurein interfaceConfigurable- Overrides:
configurein 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:CriterionDefinitionGet theQueryassociated to the given value.- Specified by:
getQueryin interfaceCriterionDefinition<T>- Overrides:
getQueryin 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.nullto 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:
Queryassociated to the given value.
-
getName
Description copied from interface:LabelableGet the name.- Specified by:
getNamein interfaceLabelable- Overrides:
getNamein 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:ModelItemSets the model of the element- Specified by:
setModelin interfaceModelItem- Overrides:
setModelin classAbstractModelItem- Parameters:
model- the model to set
-
_getDefaultWidgetParameters
Description copied from class:AbstractCriterionDefinitionRetrieves the default widget parameters for the criterion- Overrides:
_getDefaultWidgetParametersin classAbstractCriterionDefinition<T>- Returns:
- the default widget parameters for the criterion
-
getOperator
Description copied from interface:SearchModelCriterionDefinitionGet the criterion Operator.- Specified by:
getOperatorin interfaceSearchModelCriterionDefinition<T>- Overrides:
getOperatorin 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:AbstractStaticSearchModelCriterionDefinitionRetrieves the id of the property's type- Specified by:
getTypeIdin classAbstractStaticSearchModelCriterionDefinition<T>- Returns:
- the id of the property's type
-