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
_referenceFields inherited from class org.ametys.cms.model.properties.AbstractIndexableStaticProperty
_criterionDefinitionHelper, _indexationAwareElementDefinitionHelperFields inherited from class org.ametys.cms.model.properties.AbstractStaticProperty
_contextFields 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_SEPARATORFields inherited from interface org.ametys.core.observation.Observer
MAX_PRIORITY, MIN_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(Configuration configuration) intGet the priority for the component.getQuery(Object value, Query.Operator operator, String language, Map<String, Object> contextualParameters) Get theQueryassociated to the given value.voidindexValue(org.apache.solr.common.SolrInputDocument document, Content ametysObject, CMSDataContext context) Index the element in a solr document.voidUsed to do more initialization, checks...voidvoidObserves an event.voidservice(ServiceManager manager) booleanCheck if an element is supportedMethods inherited from class org.ametys.cms.model.properties.ElementReferencingProperty
configureReferences, getEnumerator, getReferences, getTypeId, getValue, isMultipleMethods inherited from class org.ametys.cms.model.properties.AbstractElementsReferencingProperty
_getReferenceDefinition, _parseDescription, _parseLabel, getDescription, getLabel, getNameMethods inherited from class org.ametys.cms.model.properties.AbstractIndexableStaticProperty
getCriterionType, getCriterionTypeId, getSolrSortFieldNameMethods inherited from class org.ametys.cms.model.properties.AbstractStaticProperty
_getNameConfigurationAttribute, _parseAndSetEnumerator, _parseName, contextualizeMethods inherited from class org.ametys.cms.model.properties.AbstractProperty
getType, isEditable, setPluginInfoMethods 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, toSAXMethods 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, 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.CriterionDefinitionAwareElementDefinition
convertQueryValue, getDefaultCriterionEnumerator, getDefaultCriterionOperator, getDefaultCriterionWidget, getDefaultCriterionWidgetParametersMethods inherited from interface org.ametys.runtime.model.ElementDefinition
getCustomEnumerator, getCustomValidator, getDefaultValue, getEnumeratorConfiguration, getParsedDefaultValues, getValidator, getValidatorConfiguration, isEditable, setCustomEnumerator, setCustomValidator, setDefaultValue, setEnumerator, setEnumeratorConfiguration, setMultiple, setParsedDefaultValues, setValidator, setValidatorConfigurationMethods inherited from interface org.ametys.cms.search.model.IndexationAwareElementDefinition
getSolrFacetFieldName, getSolrFieldName, getType, isFacetable, isSortableMethods 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, toSAXMethods inherited from interface org.ametys.runtime.util.ModifiableLabelable
setDescription, setLabel, setNameMethods inherited from interface org.ametys.cms.model.properties.Property
getType, valueToJSON, valueToSAX
-
Constructor Details
-
EnumeratingProperty
public EnumeratingProperty()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractIndexableStaticProperty<T,T, Content> - Throws:
ServiceException
-
configure
- Specified by:
configurein interfaceConfigurable- Overrides:
configurein classAbstractElementsReferencingProperty<T,T, Content> - Throws:
ConfigurationException
-
initialize
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
init
Description copied from interface:PropertyUsed to do more initialization, checks... needing the role of extension point containing the types available for this property Called byModelparsing 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:CriterionDefinitionAwareElementDefinitionGet theQueryassociated to the given value.- Specified by:
getQueryin interfaceCriterionDefinitionAwareElementDefinition<T,T, Content> - Parameters:
value- the user-submitted value for this item.operator- In advanced search mode, the operator chosen by the user.nullto use the criterion-defined operator (simple search mode).language- The current search language.contextualParameters- the search contextual parameters.- Returns:
- The
Queryassociated to the given value.
-
indexValue
public void indexValue(org.apache.solr.common.SolrInputDocument document, Content ametysObject, CMSDataContext context) Description copied from interface:IndexationAwareElementDefinitionIndex the element in a solr document.- Specified by:
indexValuein 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:PrioritizableGet the priority for the component. On components usingPrioritizableinterface, each implementation define the order. In most cases, less is the number, more prior is the component.- Specified by:
getPriorityin interfacePrioritizable- Returns:
- the priority
-
supports
Description copied from interface:SupporterCheck if an element is supported -
observe
Description copied from interface:ObserverObserves an event.- Specified by:
observein 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.
-