public class IndexingFieldSearchUICriterion extends AbstractSearchUICriterion implements IndexingFieldSearchCriterion, Contextualizable, LogEnabled, Disposable
Modifier and Type | Field and Description |
---|---|
protected String |
_contentTypeId
The ID of the content type which contains the metadata.
|
private Context |
_context |
protected ThreadSafeComponentManager<Enumerator> |
_enumeratorManager
ComponentManager for
Enumerator s. |
protected String |
_fieldPath
The field path
|
protected String |
_fullPath
The field full path
|
protected HierarchicalReferenceTablesHelper |
_hierarchicalReferenceTablesHelper
The content search helper.
|
protected boolean |
_isMultipleOperandAnd
Is it AND or OR for multiple metadata
|
private boolean |
_isTypeContentWithMultilingualTitle |
protected List<String> |
_joinPaths
The join paths
|
private Logger |
_logger |
private ServiceManager |
_manager |
protected Query.Operator |
_operator
The criteria operator
|
protected ContentSearchHelper |
_searchHelper
The content search helper.
|
protected UserHelper |
_userHelper
The user helper
|
protected ThreadSafeComponentManager<Validator> |
_validatorManager
ComponentManager for
Validator s. |
static String |
SEARCH_CRITERIA_METADATA_PREFIX
Prefix for id of metadata search criteria
|
_contentHelper, _cTypeEP, _resolver, _userManager, _userPopulationDAO
Constructor and Description |
---|
IndexingFieldSearchUICriterion() |
Modifier and Type | Method and Description |
---|---|
private void |
_configureDescription(Configuration configuration,
IndexingField indexingField,
String fieldName,
MetadataDefinition definition) |
private void |
_configureLabel(Configuration configuration,
IndexingField indexingField,
String fieldName,
MetadataDefinition definition) |
private void |
_configureOperator(Configuration configuration,
MetadataDefinition definition)
Configure the criterion operator.
|
private void |
_configureTypeContentWithMultilingualTitle(MetadataDefinition finalDefinition) |
private Query |
_getSingleDateQuery(String value,
String fieldPath,
Query.Operator operator) |
void |
configure(Configuration configuration) |
void |
contextualize(Context context) |
void |
dispose() |
protected Query |
getBooleanQuery(Object value,
String fieldPath,
Query.Operator operator)
Get a boolean query.
|
protected Query |
getContentQuery(Object value,
String language,
String fieldPath,
Query.Operator operator)
Get a content query.
|
protected Query |
getDateQuery(Object value,
String fieldPath,
Query.Operator operator)
Get a date query.
|
protected Query |
getDoubleQuery(Object value,
String fieldPath,
Query.Operator operator)
Get a double query.
|
String |
getFieldId()
Get the field identifier.
|
String |
getFieldPath()
Get the path of field (separated by '/')
|
protected String |
getFieldPath(IndexingField indexingField,
String[] remainingPathSegments)
Get the field's path without join paths
|
List<String> |
getJoinPaths()
Get the join paths, separated with slashes.
|
protected Query |
getLongQuery(Object value,
String fieldPath,
Query.Operator operator)
Get a long query.
|
protected MetadataDefinition |
getMetadataDefinition(IndexingField indexingField,
String[] remainingPathSegments,
List<String> joinPaths)
Get the metadata definition from the indexing field.
|
Query.Operator |
getOperator()
Get the operator.
|
Query |
getQuery(Object value,
Query.Operator customOperator,
Map<String,Object> allValues,
String language,
Map<String,Object> contextualParameters)
Get the
Query associated to the given value. |
SearchField |
getSearchField()
Get the
SearchField representing this search criterion. |
protected Query |
getStringQuery(Object value,
String language,
String fieldPath,
Query.Operator operator,
boolean isValueEscaped)
Get a string query.
|
protected Query |
getUserQuery(Object value,
String fieldPath,
Query.Operator operator)
Get a user query
|
private static boolean |
isEmpty(Object value) |
void |
service(ServiceManager manager) |
void |
setLogger(Logger logger)
Called at creation time to provide a
Logger . |
_configureI18nizableText, _initializeValidator, configureId, configureLabelsAndGroup, configureUIProperties, configureValues, configureWidget, configureWidgetParameters, getChangeClassName, getContentTypeId, getFacetLabel, getGroup, getInitClassName, getMetadataDefinition, getSubmitClassName, isHidden, isMultiple, setChangeClassName, setContentTypeId, setGroup, setHidden, setInitClassName, setMultiple, setSubmitClassName
getDefaultValue, getDescription, getEnumerator, getId, getLabel, getPluginName, getType, getValidator, getWidget, getWidgetParameters, setDefaultValue, setDescription, setEnumerator, setId, setLabel, setPluginName, setType, setValidator, setWidget, setWidgetParameters
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getId, getQuery, isFacetable, isFacetable, isSortable, isSortable
getContentTypeId, getEnumerator, getType, isMultiple
getDefaultValue, getDescription, getLabel, getValidator, getWidget, getWidgetParameters
public static final String SEARCH_CRITERIA_METADATA_PREFIX
protected ContentSearchHelper _searchHelper
protected HierarchicalReferenceTablesHelper _hierarchicalReferenceTablesHelper
protected UserHelper _userHelper
protected Query.Operator _operator
protected String _fieldPath
protected List<String> _joinPaths
protected boolean _isMultipleOperandAnd
protected String _contentTypeId
protected ThreadSafeComponentManager<Validator> _validatorManager
Validator
s.protected ThreadSafeComponentManager<Enumerator> _enumeratorManager
Enumerator
s.private ServiceManager _manager
private boolean _isTypeContentWithMultilingualTitle
public IndexingFieldSearchUICriterion()
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void setLogger(Logger logger)
LogEnabled
Logger
.setLogger
in interface LogEnabled
logger
- a Logger
for messages.public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
service
in class AbstractSearchUICriterion
ServiceException
public void dispose()
dispose
in interface Disposable
public void configure(Configuration configuration) throws ConfigurationException
configure
in interface Configurable
configure
in class AbstractSearchUICriterion
ConfigurationException
public Query.Operator getOperator()
getOperator
in interface SearchCriterion
public String getFieldId()
SearchUICriterion
getFieldId
in interface SearchUICriterion
public String getFieldPath()
getFieldPath
in interface IndexingFieldSearchCriterion
public List<String> getJoinPaths()
getJoinPaths
in interface IndexingFieldSearchCriterion
public Query getQuery(Object value, Query.Operator customOperator, Map<String,Object> allValues, String language, Map<String,Object> contextualParameters)
SearchCriterion
Query
associated to the given value.getQuery
in interface SearchCriterion
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.Query
associated to the given value.protected Query getStringQuery(Object value, String language, String fieldPath, Query.Operator operator, boolean isValueEscaped)
value
- The value to use for this criterion.language
- The search language.fieldPath
- The field path.operator
- The query operator to use.isValueEscaped
- true
if the given value is already escapedprotected Query getBooleanQuery(Object value, String fieldPath, Query.Operator operator)
value
- The value to use for this criterion.fieldPath
- The field path.operator
- The query operator to use.protected Query getDoubleQuery(Object value, String fieldPath, Query.Operator operator)
value
- The value to use for this criterion.fieldPath
- The field path.operator
- The query operator to use.protected Query getLongQuery(Object value, String fieldPath, Query.Operator operator)
value
- The value to use for this criterion.fieldPath
- The field path.operator
- The query operator to use.protected Query getDateQuery(Object value, String fieldPath, Query.Operator operator)
value
- The value to use for this criterion.fieldPath
- The field path.operator
- The query operator to use.private Query _getSingleDateQuery(String value, String fieldPath, Query.Operator operator)
protected Query getContentQuery(Object value, String language, String fieldPath, Query.Operator operator)
value
- The value to use for this criterion.language
- The search language.fieldPath
- The field path.operator
- The query operator to use.protected Query getUserQuery(Object value, String fieldPath, Query.Operator operator)
value
- The value to use for this criterion.fieldPath
- The field path.operator
- The query operator to use.public SearchField getSearchField()
SearchCriterion
SearchField
representing this search criterion.getSearchField
in interface SearchCriterion
getSearchField
in class AbstractSearchUICriterion
SearchField
representing this search criterion.private void _configureTypeContentWithMultilingualTitle(MetadataDefinition finalDefinition)
private void _configureOperator(Configuration configuration, MetadataDefinition definition) throws ConfigurationException
configuration
- the global criterion configuration.definition
- the metadata definition.ConfigurationException
- if an error occurs.private void _configureLabel(Configuration configuration, IndexingField indexingField, String fieldName, MetadataDefinition definition)
private void _configureDescription(Configuration configuration, IndexingField indexingField, String fieldName, MetadataDefinition definition)
protected MetadataDefinition getMetadataDefinition(IndexingField indexingField, String[] remainingPathSegments, List<String> joinPaths) throws ConfigurationException
indexingField
- The initial indexing fieldremainingPathSegments
- The path to access the metadata or an another indexing field from the initial indexing fieldjoinPaths
- The consecutive's path in case of joint to access the field/metadataConfigurationException
- If an error occurs.protected String getFieldPath(IndexingField indexingField, String[] remainingPathSegments) throws ConfigurationException
indexingField
- The initial indexing fieldremainingPathSegments
- The path to access the metadata or an another indexing field from the initial indexing fieldConfigurationException
- If an error occurs.