|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@PublicService public interface RatingService
Interface for public and internal rating operations.
The RatingService can be used to manage ratings on any content node in the repository. These ratings are defined byrating schemes
which are injected via spring (see rating-service-context.xml
). The rating
schemes define a minimum and a maximum score value for that scheme.
Ratings can be applied
,
updated
and
removed
.
Method Summary | |
---|---|
void |
applyRating(org.alfresco.service.cmr.repository.NodeRef targetNode,
float rating,
java.lang.String ratingSchemeName)
This method applies the given rating to the specified target node. |
float |
getAverageRating(org.alfresco.service.cmr.repository.NodeRef targetNode,
java.lang.String ratingSchemeName)
This method returns the average (mean) rating in the specified scheme for the specified nodeRef. |
Rating |
getRatingByCurrentUser(org.alfresco.service.cmr.repository.NodeRef targetNode,
java.lang.String ratingSchemeName)
This method gets the Rating applied by the current user to the specified node in the specified
RatingScheme - if there is one. |
RatingScheme |
getRatingScheme(java.lang.String ratingSchemeName)
Returns the named rating scheme if there is one. |
java.util.Map |
getRatingSchemes()
Returns the available rating schemes keyed by name. |
int |
getRatingsCount(org.alfresco.service.cmr.repository.NodeRef targetNode,
java.lang.String ratingSchemeName)
This method gets the number of individual ratings which have been applied to the specified node in the specified RatingScheme . |
float |
getTotalRating(org.alfresco.service.cmr.repository.NodeRef targetNode,
java.lang.String ratingSchemeName)
This method gets the total accumulated rating score for the specified node in the specified RatingScheme . |
Rating |
removeRatingByCurrentUser(org.alfresco.service.cmr.repository.NodeRef targetNode,
java.lang.String ratingSchemeName)
This method removes any Rating applied by the current user to the specified node in the specified
RatingScheme . |
Method Detail |
---|
@NotAuditable java.util.Map getRatingSchemes()
rating schemes
keyed by name.
rating schemes
.@NotAuditable RatingScheme getRatingScheme(java.lang.String ratingSchemeName)
rating scheme
if there is one.
ratingSchemeName
- name of the rating scheme.
rating schemes
if one of that name is registered,
else null
.@NotAuditable void applyRating(org.alfresco.service.cmr.repository.NodeRef targetNode, float rating, java.lang.String ratingSchemeName) throws RatingServiceException
RatingServiceException
will be thrown.
targetNode
- the node to which the rating is to be applied.rating
- the rating which is to be applied.ratingSchemeName
- the name of the rating scheme to use.
RatingServiceException
- if the rating is not within the range defined by the named scheme
or if the named scheme is not registered or if the rating would result
in multiple ratings by the same user.RatingService.getRatingSchemes()
,
RatingScheme
@NotAuditable int getRatingsCount(org.alfresco.service.cmr.repository.NodeRef targetNode, java.lang.String ratingSchemeName)
RatingScheme
.
targetNode
- the node on which the rating is sought.ratingScheme
- the rating scheme to use.
RatingService.getRatingSchemes()
,
RatingScheme
@NotAuditable float getTotalRating(org.alfresco.service.cmr.repository.NodeRef targetNode, java.lang.String ratingSchemeName)
RatingScheme
.
That is, the rating scores for all users for the specified
node are summed to give the result.
targetNode
- the node on which the rating total is sought.ratingScheme
- the rating scheme to use.
RatingService.getRatingSchemes()
,
RatingScheme
@NotAuditable float getAverageRating(org.alfresco.service.cmr.repository.NodeRef targetNode, java.lang.String ratingSchemeName)
targetNode
- the node for which an average is sought.ratingSchemeName
- the rating scheme name in which the average is defined.
@NotAuditable Rating getRatingByCurrentUser(org.alfresco.service.cmr.repository.NodeRef targetNode, java.lang.String ratingSchemeName)
Rating
applied by the current user to the specified node in the specified
RatingScheme
- if there is one.
targetNode
- the node on which the rating is sought.ratingScheme
- the rating scheme to use.
null
.RatingService.getRatingSchemes()
,
RatingScheme
@NotAuditable Rating removeRatingByCurrentUser(org.alfresco.service.cmr.repository.NodeRef targetNode, java.lang.String ratingSchemeName)
Rating
applied by the current user to the specified node in the specified
RatingScheme
.
targetNode
- the node from which the rating is to be removed.ratingScheme
- the rating scheme to use.
null
.RatingService.getRatingSchemes()
,
RatingScheme
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |