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, setScope
getExtensionName, register, setExtensionName, setProcessor
public void setServiceRegistry(ServiceRegistry serviceRegistry)
serviceRegistry
- the service registry.public String[] getRatingSchemeNames()
public float getMin(String ratingSchemeName)
ratingSchemeName
- Stringpublic float getMax(String ratingSchemeName)
ratingSchemeName
- Stringpublic 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
- ScriptNoderating
- floatratingSchemeName
- StringRatingServiceException
getMin(String)
,
getMax(String)
public void removeRating(ScriptNode node, String ratingSchemeName)
node
- ScriptNoderatingSchemeName
- Stringpublic float getRating(ScriptNode node, String ratingSchemeName)
node
- ScriptNoderatingSchemeName
- Stringpublic Date getRatingAppliedAt(ScriptNode node, String ratingSchemeName)
node
- ScriptNoderatingSchemeName
- Stringnull
public int getRatingsCount(ScriptNode node, String ratingSchemeName)
node
- ScriptNoderatingSchemeName
- Stringpublic float getTotalRating(ScriptNode node, String ratingSchemeName)
node
- ScriptNoderatingSchemeName
- Stringpublic float getAverageRating(ScriptNode node, String ratingSchemeName)
node
- ScriptNoderatingSchemeName
- * @param ratingSchemeName StringCopyright © 2005–2017 Alfresco Software. All rights reserved.