public interface PropertyManagement
When accessing properties a filter is applied on the group and key to decide whether the property
is accessible. Only properties whose group and key were registered with
addObjectPropertyFilter(PropertyType, String, String)
will be accessible.
Modifier and Type | Field and Description |
---|---|
static String |
KEY_GROUP
Common key group for internal properties.
|
Modifier and Type | Method and Description |
---|---|
void |
addObjectPropertyFilter(PropertyType propertyType,
String keyGroup,
String propertyKey)
Add a combination of a property key group and property key to the accessible properties of
the given property type.
|
Set<StringPropertyTO> |
getAllObjectProperties(PropertyType propertyType,
Long objectId)
Get all filtered properties from a given object for the given property type
|
BinaryProperty |
getBinaryProperty(String keyGroup,
String key)
Get a binary property not bound to any context
|
Date |
getBinaryPropertyLastModificationDate(String keyGroup,
String key)
Get last modification date of a binary property.
|
StringProperty |
getGlobalObjectProperty(PropertyType propertyType,
Long objectId,
String key)
Get a global property which is a property with the predefined key group "global"
|
StringProperty |
getObjectProperty(PropertyType propertyType,
Long objectId,
String keyGroup,
String key)
Get an object property
|
StringProperty |
getObjectPropertyUnfiltered(PropertyType propertyType,
Long objectId,
String keyGroup,
String key)
Get an object property.
|
<T> Collection<T> |
getUsersOfProperty(Long noteId,
String keyGroup,
String key,
String value,
Converter<User,T> converter)
Return the users that have a specific note property set for a note.
|
boolean |
hasBinaryProperty(String keyGroup,
String key)
Test whether a binary property exists.
|
boolean |
hasUserNoteProperty(Long noteId,
String keyGroup,
String key,
String value)
Test whether the current user has a given property for a note.
|
void |
removeBinaryProperty(String keyGroup,
String propertyKey)
Remove a binary property.
|
void |
removeObjectPropertyFilter(PropertyType propertyType,
String keyGroup,
String propertyKey)
Remove a combination of a property key group and property key from the accessible properties
of the given type.
|
BinaryProperty |
setBinaryProperty(String keyGroup,
String key,
byte[] value)
Set a binary property.
|
StringProperty |
setGlobalObjectProperty(PropertyType propertyType,
Long objectId,
String key,
String value)
Set a global property which is a property with the predefined key group will be "global".
|
void |
setObjectProperties(PropertyType propertyType,
Long objectId,
Set<StringPropertyTO> properties)
Set several properties of an object.
|
StringProperty |
setObjectProperty(PropertyType propertyType,
Long objectId,
String keyGroup,
String key,
String value)
Set a new value of a property.
|
static final String KEY_GROUP
void addObjectPropertyFilter(PropertyType propertyType, String keyGroup, String propertyKey)
propertyType
- the property typekeyGroup
- the key group of the propertypropertyKey
- the key of the propertySet<StringPropertyTO> getAllObjectProperties(PropertyType propertyType, Long objectId) throws NotFoundException, AuthorizationException
propertyType
- the property typeobjectId
- the object idAuthorizationException
- in case the user is not allowed to access the properties of the objectNotFoundException
- in case the object does not existBinaryProperty getBinaryProperty(String keyGroup, String key)
keyGroup
- the key groupkey
- the key of the propertyDate getBinaryPropertyLastModificationDate(String keyGroup, String key)
keyGroup
- group of the property keykey
- the key of the propertyStringProperty getGlobalObjectProperty(PropertyType propertyType, Long objectId, String key) throws NotFoundException, AuthorizationException
propertyType
- the type of propertyobjectId
- the id of the object to get the property forkey
- the key of the propertyNotFoundException
- in case there is no object of the given property type and idAuthorizationException
- in case the user is not allowed to access the properties of the objectStringProperty getObjectProperty(PropertyType propertyType, Long objectId, String keyGroup, String key) throws NotFoundException, AuthorizationException
propertyType
- the type of propertyobjectId
- the ID of the object whose property should be retrievedkeyGroup
- the key group of the propertykey
- the key of the propertyNotFoundException
- in case there is no object of the given property type and idAuthorizationException
- in case the user is not allowed to access the properties of the objectStringProperty getObjectPropertyUnfiltered(PropertyType propertyType, Long objectId, String keyGroup, String key) throws NotFoundException, AuthorizationException
propertyType
- the type of propertyobjectId
- the ID of the object whose property should be retrievedkeyGroup
- the key group of the propertykey
- the key of the propertyNotFoundException
- in case there is no object of the given property type and idAuthorizationException
- in case the user is not allowed to access the properties of the object<T> Collection<T> getUsersOfProperty(Long noteId, String keyGroup, String key, String value, Converter<User,T> converter) throws NotFoundException, AuthorizationException
T
- the target type of the conversionnoteId
- the ID of the note for which the users that have the property should be returnedkeyGroup
- the group key of the searched propertykey
- the group of the searched propertyvalue
- the value of the searched propertyconverter
- the converter to convert the found usersNotFoundException
- in case the note does not existAuthorizationException
- in case the current user is not allowed to read the propertyboolean hasBinaryProperty(String keyGroup, String key)
keyGroup
- the key groupkey
- the key of the propertyboolean hasUserNoteProperty(Long noteId, String keyGroup, String key, String value) throws NotFoundException, AuthorizationException
noteId
- the ID of the note for which the existence of the property should be checkedkeyGroup
- the group key of the searched propertykey
- the group of the searched propertyvalue
- the value of the searched propertyAuthorizationException
- in case the current user is not allowed to read the propertyNotFoundException
- in case the note does not existvoid removeBinaryProperty(String keyGroup, String propertyKey)
keyGroup
- The group of the property key.propertyKey
- The properties key.void removeObjectPropertyFilter(PropertyType propertyType, String keyGroup, String propertyKey)
propertyType
- the property typekeyGroup
- the key group of the propertypropertyKey
- the key of the propertyBinaryProperty setBinaryProperty(String keyGroup, String key, byte[] value) throws AuthorizationException
keyGroup
- the key groupkey
- the key of the propertyvalue
- the value to setAuthorizationException
- in case the user is not allowed to access the properties of the objectStringProperty setGlobalObjectProperty(PropertyType propertyType, Long objectId, String key, String value) throws NotFoundException, AuthorizationException
propertyType
- the type of propertyobjectId
- the id of the object to set the property forkey
- the key of the propertyvalue
- the value to setNotFoundException
- in case there is no object of the given property type and idAuthorizationException
- in case the user is not allowed to access the properties of the objectvoid setObjectProperties(PropertyType propertyType, Long objectId, Set<StringPropertyTO> properties) throws NotFoundException, AuthorizationException
propertyType
- the type of propertyobjectId
- the id of the object to set the property forproperties
- Set of transfer objects describing the new properties or property valuesNotFoundException
- in case there is no object of the given property type and idAuthorizationException
- in case the user is not allowed to access the properties of the objectStringProperty setObjectProperty(PropertyType propertyType, Long objectId, String keyGroup, String key, String value) throws NotFoundException, AuthorizationException
propertyType
- the type of propertyobjectId
- the id of the object to set the property forkeyGroup
- the key group of the propertykey
- the key of the propertyvalue
- the value to set. Can be null to remove an existing property.NotFoundException
- in case there is no object of the given property type and idAuthorizationException
- in case the user is not allowed to access the properties of the objectCopyright © 2019 Communote team. All rights reserved.