|
Jive Forums API (5.5.20.2-oracle) Core Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RatingManager
Provides optional rating of forum messages. This feature is optional in that other Jive Forums classes do not call this API. Instead, the UI layer must explicitly check to see if a message is rated or unrated by any particular user and display rating options as appropriate.
An example usage to give a rating to a forum message is as follows:
RatingManager manager = factory.getRatingManager(); Iterator ratings = manager.getAvailableRatings(); ... (user chooses via a webpage or another mechanism a specific rating for a message) Rating rating = manager.getRating(3); // the chosen rating of the user with a score of 3 ForumMessage message = factory.getMessage(messageID); manager.addRating(user, message, rating); ...
Rating
Method Summary | |
---|---|
void |
addRating(User user,
ForumMessage message,
Rating rating)
Add a rating to the forum message. |
void |
addRating(User user,
ForumThread thread,
Rating rating)
Add a rating to the forum thread. |
Rating |
createRating(int score,
java.lang.String description)
Create a new rating with the specified attributes. |
int |
getAvailableRatingCount()
Returns the count of currently available ratings. |
java.util.Iterator |
getAvailableRatings()
Returns an iterator of Rating objects that list all the available ratings. |
double |
getMeanRating(ForumMessage message)
A convenience method which returns a geometric mean average of all the ratings given to the forum message. |
double |
getMeanRating(ForumThread thread)
A convenience method which returns a geometric mean average of all the ratings given to the forum thread. |
double |
getMeanRating(long messageID)
A convenience method which returns a geometric mean average of all the ratings given to the forum message. |
Rating |
getRating(User user,
ForumMessage message)
Returns the rating associated with the user, or null if this user hasn't rated the forum message. |
Rating |
getRating(User user,
ForumThread thread)
Returns the rating associated with the user, or null if this user hasn't rated the forum thread. |
int |
getRatingCount(ForumMessage message)
Returns the total number of ratings given to the forum message. |
int |
getRatingCount(ForumThread thread)
Returns the total number of ratings given to the forum thread. |
Rating |
getRatingFromScore(int score)
Retrieve the rating with the specified score. |
java.util.Iterator |
getRatings(ForumMessage message)
Returns an Iterator of all the ratings given to the forum message. |
java.util.Iterator |
getRatings(ForumThread thread)
Returns an Iterator of all the ratings given to the forum thread. |
boolean |
hasRated(User user,
ForumMessage message)
Returns whether the user has rated the forum message or not. |
boolean |
hasRated(User user,
ForumThread thread)
Returns whether the user has rated the forum thread or not. |
boolean |
isRatingsEnabled()
Returns true if the rating feature is turned on. |
void |
removeRating(Rating rating)
Remove the specified rating from the list of currently available ratings. |
void |
setRatingsEnabled(boolean ratingsEnabled)
Enables or disables the ratings feature. |
Method Detail |
---|
boolean isRatingsEnabled()
void setRatingsEnabled(boolean ratingsEnabled) throws UnauthorizedException
ratingsEnabled
- true to enable the rating feature, false to disable
UnauthorizedException
- if not a system administratorjava.util.Iterator getAvailableRatings()
int getAvailableRatingCount()
Rating getRatingFromScore(int score)
score
- the score of the rating to retrieve
Rating createRating(int score, java.lang.String description) throws UnauthorizedException
score
- the score or rating level for the new ratingdescription
- the description of the new rating
UnauthorizedException
- if not a system administratorvoid removeRating(Rating rating) throws UnauthorizedException
rating
- the Rating to remove
UnauthorizedException
- if not a system administratorjava.util.Iterator getRatings(ForumMessage message)
message
- the forum message to return ratings for
java.util.Iterator getRatings(ForumThread thread)
thread
- the forum thread to return ratings for
int getRatingCount(ForumMessage message)
message
- the forum message to return a rating count for
int getRatingCount(ForumThread thread)
thread
- the forum thread to return a rating count for
double getMeanRating(long messageID)
double getMeanRating(ForumMessage message)
double getMeanRating(ForumThread thread)
boolean hasRated(User user, ForumMessage message)
user
- the user to checkmessage
- the forum message to check
boolean hasRated(User user, ForumThread thread)
user
- the user to checkthread
- the forum thread to check
Rating getRating(User user, ForumMessage message)
user
- the user to checkmessage
- the forum message to check
Rating getRating(User user, ForumThread thread)
user
- the user to checkthread
- the forum thread to check
void addRating(User user, ForumMessage message, Rating rating) throws UnauthorizedException
The author of the forum message cannot rate their own message.
user
- the user rating the forum messagemessage
- the forum message to add the rating torating
- the rating the user wants to give to the forum message
UnauthorizedException
- if user does not have permissionsvoid addRating(User user, ForumThread thread, Rating rating) throws UnauthorizedException
user
- the user rating the forum threadthread
- the forum thread to add the rating torating
- the rating the user wants to give to the forum thread
UnauthorizedException
- if user does not have permissions
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |