Class IndexingFieldSearchUICriterion
java.lang.Object
org.ametys.runtime.parameter.Parameter<MetadataType>
org.ametys.cms.search.ui.model.impl.AbstractSearchUICriterion
org.ametys.cms.search.ui.model.impl.IndexingFieldSearchUICriterion
- All Implemented Interfaces:
Field,IndexingFieldSearchCriterion,SearchCriterion,SearchUICriterion,LogEnabled,Disposable,Configurable,Contextualizable,Serviceable
public class IndexingFieldSearchUICriterion
extends AbstractSearchUICriterion
implements IndexingFieldSearchCriterion
This class is a search criteria on a metadata of a content
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContentTypesHelperThe helper for convenient methods on content typesprotected ElementDefinitionThe definition used for this criterionprotected StringThe field pathprotected StringThe field full pathprotected HierarchicalReferenceTablesHelperThe hierarchical reference tables helper.protected booleanIs it AND or OR for multiple metadataThe join pathsprotected Query.OperatorThe criteria operatorprotected AmetysObjectResolverThe ametys object resolver.protected ContentSearchHelperThe content search helper.protected UserHelperThe user helperprotected ThreadSafeComponentManager<Validator>ComponentManager forValidators.static final StringPrefix for id of metadata search criteriaFields inherited from class org.ametys.cms.search.ui.model.impl.AbstractSearchUICriterion
_contentHelper, _contentTypeExtensionPoint, _context, _enumeratorManager, _logger, _manager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(Configuration configuration) voiddispose()protected QuerygetBooleanQuery(Object value, String fieldPath, Query.Operator operator) Get a boolean query.protected QuerygetContentQuery(Object value, String language, String fieldPath, Query.Operator operator) Get a content query.protected QuerygetDateQuery(Object value, String fieldPath, Query.Operator operator) Get a date query.protected QuerygetDateTimeQuery(Object value, String fieldPath, Query.Operator operator) Get a dateTime query.protected QuerygetDoubleQuery(Object value, String fieldPath, Query.Operator operator) Get a double query.Get the field identifier.Get the path of field (separated by '/')protected QuerygetGeocodeQuery(Object value, String fieldPath, Query.Operator operator) Get a geocode query.Get the join paths, separated with slashes.protected QuerygetLongQuery(Object value, String fieldPath, Query.Operator operator) Get a long query.Get the operator.getQuery(Object value, Query.Operator customOperator, Map<String, Object> allValues, String language, Map<String, Object> contextualParameters) Get theQueryassociated to the given value.protected QuerygetRichTextQuery(Object value, String language, String fieldPath, Query.Operator operator, boolean isValueEscaped) Get a rich text query.Get theSearchFieldrepresenting this search criterion.protected QuerygetStringQuery(Object value, String language, String fieldPath, Query.Operator operator, boolean isValueEscaped) Get a string query.protected QuerygetTextQuery(Object value, String language, String fieldPath, Query.Operator operator, boolean isValueEscaped) Get a text query.protected QuerygetUserQuery(Object value, String fieldPath, Query.Operator operator) Get a user queryvoidservice(ServiceManager manager) Methods inherited from class org.ametys.cms.search.ui.model.impl.AbstractSearchUICriterion
_configureI18nizableText, _initializeValidator, configureEnumerator, configureEnumerator, configureId, configureLabelsAndGroup, configureUIProperties, configureValues, configureWidget, configureWidget, configureWidgetParameters, configureWidgetParameters, configureWidgetParameters, contextualize, getChangeClassName, getContentTypeId, getGroup, getInitClassName, getSubmitClassName, isHidden, isMultiple, setChangeClassName, setContentTypeId, setGroup, setHidden, setInitClassName, setLogger, setMultiple, setSubmitClassNameMethods inherited from class org.ametys.runtime.parameter.Parameter
getDefaultValue, getDescription, getEnumerator, getId, getLabel, getPluginName, getType, getValidator, getWidget, getWidgetParameters, setDefaultValue, setDescription, setEnumerator, setId, setLabel, setPluginName, setType, setValidator, setWidget, setWidgetParametersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.cms.search.model.Field
getContentTypeId, getEnumerator, getType, isMultipleMethods inherited from interface org.ametys.cms.search.model.SearchCriterion
getDescription, getId, getLabel, getQuery, isFacetable, isSortableMethods inherited from interface org.ametys.cms.search.ui.model.SearchUICriterion
getDefaultValue, getValidator, getWidget, getWidgetParameters
-
Field Details
-
SEARCH_CRITERIA_METADATA_PREFIX
Prefix for id of metadata search criteria- See Also:
-
_searchHelper
The content search helper. -
_hierarchicalReferenceTablesHelper
The hierarchical reference tables helper. -
_userHelper
The user helper -
_contentTypesHelper
The helper for convenient methods on content types -
_resolver
The ametys object resolver. -
_operator
The criteria operator -
_definition
The definition used for this criterion -
_fullPath
The field full path -
_fieldPath
The field path -
_joinPaths
The join paths -
_isMultipleOperandAnd
Is it AND or OR for multiple metadata -
_validatorManager
ComponentManager forValidators.
-
-
Constructor Details
-
IndexingFieldSearchUICriterion
public IndexingFieldSearchUICriterion()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractSearchUICriterion- Throws:
ServiceException
-
dispose
- Specified by:
disposein interfaceDisposable- Overrides:
disposein classAbstractSearchUICriterion
-
configure
- Specified by:
configurein interfaceConfigurable- Overrides:
configurein classAbstractSearchUICriterion- Throws:
ConfigurationException
-
getOperator
Get the operator.- Specified by:
getOperatorin interfaceSearchCriterion- Returns:
- the operator.
-
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.
-
getFieldPath
Get the path of field (separated by '/')- Specified by:
getFieldPathin interfaceIndexingFieldSearchCriterion- Returns:
- the path of the field.
-
getJoinPaths
Get the join paths, separated with slashes.- Specified by:
getJoinPathsin interfaceIndexingFieldSearchCriterion- Returns:
- the join paths.
-
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.
-
getStringQuery
protected Query getStringQuery(Object value, String language, String fieldPath, Query.Operator operator, boolean isValueEscaped) Get a string query.- Parameters:
value- The value to use for this criterion.language- The search language.fieldPath- The field path.operator- The query operator to use.isValueEscaped-trueif the given value is already escaped- Returns:
- The query.
-
getBooleanQuery
Get a boolean query.- Parameters:
value- The value to use for this criterion.fieldPath- The field path.operator- The query operator to use.- Returns:
- The query.
-
getDoubleQuery
Get a double query.- Parameters:
value- The value to use for this criterion.fieldPath- The field path.operator- The query operator to use.- Returns:
- The query.
-
getLongQuery
Get a long query.- Parameters:
value- The value to use for this criterion.fieldPath- The field path.operator- The query operator to use.- Returns:
- The query.
-
getDateQuery
Get a date query.- Parameters:
value- The value to use for this criterion.fieldPath- The field path.operator- The query operator to use.- Returns:
- The query.
-
getDateTimeQuery
Get a dateTime query.- Parameters:
value- The value to use for this criterion.fieldPath- The field path.operator- The query operator to use.- Returns:
- The query.
-
getContentQuery
protected Query getContentQuery(Object value, String language, String fieldPath, Query.Operator operator) Get a content query.- Parameters:
value- The value to use for this criterion.language- The search language.fieldPath- The field path.operator- The query operator to use.- Returns:
- The query.
-
getUserQuery
Get a user query- Parameters:
value- The value to use for this criterion.fieldPath- The field path.operator- The query operator to use.- Returns:
- The query.
-
getGeocodeQuery
Get a geocode query.- Parameters:
value- The value to use for this criterion.fieldPath- The field path.operator- The query operator to use.- Returns:
- The query.
-
getRichTextQuery
protected Query getRichTextQuery(Object value, String language, String fieldPath, Query.Operator operator, boolean isValueEscaped) Get a rich text query.- Parameters:
value- The value to use for this criterion.language- The search language.fieldPath- The field path.operator- The query operator to use.isValueEscaped-trueif the given value is already escaped- Returns:
- The query.
-
getTextQuery
protected Query getTextQuery(Object value, String language, String fieldPath, Query.Operator operator, boolean isValueEscaped) Get a text query.- Parameters:
value- The value to use for this criterion.language- The search language.fieldPath- The field path.operator- The query operator to use.isValueEscaped-trueif the given value is already escaped- Returns:
- The query.
-
getSearchField
Description copied from interface:SearchCriterionGet theSearchFieldrepresenting this search criterion.- Specified by:
getSearchFieldin interfaceSearchCriterion- Overrides:
getSearchFieldin classAbstractSearchUICriterion- Returns:
- the
SearchFieldrepresenting this search criterion.
-