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> CriterionDefinitionAwareElementDefinition<T>
,IndexationAwareElementDefinition<T,
,X> ElementDefinition<T>
,ModelItem
,PluginAware
,Labelable
,ModifiableLabelable
,Configurable
,Contextualizable
,Serviceable
- 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.AbstractElementsReferencingProperty
_criterionDefinitionHelper, _indexationAwareElementDefinitionHelper
Fields 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 void
configureReferences
(Configuration configuration) Configures the referencesRetrieves the enumerator.Retrieves the paths of the referenced model itemsprotected String
Retrieves the id of the property's typeGet the property's valueboolean
Test if the element is multiple.Methods inherited from class org.ametys.cms.model.properties.AbstractElementsReferencingProperty
_getReferenceDefinition, _parseDescription, _parseLabel, configure, getDefaultCriterionType, getDescription, getLabel, getName, getSolrSortFieldName, initializeAfterModelItemsInitialization, service
Methods inherited from class org.ametys.cms.model.properties.AbstractProperty
_getNameConfigurationAttribute, _parseAndSetEnumerator, _parseName, contextualize, getType, isEditable, setAvailableTypeExtensionPoint, setPluginInfo
Methods inherited from class org.ametys.runtime.model.DefaultElementDefinition
_defaultValueToJSON, _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, 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, 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, getSortValue, getType, 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, setAvailableTypeExtensionPoint, valueToJSON, valueToSAX
-
Field Details
-
_reference
The path to the referenced element
-
-
Constructor Details
-
ElementReferencingProperty
public ElementReferencingProperty()
-
-
Method Details
-
configureReferences
Description copied from class:AbstractElementsReferencingProperty
Configures the references- Specified by:
configureReferences
in classAbstractElementsReferencingProperty<T,
X extends ModelAwareDataAwareAmetysObject> - Parameters:
configuration
- the property configuration- Throws:
ConfigurationException
- if an error occurred
-
getReferences
Description copied from interface:ReferencingProperty
Retrieves the paths of the referenced model items- Returns:
- the paths of the referenced model items
-
getEnumerator
Description copied from interface:ElementDefinition
Retrieves the enumerator.- Specified by:
getEnumerator
in interfaceElementDefinition<T>
- Overrides:
getEnumerator
in classDefaultElementDefinition<T>
- Returns:
- the enumerator or
null
if none is defined.
-
getValue
Description copied from interface:Property
Get the property's value- Parameters:
ametysObject
- the ametysObject containing the property- Returns:
- the values to index.
-
isMultiple
Description copied from interface:ElementDefinition
Test if the element is multiple.- Specified by:
isMultiple
in interfaceElementDefinition<T>
- Overrides:
isMultiple
in classDefaultElementDefinition<T>
- Returns:
true
if the metadata is multiple.
-
getTypeId
Description copied from class:AbstractProperty
Retrieves the id of the property's type- Specified by:
getTypeId
in classAbstractProperty<T,
X extends ModelAwareDataAwareAmetysObject> - Returns:
- the id of the property's type
-