|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.forum.database.DbRatingManager
public class DbRatingManager
Field Summary | |
---|---|
protected java.util.ArrayList |
availableRatings
|
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. |
static DbRatingManager |
getInstance()
|
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. |
protected void |
loadAvailableRatings()
|
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. |
protected void |
sortRatings()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.ArrayList availableRatings
Method Detail |
---|
public static DbRatingManager getInstance()
public boolean isRatingsEnabled()
RatingManager
isRatingsEnabled
in interface RatingManager
public void setRatingsEnabled(boolean ratingsEnabled) throws UnauthorizedException
RatingManager
setRatingsEnabled
in interface RatingManager
ratingsEnabled
- true to enable the rating feature, false to disable
UnauthorizedException
- if not a system administratorpublic java.util.Iterator getAvailableRatings()
RatingManager
getAvailableRatings
in interface RatingManager
public int getAvailableRatingCount()
RatingManager
getAvailableRatingCount
in interface RatingManager
public Rating getRatingFromScore(int score)
RatingManager
getRatingFromScore
in interface RatingManager
score
- the score of the rating to retrieve
public Rating createRating(int score, java.lang.String description)
RatingManager
createRating
in interface RatingManager
score
- the score or rating level for the new ratingdescription
- the description of the new rating
public void removeRating(Rating rating)
RatingManager
removeRating
in interface RatingManager
rating
- the Rating to removepublic java.util.Iterator getRatings(ForumMessage message)
RatingManager
getRatings
in interface RatingManager
message
- the forum message to return ratings for
public java.util.Iterator getRatings(ForumThread thread)
RatingManager
getRatings
in interface RatingManager
thread
- the forum thread to return ratings for
public int getRatingCount(ForumMessage message)
RatingManager
getRatingCount
in interface RatingManager
message
- the forum message to return a rating count for
public int getRatingCount(ForumThread thread)
RatingManager
getRatingCount
in interface RatingManager
thread
- the forum thread to return a rating count for
public double getMeanRating(long messageID)
RatingManager
getMeanRating
in interface RatingManager
public double getMeanRating(ForumMessage message)
RatingManager
getMeanRating
in interface RatingManager
public double getMeanRating(ForumThread thread)
RatingManager
getMeanRating
in interface RatingManager
public boolean hasRated(User user, ForumMessage message)
RatingManager
hasRated
in interface RatingManager
user
- the user to checkmessage
- the forum message to check
public boolean hasRated(User user, ForumThread thread)
RatingManager
hasRated
in interface RatingManager
user
- the user to checkthread
- the forum thread to check
public Rating getRating(User user, ForumMessage message)
RatingManager
getRating
in interface RatingManager
user
- the user to checkmessage
- the forum message to check
public Rating getRating(User user, ForumThread thread)
RatingManager
getRating
in interface RatingManager
user
- the user to checkthread
- the forum thread to check
public void addRating(User user, ForumMessage message, Rating rating) throws UnauthorizedException
RatingManager
The author of the forum message cannot rate their own message.
addRating
in interface RatingManager
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 permissionspublic void addRating(User user, ForumThread thread, Rating rating) throws UnauthorizedException
RatingManager
addRating
in interface RatingManager
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 permissionsprotected void sortRatings()
protected void loadAvailableRatings()
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |