public abstract class AbstractRatingsService extends AlfrescoService implements RatingService
CONTENT_CACHE, RENDITION_CACHE, session
Constructor and Description |
---|
AbstractRatingsService(AlfrescoSession repositorySession)
Default Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
computeIsRated(org.apache.chemistry.opencmis.commons.impl.UrlBuilder url)
Internal method to compute data from server and retrieve if the user has
rate this node.
|
protected abstract int |
computeRatingsCount(org.apache.chemistry.opencmis.commons.impl.UrlBuilder url)
Internal method to compute data from server and retrieve the number of
"like".
|
int |
getLikeCount(Node node)
Retrieves the number of likes for the specified node
|
protected abstract org.apache.chemistry.opencmis.commons.impl.json.JSONObject |
getRatingsObject()
Internal method to retrieve the ratings object from json data
|
protected abstract org.apache.chemistry.opencmis.commons.impl.UrlBuilder |
getRatingsUrl(Node node)
Internal method to retrieve a specific ratings url to like a node.
|
protected abstract org.apache.chemistry.opencmis.commons.impl.UrlBuilder |
getUnlikeUrl(Node node)
Internal method to retrieve a specific ratings url to unlike a node.
|
boolean |
isLiked(Node node)
Determine if the current user has liked this node.
|
void |
like(Node node)
Increases the like count for the specified node.
|
void |
unlike(Node node)
Removes a previous “like” of the specified node.
|
clear, convertException, convertNode, convertNode, convertStatusCode, delete, describeContents, getHttpInvoker, getSessionHttp, isCloudSession, isListNull, isMapNull, isObjectNull, isOnPremiseSession, isStringNull, post, put, read, saveContentStream, writeToParcel
public AbstractRatingsService(AlfrescoSession repositorySession)
repositorySession
- : Repository Session.protected abstract org.apache.chemistry.opencmis.commons.impl.UrlBuilder getRatingsUrl(Node node)
node
- : a rated nodeprotected abstract org.apache.chemistry.opencmis.commons.impl.json.JSONObject getRatingsObject()
public void like(Node node)
like
in interface RatingService
node
- : Node object (Folder or Document).protected abstract org.apache.chemistry.opencmis.commons.impl.UrlBuilder getUnlikeUrl(Node node)
node
- : a rated nodepublic void unlike(Node node)
unlike
in interface RatingService
node
- : Node object (Folder or Document).public int getLikeCount(Node node)
getLikeCount
in interface RatingService
node
- : Node object (Folder or Document).public boolean isLiked(Node node)
isLiked
in interface RatingService
node
- : Node object (Folder or Document).protected abstract int computeRatingsCount(org.apache.chemistry.opencmis.commons.impl.UrlBuilder url)
url
- : Alfresco REST API activity urlprotected abstract boolean computeIsRated(org.apache.chemistry.opencmis.commons.impl.UrlBuilder url)
url
- : Alfresco REST API activity urlCopyright © 2012-2018 Alfresco Software. All Rights Reserved.