public class ScriptRatingService extends BaseScopableProcessorExtension
| Constructor and Description |
|---|
ScriptRatingService() |
| Modifier and Type | Method and Description |
|---|---|
void |
applyRating(ScriptNode node,
float rating,
java.lang.String ratingSchemeName)
Applies the given rating to the specified node using the specified ratingScheme.
|
float |
getAverageRating(ScriptNode node,
java.lang.String ratingSchemeName)
Gets the average (mean) rating by all users on the specified node in the specified scheme.
|
float |
getMax(java.lang.String ratingSchemeName)
Gets the maximum allowed rating for the specified rating scheme.
|
float |
getMin(java.lang.String ratingSchemeName)
Gets the minimum allowed rating for the specified rating scheme.
|
float |
getRating(ScriptNode node,
java.lang.String ratingSchemeName)
Gets the rating applied to the specified node in the specified scheme by
the currently authenticated user.
|
java.util.Date |
getRatingAppliedAt(ScriptNode node,
java.lang.String ratingSchemeName)
Gets the rating applied date for the specified node in the specified scheme by
the currently authenticated user.
|
java.lang.String[] |
getRatingSchemeNames()
Gets the names for rating schemes currently in the system.
|
int |
getRatingsCount(ScriptNode node,
java.lang.String ratingSchemeName)
Gets the number of ratings applied to the specified node by all users in the specified
scheme.
|
float |
getTotalRating(ScriptNode node,
java.lang.String ratingSchemeName)
Gets the total (sum) rating by all users on the specified node in the specified scheme.
|
boolean |
isSelfRatingAllowed(java.lang.String ratingSchemeName)
This method checks whether self-rating is allowed for the specified rating scheme.
|
void |
removeRating(ScriptNode node,
java.lang.String ratingSchemeName)
Removes any rating by the current user in the specified scheme from the specified
noderef.
|
void |
setServiceRegistry(ServiceRegistry serviceRegistry)
Set the service registry
|
getScope, setScopegetExtensionName, register, setExtensionName, setProcessorpublic void setServiceRegistry(ServiceRegistry serviceRegistry)
serviceRegistry - the service registry.public java.lang.String[] getRatingSchemeNames()
public float getMin(java.lang.String ratingSchemeName)
ratingSchemeName - public float getMax(java.lang.String ratingSchemeName)
ratingSchemeName - public boolean isSelfRatingAllowed(java.lang.String ratingSchemeName)
ratingSchemeName - the rating scheme bean name.true if users can rate their own content, else false.public void applyRating(ScriptNode node, float rating, java.lang.String ratingSchemeName)
RatingServiceException.node - rating - ratingSchemeName - RatingServiceExceptionScriptRatingService.getMin(String),
ScriptRatingService.getMax(String)public void removeRating(ScriptNode node, java.lang.String ratingSchemeName)
node - ratingSchemeName - public float getRating(ScriptNode node, java.lang.String ratingSchemeName)
node - ratingSchemeName - public java.util.Date getRatingAppliedAt(ScriptNode node, java.lang.String ratingSchemeName)
node - ratingSchemeName - nullpublic int getRatingsCount(ScriptNode node, java.lang.String ratingSchemeName)
node - ratingSchemeName - public float getTotalRating(ScriptNode node, java.lang.String ratingSchemeName)
node - ratingSchemeName - public float getAverageRating(ScriptNode node, java.lang.String ratingSchemeName)
node - ratingSchemeName - Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.