Package org.ametys.cms.model.properties
Class AbstractElementsReferencingProperty<T,X extends ModelAwareDataAwareAmetysObject>
java.lang.Object
org.ametys.runtime.model.AbstractModelItem
org.ametys.runtime.model.DefaultElementDefinition<T>
org.ametys.cms.model.properties.AbstractProperty<T,X>
org.ametys.cms.model.properties.AbstractElementsReferencingProperty<T,X>
- Type Parameters:
T
- Type of the property valuesX
- Type of ametys object supported by this property
- All Implemented Interfaces:
Comparable<ModelItem>
,Property<T,
,X> ReferencingProperty<T,
,X> CriterionDefinitionAwareElementDefinition<T>
,IndexationAwareElementDefinition<T,
,X> ElementDefinition<T>
,ModelItem
,PluginAware
,Labelable
,ModifiableLabelable
,Configurable
,Contextualizable
,Serviceable
- Direct Known Subclasses:
AbstractMultiValuesProperty
,ElementReferencingProperty
public abstract class AbstractElementsReferencingProperty<T,X extends ModelAwareDataAwareAmetysObject>
extends AbstractProperty<T,X>
implements ReferencingProperty<T,X>, CriterionDefinitionAwareElementDefinition<T>, IndexationAwareElementDefinition<T,X>
Abstract implementation for a property referencing
ElementDefinition
s-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CriterionDefinitionHelper
The criterion definition helperprotected IndexationAwareElementDefinitionHelper
The indexation aware element definition helperFields inherited from class org.ametys.cms.model.properties.AbstractProperty
_availableTypesExtensionPoint, _context, _manager
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 ElementDefinition
<T> _getReferenceDefinition
(String reference) Retrieves the definition of the given referenced elementprotected I18nizableText
_parseDescription
(Configuration configuration) Parses the description of the propertyprotected I18nizableText
_parseLabel
(Configuration configuration) Parses the label of the propertyvoid
configure
(Configuration configuration) protected abstract void
configureReferences
(Configuration configuration) Configures the referencesGet the type to use when rendering the element as a criterionRetrieves the description.getLabel()
Retrieves the label.getName()
Get the name.Retrieves the name of the element's solr sort fieldvoid
Called byModel
parsing when the model items of all models have been initialized.void
service
(ServiceManager manager) Methods inherited from class org.ametys.cms.model.properties.AbstractProperty
_getNameConfigurationAttribute, _parseAndSetEnumerator, _parseName, contextualize, getType, getTypeId, isEditable, setAvailableTypeExtensionPoint, setPluginInfo
Methods inherited from class org.ametys.runtime.model.DefaultElementDefinition
_defaultValueToJSON, _getDefaultValues, _toJSON, _widgetToJSON, _widgetToSAX, getCustomEnumerator, getCustomValidator, getDefaultValue, getEnumerator, getEnumeratorConfiguration, getParsedDefaultValues, getValidator, getValidatorConfiguration, getWidget, getWidgetParameters, isMultiple, 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, getQuery, 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.cms.search.model.IndexationAwareElementDefinition
getSolrFacetFieldName, getSolrFieldName, getSortValue, getType, getValue, indexValue, 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, getValue, setAvailableTypeExtensionPoint, valueToJSON, valueToSAX
Methods inherited from interface org.ametys.cms.model.properties.ReferencingProperty
getReferences
-
Field Details
-
_criterionDefinitionHelper
The criterion definition helper -
_indexationAwareElementDefinitionHelper
The indexation aware element definition helper
-
-
Constructor Details
-
AbstractElementsReferencingProperty
public AbstractElementsReferencingProperty()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractProperty<T,
X extends ModelAwareDataAwareAmetysObject> - Throws:
ServiceException
-
configure
- Specified by:
configure
in interfaceConfigurable
- Overrides:
configure
in classAbstractProperty<T,
X extends ModelAwareDataAwareAmetysObject> - Throws:
ConfigurationException
-
_parseLabel
Description copied from class:AbstractProperty
Parses the label of the property- Overrides:
_parseLabel
in classAbstractProperty<T,
X extends ModelAwareDataAwareAmetysObject> - Parameters:
configuration
- the property configuration to use.- Returns:
- the label of the property.
- Throws:
ConfigurationException
- if the configuration is not valid.
-
_parseDescription
protected I18nizableText _parseDescription(Configuration configuration) throws ConfigurationException Description copied from class:AbstractProperty
Parses the description of the property- Overrides:
_parseDescription
in classAbstractProperty<T,
X extends ModelAwareDataAwareAmetysObject> - Parameters:
configuration
- the property configuration to use.- Returns:
- the description of the property.
- Throws:
ConfigurationException
- if the configuration is not valid.
-
configureReferences
protected abstract void configureReferences(Configuration configuration) throws ConfigurationException Configures the references- Parameters:
configuration
- the property configuration- Throws:
ConfigurationException
- if an error occurred
-
initializeAfterModelItemsInitialization
Description copied from interface:Property
Called byModel
parsing when the model items of all models have been initialized. Can be used to do more initialization, checks, ... needing model items (attributes / properties) of distant contents- Specified by:
initializeAfterModelItemsInitialization
in interfaceProperty<T,
X extends ModelAwareDataAwareAmetysObject> - Throws:
Exception
- if an error occurs or if an additional check fails.
-
_getReferenceDefinition
Retrieves the definition of the given referenced element- Parameters:
reference
- the reference- Returns:
- the referenced element's definition
-
getName
Description copied from interface:Labelable
Get the name.- Specified by:
getName
in interfaceLabelable
- Overrides:
getName
in classAbstractModelItem
- Returns:
- the name.
-
getLabel
Description copied from interface:Labelable
Retrieves the label.- Specified by:
getLabel
in interfaceLabelable
- Overrides:
getLabel
in classAbstractModelItem
- Returns:
- the label.
-
getDescription
Description copied from interface:Labelable
Retrieves the description.- Specified by:
getDescription
in interfaceLabelable
- Overrides:
getDescription
in classAbstractModelItem
- Returns:
- the description.
-
getDefaultCriterionType
Description copied from interface:CriterionDefinitionAwareElementDefinition
Get the type to use when rendering the element as a criterion- Specified by:
getDefaultCriterionType
in interfaceCriterionDefinitionAwareElementDefinition<T>
- Returns:
- the type to use for a criterion
-
getSolrSortFieldName
Description copied from interface:IndexationAwareElementDefinition
Retrieves the name of the element's solr sort field- Specified by:
getSolrSortFieldName
in interfaceIndexationAwareElementDefinition<T,
X extends ModelAwareDataAwareAmetysObject> - Returns:
- the name of the element's solr sort field
-