org.alfresco.repo.props
Interface PropertyValueComponent

All Known Implementing Classes:
PropertyValueComponentImpl

public interface PropertyValueComponent

A component that gives high-level access to manipulate standalone properties.

There are two types of properties: shared and unshared.

Simple, Shared Properties:
These properties are globally unique (apart from values that don't have a meaningful key). If two different applications attempt to create the same value, then the same ID will be returned (after conflict resolution), assuming that the value is not treated as binary data. It is not possible to modify or delete these values. You should store types that can be converted to and from a well-known type. Complex collections should not be stored using this value.
Unshared Properties:
These properties may be duplicated, modifed and deleted. It is not possible to look values up and therefore new IDs are generated for each creation. Complex values can be stored in these properties and will be exploded recursively.

Since:
3.2

Method Summary
 java.lang.Long createPropertyUniqueContext(java.io.Serializable value1, java.io.Serializable value2, java.io.Serializable value3)
          Create a new combination of three unique properties.
 java.lang.Long createUnsharedProperty(java.io.Serializable value)
           
 void deletePropertyUniqueContext(java.lang.Long id)
          Delete a unique property context.
 int deletePropertyUniqueContexts(java.io.Serializable[] values)
          Delete a combination of three unique properties.
 void deleteUnsharedProperty(java.lang.Long id)
           
 java.lang.Long getOrCreateSharedValue(java.io.Serializable value)
           
 java.lang.Long getPropertyUniqueContext(java.io.Serializable value1, java.io.Serializable value2, java.io.Serializable value3)
          Get the ID of a unique property context.
 java.io.Serializable getSharedValueById(java.lang.Long id)
           
 java.lang.Long getSharedValueId(java.io.Serializable value)
           
 java.io.Serializable getUnsharedPropertyById(java.lang.Long id)
           
 void updatePropertyUniqueContext(java.lang.Long id, java.io.Serializable value1, java.io.Serializable value2, java.io.Serializable value3)
          Update a unique property context.
 java.lang.Long updatePropertyUniqueContext(java.io.Serializable value1Before, java.io.Serializable value2Before, java.io.Serializable value3Before, java.io.Serializable value1, java.io.Serializable value2, java.io.Serializable value3)
          Update a combination of three unique properties.
 void updateUnsharedProperty(java.lang.Long id, java.io.Serializable value)
           
 

Method Detail

getSharedValueById

java.io.Serializable getSharedValueById(java.lang.Long id)
Parameters:
id - the ID (may not be null)
Throws:
org.springframework.dao.DataIntegrityViolationException - if the ID is invalid

getSharedValueId

java.lang.Long getSharedValueId(java.io.Serializable value)
Parameters:
value - the value to find the ID for (may be null)
Returns:
Returns the ID of the shared value or null if it doesn't exist

getOrCreateSharedValue

java.lang.Long getOrCreateSharedValue(java.io.Serializable value)
Parameters:
value - the value to find the ID for (may be null)
Returns:
Returns the ID of the shared value (created or not)

getUnsharedPropertyById

java.io.Serializable getUnsharedPropertyById(java.lang.Long id)
Parameters:
id - the ID (may not be null)
Returns:
Returns the value of the property (never null)
Throws:
org.springframework.dao.DataIntegrityViolationException - if the ID is invalid

createUnsharedProperty

java.lang.Long createUnsharedProperty(java.io.Serializable value)
Parameters:
value - the value to create (may be null)
Returns:
Returns the new property's ID

updateUnsharedProperty

void updateUnsharedProperty(java.lang.Long id,
                            java.io.Serializable value)
Parameters:
id - the ID of the root property to change (may not be null)
value - the new property value
Throws:
org.springframework.dao.DataIntegrityViolationException - if the ID is invalid

deleteUnsharedProperty

void deleteUnsharedProperty(java.lang.Long id)
Parameters:
id - the ID of the root property to delete (may be null)
Throws:
org.springframework.dao.DataIntegrityViolationException - if the ID is invalid

createPropertyUniqueContext

java.lang.Long createPropertyUniqueContext(java.io.Serializable value1,
                                           java.io.Serializable value2,
                                           java.io.Serializable value3)
Create a new combination of three unique properties.

Parameters:
value1 - the first property, which should denote application name or use-case ID (null allowed)
value2 - the second property, which should denote the context or container value (null allowed)
value3 - the third property, which should denote the unique value within the context of the previous two properties (null allowed)
Returns:
Returns the ID of the unique property combination for later updates
Throws:
PropertyUniqueConstraintViolation - if the combination is not unique

getPropertyUniqueContext

java.lang.Long getPropertyUniqueContext(java.io.Serializable value1,
                                        java.io.Serializable value2,
                                        java.io.Serializable value3)
Get the ID of a unique property context.

See Also:
PropertyValueComponent.createPropertyUniqueContext(Serializable, Serializable, Serializable)

updatePropertyUniqueContext

void updatePropertyUniqueContext(java.lang.Long id,
                                 java.io.Serializable value1,
                                 java.io.Serializable value2,
                                 java.io.Serializable value3)
Update a unique property context.

See Also:
PropertyValueComponent.createPropertyUniqueContext(Serializable, Serializable, Serializable)

updatePropertyUniqueContext

java.lang.Long updatePropertyUniqueContext(java.io.Serializable value1Before,
                                           java.io.Serializable value2Before,
                                           java.io.Serializable value3Before,
                                           java.io.Serializable value1,
                                           java.io.Serializable value2,
                                           java.io.Serializable value3)
Update a combination of three unique properties. If the before values exist, then they are updated to the new values. If the before values don't exist, then the new values are created assuming no pre-existence - using create is better if there is no pre-existing set of values.

Parameters:
value1Before - the first property before (null allowed)
value2Before - the second property before (null allowed)
value3Before - the third property before (null allowed)
value1 - the first property (null allowed)
value2 - the second property (null allowed)
value3 - the third property (null allowed)
Returns:
Returns the ID of the unique property combination for later updates
Throws:
PropertyUniqueConstraintViolation - if the new combination is not unique

deletePropertyUniqueContext

void deletePropertyUniqueContext(java.lang.Long id)
Delete a unique property context.

See Also:
PropertyValueComponent.createPropertyUniqueContext(Serializable, Serializable, Serializable)

deletePropertyUniqueContexts

int deletePropertyUniqueContexts(java.io.Serializable[] values)
Delete a combination of three unique properties. It doesn't matter if the unique combination already existed or not.

Parameters:
values - an array of one, two or three values, any of which may be null
Returns:
Returns the number of unique combinations deleted


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