Package org.ametys.cms.model.properties
Class ElementReferencingProperty<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>
org.ametys.cms.model.properties.ElementReferencingProperty<T,X>
- Type Parameters:
T- Type of the element valueX- Type of ametys object supported by this property
- All Implemented Interfaces:
Comparable<ModelItem>,Property<T,,X> ReferencingProperty<T,,X> ElementDefinition<T>,ModelItem,PluginAware,Labelable,ModifiableLabelable,Configurable
- Direct Known Subclasses:
ContentElementReferencingProperty
public class ElementReferencingProperty<T,X extends ModelAwareDataAwareAmetysObject>
extends AbstractElementsReferencingProperty<T,X>
Property referencing an
ElementDefinition-
Field Summary
FieldsFields inherited from class org.ametys.cms.model.properties.AbstractProperty
_availableTypesExtensionPointFields inherited from class org.ametys.runtime.model.DefaultElementDefinition
_loggerFields inherited from class org.ametys.runtime.model.AbstractModelItem
__serviceManagerFields inherited from interface org.ametys.runtime.model.ElementDefinition
CONFIG_DEFAULT_VALUE_TYPEFields inherited from interface org.ametys.runtime.model.ModelItem
ITEM_PATH_SEPARATOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringRetrieves the id of the property's typeprotected voidconfigureReferences(Configuration configuration) Configures the referencesgetCriterionEnumerator(Configuration configuration, ThreadSafeComponentManager<Enumerator> enumeratorManager) Get the enumerator to use when rendering this element as a criterionGet the default widget to use when rendering this item as a criterion.getCriterionWidgetParameters(Configuration configuration) Get the widget parameters to use when rendering this item as a criterion.Retrieves the enumerator.Retrieves the paths of the referenced model itemsGet the property's valuebooleanTest if the element is multiple.Methods inherited from class org.ametys.cms.model.properties.AbstractElementsReferencingProperty
_getReferenceDefinition, _parseI18nizableText, configure, getDescription, getLabel, getName, indexValue, initializeAfterModelItemsInitializationMethods inherited from class org.ametys.cms.model.properties.AbstractProperty
_getNameConfigurationAttribute, getType, isEditable, setAvailableTypeExtensionPoint, setPluginInfoMethods inherited from class org.ametys.runtime.model.DefaultElementDefinition
_getDefaultValues, _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, 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.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.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, setAvailableTypeExtensionPoint, valueToJSON, valueToSAX
-
Field Details
-
_reference
The path to the referenced element
-
-
Constructor Details
-
ElementReferencingProperty
public ElementReferencingProperty()
-
-
Method Details
-
configureReferences
Description copied from class:AbstractElementsReferencingPropertyConfigures the references- Specified by:
configureReferencesin classAbstractElementsReferencingProperty<T,X extends ModelAwareDataAwareAmetysObject> - Parameters:
configuration- the property configuration- Throws:
ConfigurationException- if an error occurred
-
getReferences
Description copied from interface:ReferencingPropertyRetrieves the paths of the referenced model items- Returns:
- the paths of the referenced model items
-
getEnumerator
Description copied from interface:ElementDefinitionRetrieves the enumerator.- Specified by:
getEnumeratorin interfaceElementDefinition<T>- Overrides:
getEnumeratorin classDefaultElementDefinition<T>- Returns:
- the enumerator or
nullif none is defined.
-
getValue
Description copied from interface:PropertyGet the property's value- Parameters:
ametysObject- the ametysObject containing the property- Returns:
- the values to index.
-
isMultiple
Description copied from interface:ElementDefinitionTest if the element is multiple.- Specified by:
isMultiplein interfaceElementDefinition<T>- Overrides:
isMultiplein classDefaultElementDefinition<T>- Returns:
trueif the metadata is multiple.
-
_getTypeId
Description copied from class:AbstractPropertyRetrieves the id of the property's type- Specified by:
_getTypeIdin classAbstractProperty<T,X extends ModelAwareDataAwareAmetysObject> - Returns:
- the id of the property's type
-
getCriterionEnumerator
public Enumerator getCriterionEnumerator(Configuration configuration, ThreadSafeComponentManager<Enumerator> enumeratorManager) throws ConfigurationException Description copied from interface:ElementDefinitionGet the enumerator to use when rendering this element as a criterion- Parameters:
configuration- The enumerator configuration.enumeratorManager- ComponentManager for the criterion'sEnumerator- Returns:
- The enumerator or null if the element'critérion is not enumerated.
- Throws:
ConfigurationException- If an error occurs while initializing the enumerator
-
getCriterionWidget
Description copied from interface:ModelItemGet the default widget to use when rendering this item as a criterion.- Returns:
- The default widget to use, or
nullif no specific widget is necessary.
-
getCriterionWidgetParameters
Description copied from interface:ModelItemGet the widget parameters to use when rendering this item as a criterion.- Parameters:
configuration- The widget parameters configuration- Returns:
- The default widget parameters to use, or an empty Map if no specific widget parameters are necessary.
-