Interface RatingService
-
- All Known Implementing Classes:
DefaultRatingService
public interface RatingService
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
deleteComponentRatings(String componentInstanceId)
Remove all resources notations of given appvoid
deleteRaterRating(RaterRatingPK pk)
Remove rater rating of identified resourcevoid
deleteRating(ContributionRatingPK pk)
Remove all notations of identified resourcestatic RatingService
get()
ContributionRating
getRating(SilverpeasContent contribution)
Getting notation about the given contribution.ContributionRating
getRating(ContributionRatingPK pk)
Getting notation about once given resource identified by its PK.Map<String,ContributionRating>
getRatings(SilverpeasContent... contributions)
Getting notation about the given contributions.boolean
hasUserRating(RaterRatingPK pk)
Checking if user has given a rating on this resourcevoid
moveRating(ContributionRatingPK pk, String componentInstanceId)
Remove all notations of identified resource to the specified component instance identifier.void
updateRating(RaterRatingPK pk, int note)
Save user notation.
-
-
-
Method Detail
-
get
static RatingService get()
-
updateRating
void updateRating(RaterRatingPK pk, int note)
Save user notation. Create it or update it if it already exists.- Parameters:
pk
- identifying the rated resource and the raternote
- the rate given to this resource by the user
-
moveRating
void moveRating(ContributionRatingPK pk, String componentInstanceId)
Remove all notations of identified resource to the specified component instance identifier.- Parameters:
pk
- identifying the resourcecomponentInstanceId
- the target component identified by its instance id.
-
deleteRating
void deleteRating(ContributionRatingPK pk)
Remove all notations of identified resource- Parameters:
pk
- identifying the resource
-
deleteRaterRating
void deleteRaterRating(RaterRatingPK pk)
Remove rater rating of identified resource- Parameters:
pk
- identifying the resource and the rater
-
deleteComponentRatings
void deleteComponentRatings(String componentInstanceId)
Remove all resources notations of given app- Parameters:
componentInstanceId
- identitier of the component instance.
-
getRatings
Map<String,ContributionRating> getRatings(SilverpeasContent... contributions)
Getting notation about the given contributions. If a contribution has no notation, aContributionRating
instance is returned anyway.- Parameters:
contributions
- the contributions which returned ratings must be attached.- Returns:
ContributionRating
instances ralated to the given contributions indexed by contribution identifier.
-
getRating
ContributionRating getRating(SilverpeasContent contribution)
Getting notation about the given contribution. If the contribution has no notation, aContributionRating
instance is returned anyway.- Parameters:
contribution
- the contribution which returned ratings must be attached.- Returns:
ContributionRating
instance ralated to the given contribution.
-
getRating
ContributionRating getRating(ContributionRatingPK pk)
Getting notation about once given resource identified by its PK. If the resource has no notation, a NotationDetail is returned anyway.- Parameters:
pk
- identity of resource- Returns:
- Notation of identified resource
-
hasUserRating
boolean hasUserRating(RaterRatingPK pk)
Checking if user has given a rating on this resource- Parameters:
pk
- identity of resource and rater- Returns:
- true if user has already given a rate
-
-