|
Jive Forums API (5.5.8) Developer Javadocs | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jivesoftware.forum.database.AnswerCountStatusLevelCalculator
public class AnswerCountStatusLevelCalculator
Provides a status level calculator implementations that is backed by question answers (helpful and correct). By default, helpful answers are worth 5 points and correct anaswers 10. These values can be changes by setting the Jive properties answerCount.helpfulPoints and answerCount.correctPoints.
| Nested Class Summary | |
|---|---|
static class |
AnswerCountStatusLevelCalculator.UserPointCacheKey
Key that is used in the answerCountPointCache that should have a point value attached to it. |
| Field Summary | |
|---|---|
static java.lang.String |
CORRECT_POINTS_PROPERTY
|
static int |
DEFAULT_CORRECT_POINTS
|
static int |
DEFAULT_HELPFUL_POINTS
|
static java.lang.String |
HELPFUL_POINTS_PROPERTY
|
| Constructor Summary | |
|---|---|
AnswerCountStatusLevelCalculator()
|
|
| Method Summary | |
|---|---|
void |
correctAnswerAdded(QuestionEvent event)
Fired when a correct answer has been added to the question. |
void |
forumAdded(ForumEvent event)
Fired when a forum has been added to the system. |
void |
forumDeleted(ForumEvent event)
Fired when a forum is about to be deleted from the system. |
void |
forumMerged(ForumEvent event)
Fired when a forum is merged into another forum. |
void |
forumModified(ForumEvent event)
Fired when a forum is modified. |
void |
forumMoved(ForumEvent event)
Fired when a forum has been moved from one category to another. |
Cache |
getCache()
|
protected java.lang.String |
getCategoryLeaders()
|
protected java.sql.PreparedStatement |
getCategoryLeaderStmt(java.sql.Connection con,
int[] leftright)
|
protected java.lang.String |
getCategoryPointLevel()
|
protected java.sql.PreparedStatement |
getCategoryPointStmt(java.sql.Connection con,
int[] leftright,
User user)
|
int |
getCorrectAnswerPoints()
|
protected java.lang.String |
getForumLeaders()
|
protected java.sql.PreparedStatement |
getForumLeaderStmt(java.sql.Connection con,
Forum forum)
|
protected java.lang.String |
getForumPointLevel()
|
protected java.sql.PreparedStatement |
getForumPointStmt(java.sql.Connection con,
User user,
Forum forum)
|
int |
getHelpfulAnswerPoints()
|
long[] |
getLeaderIds(ForumCategory category,
int startIndex,
int numResults)
Returns a long array of user ids of forum category leaders given a start index and desired number of results. |
long[] |
getLeaderIds(Forum forum,
int startIndex,
int numResults)
Returns a long array of user ids of forum leaders |
long[] |
getLeaderIds(int startIndex,
int numResults)
Returns a long array of user ids of system leaders given a start index and desired number of results. |
int |
getPointLevel(User user)
Returns the point level for a user system wide. |
int |
getPointLevel(User user,
Forum forum)
Returns the status level points for a user in regards to a specific forum |
int |
getPointLevel(User user,
ForumCategory category)
Returns the status level points for a user in regards to a specific category |
protected java.lang.String |
getSystemLeaders()
|
protected java.sql.PreparedStatement |
getSystemLeaderStmt(java.sql.Connection con)
|
protected java.lang.String |
getSystemPointLevel()
|
protected java.sql.PreparedStatement |
getSystemPointStmt(java.sql.Connection con,
User user)
|
void |
helpfulAnswerAdded(QuestionEvent event)
Fired when a correct answer has been added to the question. |
void |
messageAdded(MessageEvent event)
Fired when a message has been added to the system. |
void |
messageDeleted(MessageEvent event)
Fired when a message is about to be deleted from the system. |
void |
messageModerationModified(MessageEvent event)
Fired when the moderation value of a message has been changed. |
void |
messageModified(MessageEvent event)
Fired when portions of a message have been modified. |
void |
messageMoved(MessageEvent event)
Fired when a message is moved to another thread. |
void |
messageRated(MessageEvent event)
Fired when a message has been rated. |
void |
propertyModified(QuestionEvent event)
Fired when an extended property of a question is added, modified, or deleted. |
void |
questionAdded(QuestionEvent event)
Fired when a question has been added to the system. |
void |
questionDeleted(QuestionEvent event)
Fired when a question is about to be deleted from the system. |
void |
questionStateModified(QuestionEvent event)
Fired when the resolution state of a question changes. |
void |
threadAdded(ThreadEvent event)
Fired when a thread has been added to the system. |
void |
threadDeleted(ThreadEvent event)
Fired when a thread is about to be deleted from the system. |
void |
threadModerationModified(ThreadEvent event)
Fired when the moderation value of a thread has been changed. |
void |
threadMoved(ThreadEvent event)
Fired when a thread is moved from one foru to another. |
void |
threadRated(ThreadEvent event)
Fired when the thread has been rated. |
protected void |
updateUserCache(ForumMessage message,
int pointsToAdd)
Updates all the caches the user is associated with adding the value of pointsToAdd to each of them |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String HELPFUL_POINTS_PROPERTY
public static final java.lang.String CORRECT_POINTS_PROPERTY
public static final int DEFAULT_HELPFUL_POINTS
public static final int DEFAULT_CORRECT_POINTS
| Constructor Detail |
|---|
public AnswerCountStatusLevelCalculator()
| Method Detail |
|---|
protected java.lang.String getSystemPointLevel()
protected java.lang.String getForumPointLevel()
protected java.lang.String getCategoryPointLevel()
protected java.lang.String getSystemLeaders()
protected java.lang.String getForumLeaders()
protected java.lang.String getCategoryLeaders()
public int getPointLevel(User user)
StatusLevelCalculator
getPointLevel in interface StatusLevelCalculatoruser - user to get status level points for
protected java.sql.PreparedStatement getSystemPointStmt(java.sql.Connection con,
User user)
throws java.sql.SQLException
java.sql.SQLException
public int getPointLevel(User user,
Forum forum)
StatusLevelCalculator
getPointLevel in interface StatusLevelCalculatoruser - user user to get status level points forforum - forum to filter by
protected java.sql.PreparedStatement getForumPointStmt(java.sql.Connection con,
User user,
Forum forum)
throws java.sql.SQLException
java.sql.SQLException
public int getPointLevel(User user,
ForumCategory category)
StatusLevelCalculator
getPointLevel in interface StatusLevelCalculatoruser - user user to get status level points forcategory - category to filter by
protected java.sql.PreparedStatement getCategoryPointStmt(java.sql.Connection con,
int[] leftright,
User user)
throws java.sql.SQLException
java.sql.SQLException
public long[] getLeaderIds(int startIndex,
int numResults)
StatusLevelCalculator
getLeaderIds in interface StatusLevelCalculatorstartIndex - the start index for results.numResults - the desired number of results to return.
protected java.sql.PreparedStatement getSystemLeaderStmt(java.sql.Connection con)
throws java.sql.SQLException
java.sql.SQLException
public long[] getLeaderIds(ForumCategory category,
int startIndex,
int numResults)
StatusLevelCalculator
getLeaderIds in interface StatusLevelCalculatorcategory - category that the leaders leadstartIndex - the start index for results.numResults - the desired number of results to return.
protected java.sql.PreparedStatement getCategoryLeaderStmt(java.sql.Connection con,
int[] leftright)
throws java.sql.SQLException
java.sql.SQLException
public long[] getLeaderIds(Forum forum,
int startIndex,
int numResults)
StatusLevelCalculator
getLeaderIds in interface StatusLevelCalculatorforum - forum that the leaders belong tostartIndex - the start index for results.numResults - the desired number of results to return.
public Cache getCache()
protected java.sql.PreparedStatement getForumLeaderStmt(java.sql.Connection con,
Forum forum)
throws java.sql.SQLException
java.sql.SQLExceptionpublic int getHelpfulAnswerPoints()
public int getCorrectAnswerPoints()
public void questionAdded(QuestionEvent event)
QuestionListener
questionAdded in interface QuestionListenerevent - the event object.public void questionDeleted(QuestionEvent event)
QuestionListener
questionDeleted in interface QuestionListenerevent - the event object.public void questionStateModified(QuestionEvent event)
QuestionListener
questionStateModified in interface QuestionListenerevent - the event object.public void correctAnswerAdded(QuestionEvent event)
QuestionListener
correctAnswerAdded in interface QuestionListenerevent - the event object.public void helpfulAnswerAdded(QuestionEvent event)
QuestionListener
helpfulAnswerAdded in interface QuestionListenerevent - the event object.public void propertyModified(QuestionEvent event)
QuestionListener
propertyModified in interface QuestionListenerevent - the event object.public void forumAdded(ForumEvent event)
ForumListener
forumAdded in interface ForumListenerevent - the event object.public void forumDeleted(ForumEvent event)
ForumListener
forumDeleted in interface ForumListenerevent - the event object.public void forumModified(ForumEvent event)
ForumListener
forumModified in interface ForumListenerevent - the event object.public void forumMoved(ForumEvent event)
ForumListener
forumMoved in interface ForumListenerevent - the event object.public void forumMerged(ForumEvent event)
ForumListener
forumMerged in interface ForumListenerevent - the event object.public void threadAdded(ThreadEvent event)
ThreadListener
threadAdded in interface ThreadListenerevent - the event object.public void threadDeleted(ThreadEvent event)
ThreadListener
threadDeleted in interface ThreadListenerevent - the event object.public void threadMoved(ThreadEvent event)
ThreadListener
threadMoved in interface ThreadListenerevent - the event object.public void threadModerationModified(ThreadEvent event)
ThreadListener
threadModerationModified in interface ThreadListenerevent - the event object.public void threadRated(ThreadEvent event)
ThreadListener
threadRated in interface ThreadListenerevent - the event object.public void messageAdded(MessageEvent event)
MessageListener
messageAdded in interface MessageListenerevent - the event object.public void messageDeleted(MessageEvent event)
MessageListener
messageDeleted in interface MessageListenerevent - the event object.public void messageMoved(MessageEvent event)
MessageListener
messageMoved in interface MessageListenerevent - the event object.public void messageModified(MessageEvent event)
MessageListener
messageModified in interface MessageListenerevent - the event object.public void messageModerationModified(MessageEvent event)
MessageListener
messageModerationModified in interface MessageListenerevent - the event object.public void messageRated(MessageEvent event)
MessageListener
messageRated in interface MessageListenerevent - the event object.
protected void updateUserCache(ForumMessage message,
int pointsToAdd)
message - the message that caused the point change (was helpful or correct)pointsToAdd - amount of points to increment the scores too
|
Jive Forums Project Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||