Class IndexingFieldAggregatorSearchUICriterion
- java.lang.Object
-
- org.ametys.runtime.parameter.Parameter<MetadataType>
-
- org.ametys.cms.search.ui.model.impl.AbstractSearchUICriterion
-
- org.ametys.cms.search.ui.model.impl.IndexingFieldAggregatorSearchUICriterion
-
- All Implemented Interfaces:
Field,SearchCriterion,SearchUICriterion,LogEnabled,Disposable,Configurable,Contextualizable,Serviceable
public class IndexingFieldAggregatorSearchUICriterion extends AbstractSearchUICriterion implements Contextualizable, Disposable, LogEnabled
Aggregate multiple indexing field as a unique search criteria. The resulting query is an OR query on all the terms.
-
-
Field Summary
Fields Modifier and Type Field Description protected ContentTypesHelper_contentTypesHelperThe helper for convenient methods on content typesprotected Context_contextThe context.protected ThreadSafeComponentManager<SearchUICriterion>_fieldCriteriaManagerComponentManager for aggregatedSearchUICriterions.protected Map<String,SearchUICriterion>_fieldCriteriaMapThe map of aggregated criteriaprotected org.slf4j.Logger_loggerThe loggerprotected ServiceManager_managerThe service managerprotected MetadataType_typeThe type of the aggregated fieldsstatic StringSEARCH_CRITERIA_METADATA_AGGREGATOR_PREFIXPrefix for id of indexing field aggregator search criteria-
Fields inherited from class org.ametys.cms.search.ui.model.impl.AbstractSearchUICriterion
_contentHelper, _cTypeEP, _resolver, _userManager, _userPopulationDAO
-
-
Constructor Summary
Constructors Constructor Description IndexingFieldAggregatorSearchUICriterion()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void_configureWidgetAndWidgetParameters(Configuration configuration)private List<Pair<String,Configuration>>_fieldSearchUICriterionToLookup(Configuration[] fieldConfs, MutableConfiguration baseConf)private void_initializeFieldCriteria(List<Pair<String,Configuration>> fieldSearchUICriterionToLookup, Configuration fieldsConf)voidconfigure(Configuration configuration)protected voidconfigureId(Configuration configuration)Configure the criterion ID.voidcontextualize(Context context)voiddispose()StringgetFieldId()Get the field identifier.Query.OperatorgetOperator()Get the criterion Operator.QuerygetQuery(Object value, Query.Operator customOperator, Map<String,Object> allValues, String language, Map<String,Object> contextualParameters)Get theQueryassociated to the given value.MetadataTypegetType()Retrieves the type.booleanisSortable()Test if the SearchCriterion is sortable.voidservice(ServiceManager manager)voidsetLogger(org.slf4j.Logger logger)Called at creation time to provide aLogger.-
Methods inherited from class org.ametys.cms.search.ui.model.impl.AbstractSearchUICriterion
_configureI18nizableText, _initializeValidator, configureLabelsAndGroup, configureUIProperties, configureValues, configureWidget, configureWidgetParameters, getChangeClassName, getContentTypeId, getFacetLabel, getGroup, getInitClassName, getMetadataDefinition, getSearchField, getSubmitClassName, isHidden, isMultiple, setChangeClassName, setContentTypeId, setGroup, setHidden, setInitClassName, setMultiple, setSubmitClassName
-
Methods inherited from class org.ametys.runtime.parameter.Parameter
getDefaultValue, getDescription, getEnumerator, getId, getLabel, getPluginName, getValidator, getWidget, getWidgetParameters, setDefaultValue, setDescription, setEnumerator, setId, setLabel, setPluginName, setType, setValidator, setWidget, setWidgetParameters
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ametys.cms.search.model.Field
getEnumerator
-
Methods inherited from interface org.ametys.cms.search.model.SearchCriterion
getId, getQuery, isFacetable
-
Methods inherited from interface org.ametys.cms.search.ui.model.SearchUICriterion
getDefaultValue, getDescription, getLabel, getValidator, getWidget, getWidgetParameters
-
-
-
-
Field Detail
-
SEARCH_CRITERIA_METADATA_AGGREGATOR_PREFIX
public static final String SEARCH_CRITERIA_METADATA_AGGREGATOR_PREFIX
Prefix for id of indexing field aggregator search criteria- See Also:
- Constant Field Values
-
_fieldCriteriaManager
protected ThreadSafeComponentManager<SearchUICriterion> _fieldCriteriaManager
ComponentManager for aggregatedSearchUICriterions.
-
_fieldCriteriaMap
protected Map<String,SearchUICriterion> _fieldCriteriaMap
The map of aggregated criteria
-
_logger
protected org.slf4j.Logger _logger
The logger
-
_manager
protected ServiceManager _manager
The service manager
-
_contentTypesHelper
protected ContentTypesHelper _contentTypesHelper
The helper for convenient methods on content types
-
_type
protected MetadataType _type
The type of the aggregated fields
-
-
Constructor Detail
-
IndexingFieldAggregatorSearchUICriterion
public IndexingFieldAggregatorSearchUICriterion()
-
-
Method Detail
-
setLogger
public void setLogger(org.slf4j.Logger logger)
Description copied from interface:LogEnabledCalled at creation time to provide aLogger.- Specified by:
setLoggerin interfaceLogEnabled- Parameters:
logger- aLoggerfor messages.
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractSearchUICriterion- Throws:
ServiceException
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configurein interfaceConfigurable- Overrides:
configurein classAbstractSearchUICriterion- Throws:
ConfigurationException
-
_fieldSearchUICriterionToLookup
private List<Pair<String,Configuration>> _fieldSearchUICriterionToLookup(Configuration[] fieldConfs, MutableConfiguration baseConf) throws ConfigurationException
- Throws:
ConfigurationException
-
_initializeFieldCriteria
private void _initializeFieldCriteria(List<Pair<String,Configuration>> fieldSearchUICriterionToLookup, Configuration fieldsConf) throws Exception
- Throws:
Exception
-
_configureWidgetAndWidgetParameters
private void _configureWidgetAndWidgetParameters(Configuration configuration) throws ConfigurationException
- Throws:
ConfigurationException
-
configureId
protected void configureId(Configuration configuration) throws ConfigurationException
Description copied from class:AbstractSearchUICriterionConfigure the criterion ID.- Overrides:
configureIdin classAbstractSearchUICriterion- Parameters:
configuration- The search criterion configuration.- Throws:
ConfigurationException- If an error occurs.
-
getType
public MetadataType getType()
Description copied from class:ParameterRetrieves the type.- Specified by:
getTypein interfaceField- Overrides:
getTypein classParameter<MetadataType>- Returns:
- the type.
-
getQuery
public Query getQuery(Object value, Query.Operator customOperator, Map<String,Object> allValues, String language, Map<String,Object> contextualParameters)
Description copied from interface:SearchCriterionGet theQueryassociated to the given value.- Specified by:
getQueryin interfaceSearchCriterion- 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.
-
dispose
public void dispose()
- Specified by:
disposein interfaceDisposable
-
getFieldId
public String getFieldId()
Description copied from interface:SearchUICriterionGet the field identifier. Used to match standard, advanced and faceted criterion (even if the operator is different), whatever their ID is.- Specified by:
getFieldIdin interfaceSearchUICriterion- Returns:
- the field identifier.
-
isSortable
public boolean isSortable()
Description copied from interface:SearchCriterionTest if the SearchCriterion is sortable.- Specified by:
isSortablein interfaceSearchCriterion- Returns:
trueif the criterion is sortable, false otherwise.
-
getOperator
public Query.Operator getOperator()
Description copied from interface:SearchCriterionGet the criterion Operator.- Specified by:
getOperatorin interfaceSearchCriterion- Returns:
- the criterion Operator.
-
-