public class RatingServiceImpl extends DefaultComponent implements RatingService
RatingService
.lastModified
Constructor and Description |
---|
RatingServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected void |
addSuperSpaceRate(Activity fromActivity) |
void |
cancelRate(String username,
String activityObject,
String aspect)
Cancels a rate by the
username . |
void |
cancelRates(String activityObject,
String aspect)
Cancels all rates.
|
double |
getAverageRating(String activityObject,
String aspect)
Returns the average rating for the
activityObject on the given aspect . |
double |
getAverageRatingForUser(String username,
String activityObject,
String aspect)
Returns the average rating by
username for the activityObject on the given aspect . |
ActivitiesList |
getLastestRatedDocByUser(String username,
String aspect,
int limit)
Get the latest docs activities rated by a specific user
|
ActivitiesList |
getRatedChildren(String activityObject,
int rating,
String aspect)
Returns the list of their rated children
activityObject on the given aspect with rating . |
long |
getRatesCount(String activityObject,
int rating,
String aspect)
Returns the rates count for the
activityObject on the given aspect where the rating is equals to
rating . |
long |
getRatesCount(String activityObject,
String aspect)
Returns the rates count for the
activityObject on the given aspect . |
long |
getRatesCountForUser(String username,
String activityObject,
int rating,
String aspect)
Returns the rates count by
username for the activityObject on the given aspect where the
rating is equals to rating . |
long |
getRatesCountForUser(String username,
String activityObject,
String aspect)
Returns the rates count by
username for the activityObject on the given aspect . |
boolean |
hasUserRated(String username,
String activityObject,
String aspect)
Returns
true if the username already rated the activityObject on the given aspect
, false otherwise. |
void |
rate(String username,
int rating,
String activityObject,
String aspect)
Rates the
activityObject by the username . |
activate, applicationStarted, deactivate, getAdapter, getApplicationStartedOrder, getLastModified, registerContribution, registerExtension, setLastModified, setModifiedNow, unregisterContribution, unregisterExtension
public RatingServiceImpl()
public void rate(String username, int rating, String activityObject, String aspect)
RatingService
activityObject
by the username
.rate
in interface RatingService
rating
- the ratingaspect
- the rating aspectpublic void cancelRate(String username, String activityObject, String aspect)
RatingService
username
.cancelRate
in interface RatingService
activityObject
- the activity object on which cancelling the rateaspect
- the rating aspectpublic void cancelRates(String activityObject, String aspect)
RatingService
cancelRates
in interface RatingService
activityObject
- the activity object on which cancelling the rateaspect
- the rating aspect may be null.public boolean hasUserRated(String username, String activityObject, String aspect)
RatingService
true
if the username
already rated the activityObject
on the given aspect
, false
otherwise.hasUserRated
in interface RatingService
public long getRatesCount(String activityObject, String aspect)
RatingService
activityObject
on the given aspect
.getRatesCount
in interface RatingService
public long getRatesCount(String activityObject, int rating, String aspect)
RatingService
activityObject
on the given aspect
where the rating is equals to
rating
.getRatesCount
in interface RatingService
public long getRatesCountForUser(String username, String activityObject, String aspect)
RatingService
username
for the activityObject
on the given aspect
.getRatesCountForUser
in interface RatingService
public long getRatesCountForUser(String username, String activityObject, int rating, String aspect)
RatingService
username
for the activityObject
on the given aspect
where the
rating is equals to rating
.getRatesCountForUser
in interface RatingService
public double getAverageRating(String activityObject, String aspect)
RatingService
activityObject
on the given aspect
.getAverageRating
in interface RatingService
public double getAverageRatingForUser(String username, String activityObject, String aspect)
RatingService
username
for the activityObject
on the given aspect
.getAverageRatingForUser
in interface RatingService
public ActivitiesList getRatedChildren(String activityObject, int rating, String aspect)
RatingService
activityObject
on the given aspect
with rating
.getRatedChildren
in interface RatingService
public ActivitiesList getLastestRatedDocByUser(String username, String aspect, int limit)
RatingService
getLastestRatedDocByUser
in interface RatingService
username
- the desired userprotected void addSuperSpaceRate(Activity fromActivity)
Copyright © 2016 Nuxeo SA. All rights reserved.