|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FavouritesManager
Manager for basic Favourites functionality. Used for adding, removing and checking favourites of generic entities. It also adjusts favourite counts for entities
Method Summary | |
---|---|
void |
addFavourite(User user,
SharedEntity entity)
Add the given entity as a favourite of the user passed in add to favourites count if necessary. |
void |
addFavouriteInPosition(User user,
SharedEntity entity,
long position)
Add the given entity as a favourite of the user passed in, in the specified position, add to favourites count if necessary. |
void |
decreaseFavouriteSequence(User user,
SharedEntity entity)
Decreases the position of the SharedEntity relative to the user's set of all other entities of the same type. |
Collection |
getFavouriteIds(User user,
SharedEntity.TypeDescriptor entityType)
Get the ids of a user's favourite Entities for a given entity type |
void |
increaseFavouriteSequence(User user,
SharedEntity entity)
Increases the position of the SharedEntity relative to the user's set of all other entities of the same type. |
boolean |
isFavourite(User user,
SharedEntity entity)
Check to see if the given entity is a favourite of the user passed in. |
void |
moveToEndFavouriteSequence(User user,
SharedEntity entity)
Moves the position of the SharedEntity to the end relative to the user's set of all other entities of the same type. |
void |
moveToStartFavouriteSequence(User user,
SharedEntity entity)
Moves the position of the SharedEntity to the start relative to the user's set of all other entities of the same type. |
void |
removeFavourite(User user,
SharedEntity entity)
Remove the given entity as a favourite of the user passed in. |
void |
removeFavouritesForEntityDelete(SharedEntity entity)
Remove all favourite associations for a given entity for entity deletion. |
void |
removeFavouritesForUser(User user,
SharedEntity.TypeDescriptor entityType)
Remove the favourite associations for the given User and the given type |
Method Detail |
---|
void addFavourite(User user, SharedEntity entity) throws PermissionException
user
- The user adding the favouriteentity
- The entity to favourite
PermissionException
- when trying to add a filter as favourite when you have no permissionsvoid addFavouriteInPosition(User user, SharedEntity entity, long position) throws PermissionException
user
- The user adding the favouriteentity
- The entity to favouriteposition
- the position in which this entity should be added in the favourites order.
PermissionException
- when trying to add a filter as favourite when you have no permissionsvoid removeFavourite(User user, SharedEntity entity)
user
- The user removing the favouriteentity
- The entity to favouriteboolean isFavourite(User user, SharedEntity entity) throws PermissionException
user
- The user checking the favouriteentity
- The entity to favourite
PermissionException
- when checking a filter with no permissionCollection getFavouriteIds(User user, SharedEntity.TypeDescriptor entityType)
user
- The user for the associated entities. Can not be null.entityType
- The type of entities to get. E.g. SearchRequest.ENTITY_TYPE. Can not be null.
IllegalArgumentException
- for null user or entity typevoid removeFavouritesForUser(User user, SharedEntity.TypeDescriptor entityType)
user
- The user with whom to disassociate entities withentityType
- The type of entity to disassociate user with.void removeFavouritesForEntityDelete(SharedEntity entity)
entity
- The entity that is being deletedvoid increaseFavouriteSequence(User user, SharedEntity entity) throws PermissionException
SharedEntity
relative to the user's set of all other entities of the same type.
user
- the user whom the entity belongs toentity
- The entity in question
PermissionException
- when the user does not have permission to perform the action.void decreaseFavouriteSequence(User user, SharedEntity entity) throws PermissionException
SharedEntity
relative to the user's set of all other entities of the same type.
user
- the user whom the entity belongs toentity
- The entity in question
PermissionException
- when the user does not have permission to perform the action.void moveToStartFavouriteSequence(User user, SharedEntity entity) throws PermissionException
SharedEntity
to the start relative to the user's set of all other entities of the same type.
user
- the user whom the entity belongs toentity
- The entity in question
PermissionException
- when the user does not have permission to perform the action.void moveToEndFavouriteSequence(User user, SharedEntity entity) throws PermissionException
SharedEntity
to the end relative to the user's set of all other entities of the same type.
user
- the user whom the entity belongs toentity
- The entity in question
PermissionException
- when the user does not have permission to perform the action.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |