@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)
PropertyManagementaddObjectPropertyFilter in interface PropertyManagementpropertyType - the property typekeyGroup - the key group of the propertypropertyKey - the key of the propertypublic Set<StringPropertyTO> getAllObjectProperties(PropertyType propertyType, Long objectId) throws NotFoundException, AuthorizationException
PropertyManagementgetAllObjectProperties in interface PropertyManagementpropertyType - 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)
PropertyManagementgetBinaryProperty in interface PropertyManagementkeyGroup - the key groupkey - the key of the property@Transactional(readOnly=true) public Date getBinaryPropertyLastModificationDate(String keyGroup, String key)
PropertyManagementgetBinaryPropertyLastModificationDate in interface PropertyManagementkeyGroup - 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
PropertyManagementgetGlobalObjectProperty in interface PropertyManagementpropertyType - 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
PropertyManagementgetObjectProperty in interface PropertyManagementpropertyType - 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
PropertyManagementgetObjectPropertyUnfiltered in interface PropertyManagementpropertyType - 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
PropertyManagementgetUsersOfProperty in interface PropertyManagementT - 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)
PropertyManagementhasBinaryProperty in interface PropertyManagementkeyGroup - 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
PropertyManagementhasUserNoteProperty in interface PropertyManagementnoteId - 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)
PropertyManagementremoveBinaryProperty in interface PropertyManagementkeyGroup - The group of the property key.propertyKey - The properties key.@Transactional(propagation=SUPPORTS) public void removeObjectPropertyFilter(PropertyType propertyType, String keyGroup, String propertyKey)
PropertyManagementremoveObjectPropertyFilter in interface PropertyManagementpropertyType - the property typekeyGroup - the key group of the propertypropertyKey - the key of the propertypublic BinaryProperty setBinaryProperty(String keyGroup, String key, byte[] value) throws AuthorizationException
PropertyManagementsetBinaryProperty in interface PropertyManagementkeyGroup - 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
PropertyManagementsetGlobalObjectProperty in interface PropertyManagementpropertyType - 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
PropertyManagementsetObjectProperties in interface PropertyManagementpropertyType - 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
PropertyManagementsetObjectProperty in interface PropertyManagementpropertyType - 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.