public class ScriptRatingService extends BaseScopableProcessorExtension
| Constructor and Description |
|---|
ScriptRatingService() |
| Modifier and Type | Method and Description |
|---|---|
void |
applyRating(ScriptNode node,
float rating,
String ratingSchemeName)
Applies the given rating to the specified node using the specified ratingScheme.
|
float |
getAverageRating(ScriptNode node,
String ratingSchemeName)
Gets the average (mean) rating by all users on the specified node in the specified scheme.
|
float |
getMax(String ratingSchemeName)
Gets the maximum allowed rating for the specified rating scheme.
|
float |
getMin(String ratingSchemeName)
Gets the minimum allowed rating for the specified rating scheme.
|
float |
getRating(ScriptNode node,
String ratingSchemeName)
Gets the rating applied to the specified node in the specified scheme by
the currently authenticated user.
|
Date |
getRatingAppliedAt(ScriptNode node,
String ratingSchemeName)
Gets the rating applied date for the specified node in the specified scheme by
the currently authenticated user.
|
String[] |
getRatingSchemeNames()
Gets the names for rating schemes currently in the system.
|
int |
getRatingsCount(ScriptNode node,
String ratingSchemeName)
Gets the number of ratings applied to the specified node by all users in the specified
scheme.
|
float |
getTotalRating(ScriptNode node,
String ratingSchemeName)
Gets the total (sum) rating by all users on the specified node in the specified scheme.
|
boolean |
isSelfRatingAllowed(String ratingSchemeName)
This method checks whether self-rating is allowed for the specified rating scheme.
|
void |
removeRating(ScriptNode node,
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 String[] getRatingSchemeNames()
public float getMin(String ratingSchemeName)
ratingSchemeName - public float getMax(String ratingSchemeName)
ratingSchemeName - public boolean isSelfRatingAllowed(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, String ratingSchemeName)
RatingServiceException.node - rating - ratingSchemeName - RatingServiceExceptiongetMin(String),
getMax(String)public void removeRating(ScriptNode node, String ratingSchemeName)
node - ratingSchemeName - public float getRating(ScriptNode node, String ratingSchemeName)
node - ratingSchemeName - public Date getRatingAppliedAt(ScriptNode node, String ratingSchemeName)
node - ratingSchemeName - nullpublic int getRatingsCount(ScriptNode node, String ratingSchemeName)
node - ratingSchemeName - public float getTotalRating(ScriptNode node, String ratingSchemeName)
node - ratingSchemeName - public float getAverageRating(ScriptNode node, String ratingSchemeName)
node - ratingSchemeName - Copyright © 2005–2014 Alfresco Software. All rights reserved.