@Role
@Unstable
public interface LikeManager
Modifier and Type | Method and Description |
---|---|
void |
clearCache()
Clear all data from caches.
|
void |
clearCache(EntityReference target)
Clear like data related to the given reference from cache.
|
long |
countUserLikes(UserReference source)
Retrieve the total number of likes performed by a user.
|
long |
getEntityLikes(EntityReference target)
Retrieve like information a specific entity.
|
org.xwiki.security.authorization.Right |
getLikeRight() |
List<UserReference> |
getLikers(EntityReference target,
int offset,
int limit)
Retrieve the users who liked the given reference.
|
List<EntityReference> |
getUserLikes(UserReference source,
int offset,
int limit)
Retrieve the likes performed by the given user.
|
boolean |
isLiked(UserReference source,
EntityReference target)
Check if an entity is liked by an user without loading all likers.
|
boolean |
removeLike(UserReference source,
EntityReference target)
Allow a user to unlike an entity.
|
long |
saveLike(UserReference source,
EntityReference target)
Create a page like and save it.
|
long saveLike(UserReference source, EntityReference target) throws LikeException
source
- the user who performs the like.target
- the page or object to like.LikeException
- in case of problem when saving the like.List<EntityReference> getUserLikes(UserReference source, int offset, int limit) throws LikeException
source
- the user for whom to retrieve the entity likes.offset
- the offset used for pagination.limit
- the limit number of results to retrieve for pagination.LikeException
- in case of problem when getting the like.@Unstable long countUserLikes(UserReference source) throws LikeException
source
- the user who performs the likes to count.LikeException
- in case of problem when getting the information.long getEntityLikes(EntityReference target) throws LikeException
target
- the page or object for which to retrieve the like information.LikeException
- in case of problem when getting the like.boolean removeLike(UserReference source, EntityReference target) throws LikeException
source
- the user who performs the unlike.target
- the entity to unlike.true
if the entity has been properly unliked.LikeException
- in case of problem when removing the like.boolean isLiked(UserReference source, EntityReference target) throws LikeException
source
- the user who might have liked.target
- the entity which might have been liked.true
if the user liked the page already.LikeException
- in case of problem for loading the result.@Unstable List<UserReference> getLikers(EntityReference target, int offset, int limit) throws LikeException
target
- the page that has been liked.offset
- the offset used for pagination.limit
- the limit used for pagination.LikeException
- in case of problem for performing the query.org.xwiki.security.authorization.Right getLikeRight()
@Unstable void clearCache(EntityReference target)
target
- the reference for which data should be cleared.@Unstable void clearCache()
Copyright © 2004–2021 XWiki. All rights reserved.