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 ContentTypesHelper
The content types helperprotected Configuration
The criterion root configurationprotected SystemPropertyExtensionPoint
The system property extension pointprotected ThreadSafeComponentManager
<Validator> ComponentManager forValidator
s.Fields inherited from class org.ametys.cms.search.model.impl.ReferencingSearchModelCriterionDefinition
_operator, CRITERION_DEFINITION_PREFIX
Fields inherited from class org.ametys.cms.search.model.impl.ReferencingCriterionDefinition
_contentSearchHelper, _contentTypeExtensionPoint, _contentTypeIds, _criterionTypeExtensionPoint, _reference, _referencePath, NONE_VALUE
Fields inherited from class org.ametys.cms.search.model.impl.AbstractCriterionDefinition
_criterionDefinitionHelper, _joinedPaths, _multipleOperandOperator, _solrFacetFieldName
Fields inherited from class org.ametys.runtime.model.DefaultElementDefinition
_logger
Fields inherited from class org.ametys.runtime.model.AbstractModelItem
__context, __serviceManager
Fields inherited from interface org.ametys.runtime.model.ElementDefinition
CONFIG_DEFAULT_VALUE_TYPE
Fields inherited from interface org.ametys.runtime.model.ModelItem
ITEM_PATH_SEPARATOR
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Configuration
Retrieves 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.void
configure
(Configuration configuration) void
contextualize
(Context context) void
dispose()
void
service
(ServiceManager manager) Methods inherited from class org.ametys.cms.search.model.impl.ReferencingSearchModelCriterionDefinition
_getDefaultOperator, _toJSON, copyTo, getContentTypeIds, getModel, getName, getOperator, getQuery, setMultipleOperandOperator, setOperator, toSAX
Methods 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, setReferencePath
Methods inherited from class org.ametys.cms.search.model.impl.AbstractCriterionDefinition
_defaultValueToJSON, _getCriterionDefinitionHelper, getMultipleOperandOperator, getQueryContext, getWidget, getWidgetParameters, setJoinedPaths, setSolrFacetFieldName
Methods inherited from class org.ametys.runtime.model.DefaultElementDefinition
_getDefaultValues, _widgetToJSON, _widgetToSAX, getCustomEnumerator, getCustomValidator, getDefaultValue, getEnumeratorConfiguration, getParsedDefaultValues, getValidator, getValidatorConfiguration, isMultiple, of, setCustomEnumerator, setCustomValidator, setDefaultValue, setEnumerator, setEnumeratorConfiguration, setMultiple, setParsedDefaultValues, setType, setValidator, setValidatorConfiguration, setWidget, setWidgetParameters
Methods 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, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface org.ametys.cms.search.model.CriterionDefinition
convertQueryValue, getJoinedPaths, getQuery, getQuery, getSolrFacetFieldName, getType
Methods 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, setValidatorConfiguration
Methods inherited from interface org.ametys.runtime.util.Labelable
getDescription, getLabel
Methods inherited from interface org.ametys.runtime.model.ModelItem
addItemChecker, getDisableConditions, getItemCheckers, getParent, getPath, getPluginName, getWidget, getWidgetParameters, setDisableConditions, setModel, setParent, setPluginName, setType, setWidget, setWidgetParameters, toJSON
Methods 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 forValidator
s.
-
-
Constructor Details
-
StaticReferencingSearchModelCriterionDefinition
-
-
Method Details
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
configure
- Specified by:
configure
in 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:
dispose
in interfaceDisposable
-
_getRootCriterionConfiguration
Description copied from class:ReferencingCriterionDefinition
Retrieves the root criterion configuration Used to wrap it for enumerator and widget parameters- Overrides:
_getRootCriterionConfiguration
in classReferencingCriterionDefinition<T>
- Returns:
- the root criterion configuration
-