Package org.ametys.cms.search.model.impl
Class StaticReferencingSearchModelCriterionDefinition<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.ReferencingCriterionDefinition<T>
org.ametys.cms.search.model.impl.ReferencingSearchModelCriterionDefinition<T>
org.ametys.cms.search.model.impl.StaticReferencingSearchModelCriterionDefinition<T>
- Type Parameters:
T- Type of the criterion value
- All Implemented Interfaces:
Comparable<ModelItem>,CriterionDefinition<T>,SearchModelCriterionDefinition<T>,ElementDefinition<T>,ModelItem,Labelable,ModifiableLabelable,Disposable,Component,Configurable,Contextualizable,Serviceable
- Direct Known Subclasses:
StaticContentReferencingSearchModelCriterionDefinition,StaticContentTypesAwareReferencingCriterionDefinition,StaticLanguageAwareReferencingCriterionDefinition
public class StaticReferencingSearchModelCriterionDefinition<T>
extends ReferencingSearchModelCriterionDefinition<T>
implements Component, Contextualizable, Serviceable, Configurable, Disposable
Static implementation for
SearchModelCriterionDefinition searching on a model item.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContentTypesHelperThe content types helperprotected ConfigurationThe criterion root configurationprotected SystemPropertyExtensionPointThe system property extension pointprotected ThreadSafeComponentManager<Validator> ComponentManager forValidators.Fields inherited from class org.ametys.cms.search.model.impl.ReferencingSearchModelCriterionDefinition
_operator, CRITERION_DEFINITION_PREFIXFields inherited from class org.ametys.cms.search.model.impl.ReferencingCriterionDefinition
_contentSearchHelper, _contentTypeExtensionPoint, _contentTypeIds, _criterionTypeExtensionPoint, _reference, _referencePath, NONE_VALUEFields 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 ConfigurationRetrieves the root criterion configuration Used to wrap it for enumerator and widget parametersprotected Query.Operator_parseOperator(Configuration configuration) Parse the criterion operatorprotected ElementDefinition<T> _parseReference(Configuration configuration) Parse the criterion referenceprotected String_parseReferencePath(Configuration configuration) Parse the criterion reference path._parseValidator(ThreadSafeComponentManager<Validator> validatorManager, Configuration config) Parse the criterion validator.voidconfigure(Configuration configuration) voidcontextualize(Context context) voiddispose()voidservice(ServiceManager manager) Methods inherited from class org.ametys.cms.search.model.impl.ReferencingSearchModelCriterionDefinition
_getDefaultOperator, _toJSON, copyTo, getContentTypeIds, getModel, getName, getOperator, getQuery, setMultipleOperandOperator, setOperator, toSAXMethods inherited from class org.ametys.cms.search.model.impl.ReferencingCriterionDefinition
_getContentSearchHelper, _getContentTypeExtensionPoint, _getCriterionTypeExtensionPoint, _getDefaultEnumerator, _getDefaultWidget, _getDefaultWidgetParameters, _getFacetFieldNameSuffix, _isFacetable, convertQueryValue, getDescription, getEnumerator, getJoinedPaths, getLabel, getReference, getReferencePath, getSolrFacetFieldName, getType, setContentTypeIds, setReference, setReferencePathMethods inherited from class org.ametys.cms.search.model.impl.AbstractCriterionDefinition
_getCriterionDefinitionHelper, getMultipleOperandOperator, getQueryContext, getWidget, getWidgetParameters, setJoinedPaths, setSolrFacetFieldNameMethods inherited from class org.ametys.runtime.model.DefaultElementDefinition
_defaultValueToJSON, _getDefaultValues, _getSimpleDefaultValue, _widgetToJSON, _widgetToSAX, getCustomEnumerator, getCustomValidator, getDefaultValue, 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, getDisableConditions, getItemCheckers, getParent, getPath, getPluginName, hashCode, setContext, setDescription, setDisableConditions, setLabel, setModel, 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, getSolrFacetFieldName, getTypeMethods 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, setModel, setParent, setPluginName, setType, setWidget, setWidgetParameters, toJSONMethods inherited from interface org.ametys.runtime.util.ModifiableLabelable
setDescription, setLabel, setName
-
Field Details
-
_systemPropertyExtensionPoint
The system property extension point -
_contentTypesHelper
The content types helper -
_rootConfiguration
The criterion root configuration -
_validatorManager
ComponentManager forValidators.
-
-
Constructor Details
-
StaticReferencingSearchModelCriterionDefinition
-
-
Method Details
-
contextualize
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
configure
- Specified by:
configurein interfaceConfigurable- Throws:
ConfigurationException
-
_parseReferencePath
Parse the criterion reference path.- Parameters:
configuration- The criterion definition configuration.- Returns:
- The parsed reference path
- Throws:
ConfigurationException- If an error occurs.
-
_parseReference
protected ElementDefinition<T> _parseReference(Configuration configuration) throws ConfigurationException Parse the criterion reference- Parameters:
configuration- the criterion definition configuration- Returns:
- the definition of the reference
- Throws:
ConfigurationException- If an error occurs
-
_parseOperator
Parse the criterion operator- Parameters:
configuration- the criterion definition configuration- Returns:
- the operator
- Throws:
ConfigurationException- If an error occurs
-
_parseValidator
protected Optional<String> _parseValidator(ThreadSafeComponentManager<Validator> validatorManager, Configuration config) throws ConfigurationException Parse the criterion validator.- Parameters:
validatorManager- The validator manager.config- The validator configuration.- Returns:
- The optional role of the validator, or an empty optional if there is no validator
- Throws:
ConfigurationException- If an error occurs.
-
dispose
- Specified by:
disposein interfaceDisposable
-
_getRootCriterionConfiguration
Description copied from class:ReferencingCriterionDefinitionRetrieves the root criterion configuration Used to wrap it for enumerator and widget parameters- Overrides:
_getRootCriterionConfigurationin classReferencingCriterionDefinition<T>- Returns:
- the root criterion configuration
-