Package org.alfresco.repo.domain.node
Class NodePropertyHelper
java.lang.Object
org.alfresco.repo.domain.node.NodePropertyHelper
This class provides services for translating exploded properties
(as persisted in alf_node_properties) in the public form, which is a
Map of values keyed by their QName.
- Since:
- 3.4
- Author:
- Derek Hulley
-
Constructor Summary
ConstructorsConstructorDescriptionNodePropertyHelper(DictionaryService dictionaryService, QNameDAO qnameDAO, LocaleDAO localeDAO, ContentDataDAO contentDataDAO) Construct the helper with the appropriate DAOs and services -
Method Summary
Modifier and TypeMethodDescriptionconvertToPublicProperties(Map<NodePropertyKey, NodePropertyValue> propertyValues) getPublicProperty(Map<NodePropertyKey, NodePropertyValue> propertyValues, QName propertyQName) makeNodePropertyValue(PropertyDefinition propertyDef, Serializable value) Helper method to convert theSerializablevalue into a full, persistableNodePropertyValue.makeSerializableValue(PropertyDefinition propertyDef, NodePropertyValue propertyValue) Extracts the externally-visible property from the persistable value.
-
Constructor Details
-
NodePropertyHelper
public NodePropertyHelper(DictionaryService dictionaryService, QNameDAO qnameDAO, LocaleDAO localeDAO, ContentDataDAO contentDataDAO) Construct the helper with the appropriate DAOs and services
-
-
Method Details
-
convertToPersistentProperties
public Map<NodePropertyKey,NodePropertyValue> convertToPersistentProperties(Map<QName, Serializable> in) -
makeNodePropertyValue
Helper method to convert theSerializablevalue into a full, persistableNodePropertyValue.Where the property definition is null, the value will take on the
generic ANYvalue.Collections are NOT supported. These must be split up by the calling code before calling this method. Map instances are supported as plain serializable instances.
- Parameters:
propertyDef- the property dictionary definition, may be nullvalue- the value, which will be converted according to the definition - may be null- Returns:
- Returns the persistable property value
-
getPublicProperty
public Serializable getPublicProperty(Map<NodePropertyKey, NodePropertyValue> propertyValues, QName propertyQName) -
convertToPublicProperties
public Map<QName,Serializable> convertToPublicProperties(Map<NodePropertyKey, NodePropertyValue> propertyValues) -
makeSerializableValue
public Serializable makeSerializableValue(PropertyDefinition propertyDef, NodePropertyValue propertyValue) Extracts the externally-visible property from the persistable value.- Parameters:
propertyDef- the model property definition - may be nullpropertyValue- the persisted property- Returns:
- Returns the value of the property in the format dictated by the property definition, or null if the property value is null
-