AlfrescoRatingService Class Reference
Inherits from | NSObject |
Declared in | AlfrescoRatingService.h |
Overview
The AlfrescoRatingService is used for rating (like/unlike) nodes on the repository.
Author: Gavin Cornwell (Alfresco), Tijs Rademakers (Alfresco), Peter Schmidt (Alfresco)
Tasks
Initialisation methods
-
– initWithSession:
Initialises with a standard Cloud or OnPremise session For OnPremise sessions, the initialiser checks, whether the repository has Ratings capabilities. They are available only for Alfresco OnPremise server versions 4 or higher. For Repository versions below version 4, the initialiser will return NIL.
Retrieval and rating check methods
-
– retrieveLikeCountForNode:completionBlock:
Retrieves the number of likes for the given node.
-
– isNodeLiked:completionBlock:
Has the user liked the given node?
Rating methods
-
– likeNode:completionBlock:
Adds a like rating to the given node.
-
– unlikeNode:completionBlock:
Removes the like rating from the given node.
Instance Methods
initWithSession:
Initialises with a standard Cloud or OnPremise session For OnPremise sessions, the initialiser checks, whether the repository has Ratings capabilities. They are available only for Alfresco OnPremise server versions 4 or higher. For Repository versions below version 4, the initialiser will return NIL.
- (id)initWithSession:(id<AlfrescoSession>)session
Parameters
- session
the AlfrescoSession to initialise the site service with.
Discussion
Initialises with a standard Cloud or OnPremise session For OnPremise sessions, the initialiser checks, whether the repository has Ratings capabilities. They are available only for Alfresco OnPremise server versions 4 or higher. For Repository versions below version 4, the initialiser will return NIL.
Cloud services always have Rating Services enabled.
Declared In
AlfrescoRatingService.h
isNodeLiked:completionBlock:
Has the user liked the given node?
- (AlfrescoRequest *)isNodeLiked:(AlfrescoNode *)node completionBlock:(AlfrescoLikedCompletionBlock)completionBlock
Parameters
- node
The node for which the like rating should be validated.
- completionBlock
The block that’s called in case the operation succeeds.
Discussion
Has the user liked the given node?
Declared In
AlfrescoRatingService.h
likeNode:completionBlock:
Adds a like rating to the given node.
- (AlfrescoRequest *)likeNode:(AlfrescoNode *)node completionBlock:(AlfrescoBOOLCompletionBlock)completionBlock
Parameters
- node
The node for which the like rating should be added.
- completionBlock
The block that’s called in case the operation succeeds.
Discussion
Adds a like rating to the given node.
Declared In
AlfrescoRatingService.h
retrieveLikeCountForNode:completionBlock:
Retrieves the number of likes for the given node.
- (AlfrescoRequest *)retrieveLikeCountForNode:(AlfrescoNode *)node completionBlock:(AlfrescoNumberCompletionBlock)completionBlock
Parameters
- node
The node for which the like count needs to be retrieved.
- completionBlock
The block that’s called with the like count in case the operation succeeds.
Discussion
Retrieves the number of likes for the given node.
Declared In
AlfrescoRatingService.h
unlikeNode:completionBlock:
Removes the like rating from the given node.
- (AlfrescoRequest *)unlikeNode:(AlfrescoNode *)node completionBlock:(AlfrescoBOOLCompletionBlock)completionBlock
Parameters
- node
The node for which the like rating should be removed.
- completionBlock
The block that’s called in case the operation succeeds.
Discussion
Removes the like rating from the given node.
Declared In
AlfrescoRatingService.h