org.alfresco.repo.domain.node
Class NodePropertyHelper

java.lang.Object
  extended by org.alfresco.repo.domain.node.NodePropertyHelper

public class NodePropertyHelper
extends java.lang.Object

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

Constructor Summary
NodePropertyHelper(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService, QNameDAO qnameDAO, LocaleDAO localeDAO, ContentDataDAO contentDataDAO)
          Construct the helper with the appropriate DAOs and services
 
Method Summary
 java.util.Map convertToPersistentProperties(java.util.Map in)
           
 java.util.Map convertToPublicProperties(java.util.Map propertyValues)
           
 java.io.Serializable getPublicProperty(java.util.Map propertyValues, org.alfresco.service.namespace.QName propertyQName)
           
 NodePropertyValue makeNodePropertyValue(org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef, java.io.Serializable value)
          Helper method to convert the Serializable value into a full, persistable NodePropertyValue.
 java.io.Serializable makeSerializableValue(org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef, NodePropertyValue propertyValue)
          Extracts the externally-visible property from the persistable value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodePropertyHelper

public NodePropertyHelper(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService,
                          QNameDAO qnameDAO,
                          LocaleDAO localeDAO,
                          ContentDataDAO contentDataDAO)
Construct the helper with the appropriate DAOs and services

Method Detail

convertToPersistentProperties

public java.util.Map convertToPersistentProperties(java.util.Map in)

makeNodePropertyValue

public NodePropertyValue makeNodePropertyValue(org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef,
                                               java.io.Serializable value)
Helper method to convert the Serializable value into a full, persistable NodePropertyValue.

Where the property definition is null, the value will take on the generic ANY value.

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 null
value - the value, which will be converted according to the definition - may be null
Returns:
Returns the persistable property value

getPublicProperty

public java.io.Serializable getPublicProperty(java.util.Map propertyValues,
                                              org.alfresco.service.namespace.QName propertyQName)

convertToPublicProperties

public java.util.Map convertToPublicProperties(java.util.Map propertyValues)

makeSerializableValue

public java.io.Serializable makeSerializableValue(org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef,
                                                  NodePropertyValue propertyValue)
Extracts the externally-visible property from the persistable value.

Parameters:
propertyDef - the model property definition - may be null
propertyValue - 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


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.