|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.processor.BaseProcessorExtension
org.alfresco.repo.jscript.BaseScopableProcessorExtension
org.alfresco.repo.rating.script.ScriptRatingService
public class ScriptRatingService
Script object representing the rating service.
Constructor Summary | |
---|---|
ScriptRatingService()
|
Method Summary | |
---|---|
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 |
Methods inherited from class org.alfresco.repo.jscript.BaseScopableProcessorExtension |
---|
getScope, setScope |
Methods inherited from class org.alfresco.repo.processor.BaseProcessorExtension |
---|
getExtensionName, register, setExtensionName, setProcessor |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ScriptRatingService()
Method Detail |
---|
public 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
-
RatingServiceException
ScriptRatingService.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
-
null
public 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
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |