Package org.ametys.web.model.properties
Class EnumeratingProperty<T>
java.lang.Object
org.ametys.runtime.model.AbstractModelItem
org.ametys.runtime.model.DefaultElementDefinition<T>
org.ametys.cms.model.properties.AbstractProperty<T,Content>
org.ametys.cms.model.properties.AbstractStaticProperty<T,Content>
org.ametys.cms.model.properties.AbstractIndexableStaticProperty<T,T,Content>
org.ametys.cms.model.properties.AbstractElementsReferencingProperty<T,T,Content>
org.ametys.cms.model.properties.ElementReferencingProperty<T,Content>
org.ametys.web.model.properties.EnumeratingProperty<T>
- Type Parameters:
T
- Type of the element value
- All Implemented Interfaces:
Comparable<ModelItem>
,Property<T,
,Content> ReferencingProperty<T,
,Content> CriterionDefinitionAwareElementDefinition<T,
,T, Content> IndexationAwareElementDefinition<T,
,Content> Observer
,ElementDefinition<T>
,ModelItem
,PluginAware
,Prioritizable
,Supporter<Event>
,Labelable
,ModifiableLabelable
,Initializable
,Configurable
,Contextualizable
,Serviceable
public class EnumeratingProperty<T>
extends ElementReferencingProperty<T,Content>
implements Initializable, Observer
Property that enumerates actual values of its referenced
ElementDefinition
-
Field Summary
Fields inherited from class org.ametys.cms.model.properties.ElementReferencingProperty
_reference
Fields inherited from class org.ametys.cms.model.properties.AbstractIndexableStaticProperty
_criterionDefinitionHelper, _indexationAwareElementDefinitionHelper
Fields inherited from class org.ametys.cms.model.properties.AbstractStaticProperty
_context
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
Fields inherited from interface org.ametys.core.observation.Observer
MAX_PRIORITY, MIN_PRIORITY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(Configuration configuration) int
Get the priority for the component.getQuery
(Object value, Query.Operator operator, String language, Map<String, Object> contextualParameters) Get theQuery
associated to the given value.void
indexValue
(org.apache.solr.common.SolrInputDocument document, Content ametysObject, CMSDataContext context) Index the element in a solr document.void
Used to do more initialization, checks...void
void
Observes an event.void
service
(ServiceManager manager) boolean
Check if an element is supportedMethods inherited from class org.ametys.cms.model.properties.ElementReferencingProperty
configureReferences, getEnumerator, getReferences, getTypeId, getValue, isMultiple
Methods inherited from class org.ametys.cms.model.properties.AbstractElementsReferencingProperty
_getReferenceDefinition, _parseDescription, _parseLabel, getDescription, getLabel, getName
Methods inherited from class org.ametys.cms.model.properties.AbstractIndexableStaticProperty
getCriterionType, getCriterionTypeId, getSolrSortFieldName
Methods inherited from class org.ametys.cms.model.properties.AbstractStaticProperty
_getNameConfigurationAttribute, _parseAndSetEnumerator, _parseName, contextualize
Methods inherited from class org.ametys.cms.model.properties.AbstractProperty
getType, isEditable, setPluginInfo
Methods inherited from class org.ametys.runtime.model.DefaultElementDefinition
_defaultValueToJSON, _getDefaultValues, _getSimpleDefaultValue, _toJSON, _widgetToJSON, _widgetToSAX, getCustomEnumerator, getCustomValidator, getDefaultValue, getEnumeratorConfiguration, getParsedDefaultValues, getValidator, getValidatorConfiguration, getWidget, getWidgetParameters, of, setCustomEnumerator, setCustomValidator, setDefaultValue, setEnumerator, setEnumeratorConfiguration, setMultiple, setParsedDefaultValues, setType, setValidator, setValidatorConfiguration, setWidget, setWidgetParameters, toSAX
Methods inherited from class org.ametys.runtime.model.AbstractModelItem
_getModelItemHelper, _shouldJSONBeEmpty, _widgetParameterToSAX, addItemChecker, compareTo, disableConditionsToJSON, equals, getDisableConditions, getItemCheckers, getModel, 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.CriterionDefinitionAwareElementDefinition
convertQueryValue, getDefaultCriterionEnumerator, getDefaultCriterionOperator, getDefaultCriterionWidget, getDefaultCriterionWidgetParameters
Methods inherited from interface org.ametys.runtime.model.ElementDefinition
getCustomEnumerator, getCustomValidator, getDefaultValue, getEnumeratorConfiguration, getParsedDefaultValues, getValidator, getValidatorConfiguration, isEditable, setCustomEnumerator, setCustomValidator, setDefaultValue, setEnumerator, setEnumeratorConfiguration, setMultiple, setParsedDefaultValues, setValidator, setValidatorConfiguration
Methods inherited from interface org.ametys.cms.search.model.IndexationAwareElementDefinition
getSolrFacetFieldName, getSolrFieldName, getType, isFacetable, isSortable
Methods inherited from interface org.ametys.runtime.model.ModelItem
addItemChecker, getDisableConditions, getItemCheckers, getModel, getParent, getPath, getPluginName, getWidget, getWidgetParameters, setDisableConditions, setModel, setParent, setPluginName, setType, setWidget, setWidgetParameters, toJSON, toSAX
Methods inherited from interface org.ametys.runtime.util.ModifiableLabelable
setDescription, setLabel, setName
Methods inherited from interface org.ametys.cms.model.properties.Property
getType, valueToJSON, valueToSAX
-
Constructor Details
-
EnumeratingProperty
public EnumeratingProperty()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractIndexableStaticProperty<T,
T, Content> - Throws:
ServiceException
-
configure
- Specified by:
configure
in interfaceConfigurable
- Overrides:
configure
in classAbstractElementsReferencingProperty<T,
T, Content> - Throws:
ConfigurationException
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
init
Description copied from interface:Property
Used to do more initialization, checks... needing the role of extension point containing the types available for this property Called byModel
parsing when the model items of all models have been initialized. -
getQuery
public Query getQuery(Object value, Query.Operator operator, String language, Map<String, Object> contextualParameters) Description copied from interface:CriterionDefinitionAwareElementDefinition
Get theQuery
associated to the given value.- Specified by:
getQuery
in interfaceCriterionDefinitionAwareElementDefinition<T,
T, Content> - Parameters:
value
- the user-submitted value for this item.operator
- In advanced search mode, the operator chosen by the user.null
to use the criterion-defined operator (simple search mode).language
- The current search language.contextualParameters
- the search contextual parameters.- Returns:
- The
Query
associated to the given value.
-
indexValue
public void indexValue(org.apache.solr.common.SolrInputDocument document, Content ametysObject, CMSDataContext context) Description copied from interface:IndexationAwareElementDefinition
Index the element in a solr document.- Specified by:
indexValue
in interfaceIndexationAwareElementDefinition<T,
Content> - Parameters:
document
- the solr document to index into.ametysObject
- the ametysObject containing the element to index.context
- the context of the data to index. Can not be null.
-
getPriority
Description copied from interface:Prioritizable
Get the priority for the component. On components usingPrioritizable
interface, each implementation define the order. In most cases, less is the number, more prior is the component.- Specified by:
getPriority
in interfacePrioritizable
- Returns:
- the priority
-
supports
Description copied from interface:Supporter
Check if an element is supported -
observe
Description copied from interface:Observer
Observes an event.- Specified by:
observe
in interfaceObserver
- Parameters:
event
- the event.transientVars
- transientVars passed from one Observer to another when processing a single Event. This may allow optimizations between observers.- Throws:
Exception
- if an error occurs. All exceptions will be logged but not propagated, as the observation mechanism should never fail.
-