RatingService GET node ratings statistics via REST.

Added node rating stats to the ratings.get webscript (for each scheme):
    average (mean) of all ratings for this node.
    total (sum) of all ratings for this node.
    count of all ratings for this node.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@21108 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Neil McErlean
2010-07-12 16:07:08 +00:00
parent abf1ea6968
commit 7ebf2e5e6a
2 changed files with 15 additions and 1 deletions

View File

@@ -328,7 +328,14 @@ public class RatingServiceImpl implements RatingService
}
}
}
return (float)ratingTotal / (float)ratingCount;
if (ratingCount == 0)
{
return -1;
}
else
{
return (float)ratingTotal / (float)ratingCount;
}
}
public int getRatingsCount(NodeRef targetNode, String ratingSchemeName)