Package org.ametys.cms.model.properties
Class AbstractProperty<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>
- Type Parameters:
T
- type of the property valuesX
- type of ametys object supported by this property
- All Implemented Interfaces:
Comparable<ModelItem>
,Property<T,
,X> ElementDefinition<T>
,ModelItem
,PluginAware
,Labelable
,ModifiableLabelable
,Configurable
,Contextualizable
,Serviceable
- Direct Known Subclasses:
AbstractContentProperty
,AbstractElementsReferencingProperty
,AbstractSystemProperty
,ContainerMCCWorkflowStatusProperty
,DegreeOrderProperty
,DegreeTypeProperty
,InvalidContainerDataProperty
,MemberProjectProperty
,ODFPrimaryContentTypeProperty
,PinProperty
,ProgramMCCWorkflowStatusProperty
,SharedProperty
,SubProgramParentProgramProperty
public abstract class AbstractProperty<T,X extends ModelAwareDataAwareAmetysObject>
extends DefaultElementDefinition<T>
implements Property<T,X>, Configurable, PluginAware, Serviceable, Contextualizable
Abstract class for single property
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ExtensionPoint
<ModelItemType> extension point containing the types available for this propertyprotected Context
The avalon contextprotected ServiceManager
The service managerFields 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 String
Retrieves the name of the configuration attribute that contains the name of the propertyprotected void
_parseAndSetEnumerator
(Configuration configuration, String pluginName) Parse the configuration to set the enumerator.protected I18nizableText
_parseDescription
(Configuration configuration) Parses the description of the propertyprotected I18nizableText
_parseLabel
(Configuration configuration) Parses the label of the propertyprotected String
_parseName
(Configuration configuration) Parses the name of the propertyvoid
configure
(Configuration configuration) void
contextualize
(Context context) getType()
Retrieves the type.protected abstract String
Retrieves the id of the property's typeboolean
Determines if the definition is editable, i.e.void
service
(ServiceManager manager) void
setAvailableTypeExtensionPoint
(ExtensionPoint<ModelItemType> availableTypesExtensionPoint) Set the extension point containing the types available for this propertyvoid
setPluginInfo
(String pluginName, String featureName, String id) Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.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, getDescription, getDisableConditions, getItemCheckers, getLabel, getModel, getName, 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.runtime.model.ElementDefinition
getCustomEnumerator, getCustomValidator, getDefaultValue, getEnumerator, getEnumeratorConfiguration, getParsedDefaultValues, getValidator, getValidatorConfiguration, isMultiple, setCustomEnumerator, setCustomValidator, setDefaultValue, setEnumerator, setEnumeratorConfiguration, setMultiple, setParsedDefaultValues, setValidator, setValidatorConfiguration
Methods inherited from interface org.ametys.runtime.util.Labelable
getDescription, getLabel, getName
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
getValue, initializeAfterModelItemsInitialization, valueToJSON, valueToSAX
-
Field Details
-
_manager
The service manager -
_context
The avalon context -
_availableTypesExtensionPoint
extension point containing the types available for this property
-
-
Constructor Details
-
AbstractProperty
public AbstractProperty()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
configure
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
_parseName
Parses the name of the property- Parameters:
configuration
- the property configuration to use.- Returns:
- the name of the property.
- Throws:
ConfigurationException
- if the configuration is not valid.
-
_getNameConfigurationAttribute
Retrieves the name of the configuration attribute that contains the name of the property- Returns:
- the name of the configuration attribute that contains the name of the property
-
_parseLabel
Parses the label of the property- 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 Parses the description of the property- Parameters:
configuration
- the property configuration to use.- Returns:
- the description of the property.
- Throws:
ConfigurationException
- if the configuration is not valid.
-
_parseAndSetEnumerator
protected void _parseAndSetEnumerator(Configuration configuration, String pluginName) throws ConfigurationException Parse the configuration to set the enumerator.- Parameters:
configuration
- The configuration of the propertypluginName
- The plugin name- Throws:
ConfigurationException
- if an error occurs
-
setPluginInfo
Description copied from interface:PluginAware
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.- Specified by:
setPluginInfo
in interfacePluginAware
- Parameters:
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this component
-
isEditable
Description copied from interface:ElementDefinition
Determines if the definition is editable, i.e. if it can be part of a view used for edition- Specified by:
isEditable
in interfaceElementDefinition<T>
- Returns:
true
if the definition is editable,false
otherwise
-
setAvailableTypeExtensionPoint
public void setAvailableTypeExtensionPoint(ExtensionPoint<ModelItemType> availableTypesExtensionPoint) Description copied from interface:Property
Set the extension point containing the types available for this property- Specified by:
setAvailableTypeExtensionPoint
in interfaceProperty<T,
X extends ModelAwareDataAwareAmetysObject> - Parameters:
availableTypesExtensionPoint
- the extension point to set
-
getType
Description copied from interface:ModelItem
Retrieves the type.- Specified by:
getType
in interfaceElementDefinition<T>
- Specified by:
getType
in interfaceModelItem
- Specified by:
getType
in interfaceProperty<T,
X extends ModelAwareDataAwareAmetysObject> - Overrides:
getType
in classDefaultElementDefinition<T>
- Returns:
- the type.
-
getTypeId
Retrieves the id of the property's type- Returns:
- the id of the property's type
-