@Service(value="propertyManagement") @Transactional(propagation=REQUIRED) public class PropertyManagementImpl extends Object implements PropertyManagement
KEY_GROUP
Constructor and Description |
---|
PropertyManagementImpl() |
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 |
init()
init stuff
|
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.
|
@Transactional(propagation=SUPPORTS) public void addObjectPropertyFilter(PropertyType propertyType, String keyGroup, String propertyKey)
PropertyManagement
addObjectPropertyFilter
in interface PropertyManagement
propertyType
- the property typekeyGroup
- the key group of the propertypropertyKey
- the key of the propertypublic Set<StringPropertyTO> getAllObjectProperties(PropertyType propertyType, Long objectId) throws NotFoundException, AuthorizationException
PropertyManagement
getAllObjectProperties
in interface PropertyManagement
propertyType
- the property typeobjectId
- the object idNotFoundException
- in case the object does not existAuthorizationException
- in case the user is not allowed to access the properties of the object@Transactional(readOnly=true) public BinaryProperty getBinaryProperty(String keyGroup, String key)
PropertyManagement
getBinaryProperty
in interface PropertyManagement
keyGroup
- the key groupkey
- the key of the property@Transactional(readOnly=true) public Date getBinaryPropertyLastModificationDate(String keyGroup, String key)
PropertyManagement
getBinaryPropertyLastModificationDate
in interface PropertyManagement
keyGroup
- group of the property keykey
- the key of the property@Transactional(readOnly=true) public StringProperty getGlobalObjectProperty(PropertyType propertyType, Long objectId, String key) throws NotFoundException, AuthorizationException
PropertyManagement
getGlobalObjectProperty
in interface PropertyManagement
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 object@Transactional(readOnly=true) public StringProperty getObjectProperty(PropertyType propertyType, Long objectId, String keyGroup, String key) throws NotFoundException, AuthorizationException
PropertyManagement
getObjectProperty
in interface PropertyManagement
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@Transactional(readOnly=true) public StringProperty getObjectPropertyUnfiltered(PropertyType propertyType, Long objectId, String keyGroup, String key) throws NotFoundException, AuthorizationException
PropertyManagement
getObjectPropertyUnfiltered
in interface PropertyManagement
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@Transactional(readOnly=true) public <T> Collection<T> getUsersOfProperty(Long noteId, String keyGroup, String key, String value, Converter<User,T> converter) throws NotFoundException, AuthorizationException
PropertyManagement
getUsersOfProperty
in interface PropertyManagement
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 property@Transactional(readOnly=true) public boolean hasBinaryProperty(String keyGroup, String key)
PropertyManagement
hasBinaryProperty
in interface PropertyManagement
keyGroup
- the key groupkey
- the key of the property@Transactional(readOnly=true) public boolean hasUserNoteProperty(Long noteId, String keyGroup, String key, String value) throws NotFoundException, AuthorizationException
PropertyManagement
hasUserNoteProperty
in interface PropertyManagement
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 propertyNotFoundException
- in case the note does not existAuthorizationException
- in case the current user is not allowed to read the property@PostConstruct public void init()
public void removeBinaryProperty(String keyGroup, String propertyKey)
PropertyManagement
removeBinaryProperty
in interface PropertyManagement
keyGroup
- The group of the property key.propertyKey
- The properties key.@Transactional(propagation=SUPPORTS) public void removeObjectPropertyFilter(PropertyType propertyType, String keyGroup, String propertyKey)
PropertyManagement
removeObjectPropertyFilter
in interface PropertyManagement
propertyType
- the property typekeyGroup
- the key group of the propertypropertyKey
- the key of the propertypublic BinaryProperty setBinaryProperty(String keyGroup, String key, byte[] value) throws AuthorizationException
PropertyManagement
setBinaryProperty
in interface PropertyManagement
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 objectpublic StringProperty setGlobalObjectProperty(PropertyType propertyType, Long objectId, String key, String value) throws NotFoundException, AuthorizationException
PropertyManagement
setGlobalObjectProperty
in interface PropertyManagement
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 objectpublic void setObjectProperties(PropertyType propertyType, Long objectId, Set<StringPropertyTO> properties) throws NotFoundException, AuthorizationException
PropertyManagement
setObjectProperties
in interface PropertyManagement
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 objectpublic StringProperty setObjectProperty(PropertyType propertyType, Long objectId, String keyGroup, String key, String value) throws NotFoundException, AuthorizationException
PropertyManagement
setObjectProperty
in interface PropertyManagement
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.