|
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.DbQuestion
public class DbQuestion
Implementation of the Question interface.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.jivesoftware.forum.Question |
|---|
Question.State |
| Constructor Summary | |
|---|---|
DbQuestion(ForumThread thread)
Constructs a new Question. |
|
DbQuestion(long threadID)
Loads an existing question. |
|
| Method Summary | |
|---|---|
void |
addHelpfulAnswer(ForumMessage message)
Marks the specified message as a helpful answer to this question. |
void |
deleteProperty(java.lang.String name)
Deletes an extended property. |
boolean |
equals(java.lang.Object obj)
|
int |
getCachedSize()
Returns the approximate size of the Object in bytes. |
ForumMessage |
getCorrectAnswer()
Returns the correct answer, or null if no correct answer has been set. |
java.util.Date |
getCreationDate()
Returns the date this question was created. |
ForumThread |
getForumThread()
Returns the thread that the question is associated with. |
java.util.Collection |
getHelpfulAnswers()
Returns a read-only Collection of ForumMessage objects that have been marked as helpful. |
java.util.Collection |
getProperties(java.lang.String parentName)
Return all immediate children property values of a parent property as an unmodifiable Collection of String values. |
java.lang.String |
getProperty(java.lang.String name)
Returns an extended property of this object. |
java.util.Iterator |
getPropertyNames()
Returns an Iterator of String values for all the names of the properties. |
java.util.Date |
getResolutionDate()
Returns the date that question was resolved, or null if the question has not been resolved. |
Question.State |
getState()
Returns the resolution state of this question. |
User |
getUser()
Returns the user that created the question. |
int |
hashCode()
|
boolean |
isCorrectAnswer(ForumMessage message)
Returns true if the specified message is the correct answer. |
boolean |
isHelpfulAnswer(ForumMessage message)
Returns true if the specified message has been marked as a helpful answer to this question. |
void |
setCorrectAnswer(ForumMessage message)
Sets the specified message as the correct answer. |
void |
setProperty(java.lang.String name,
java.lang.String value)
Sets an extended property of object. |
void |
setState(Question.State state)
Sets the resolution state of this question. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DbQuestion(ForumThread thread)
public DbQuestion(long threadID)
throws NotFoundException
threadID - the threadID.
NotFoundException - if loading the question fails.| Method Detail |
|---|
public User getUser()
Question
getUser in interface Questionpublic ForumThread getForumThread()
Question
getForumThread in interface Questionpublic Question.State getState()
Question
getState in interface Question
public void setState(Question.State state)
throws UnauthorizedException
QuestionQuestion.State.open. Typically, this would happen
when the state has been set to Question.State.possibly_resolved
or Question.State.assumed_resolved but the user wants to
indicate that the question is still not resolved.
Question.State.possibly_resolved as long the state was previously
Question.State.open and there is at least one message posted
in the thread after the question creation date. Otherwise,
only a user with moderator or higher permission can set the state
to Question.State.possibly_resolved.
Question.State.assumed_resolved as long as the state
was not previously Question.State.resolved.
Question.State.resolved.Question.State.possibly_resolved when a new
message is posted in the thread if the current state is
Question.State.open.
Question.State.assumed_resolved when a support
agent posts an answer to the question that they believe is correct.
Or, when the user has abandoned the question and a moderator decides
that the question is answered.
Question.State.resolved
when a helpful answer is added to the question. Encourage the
question creator to set the state to Question.State.resolved when
a correct answer is set. Allow the user to set the state to
Question.State.resolved at any time; for example, if they solved
the problem themselves or independently of the forums.
setState in interface Questionstate - the resolution state.
UnauthorizedException - if not allowed to change the resolution
state to the specified value.public java.util.Date getCreationDate()
Question
getCreationDate in interface Questionpublic java.util.Date getResolutionDate()
QuestionQuestion.State.assumed_resolved or Question.State.resolved. The rules for the
resolution date are as follows:Question.State.assumed_resolved or Question.State.resolved.
getResolutionDate in interface Question
public void addHelpfulAnswer(ForumMessage message)
throws UnauthorizedException
Question
addHelpfulAnswer in interface Questionmessage - the message.
UnauthorizedException - if not allowed to mark the message as a
helpful answer.public boolean isHelpfulAnswer(ForumMessage message)
Question
isHelpfulAnswer in interface Questionmessage - the message.
public java.util.Collection getHelpfulAnswers()
Question
getHelpfulAnswers in interface Question
public void setCorrectAnswer(ForumMessage message)
throws UnauthorizedException
Question
setCorrectAnswer in interface Questionmessage - the message.
UnauthorizedException - if not allowed to set the specified message
as the correct answer to this question.public boolean isCorrectAnswer(ForumMessage message)
Question
isCorrectAnswer in interface Questionmessage - the message.
public ForumMessage getCorrectAnswer()
Question
getCorrectAnswer in interface Questionpublic java.lang.String getProperty(java.lang.String name)
Question
getProperty in interface Questionname - the name of the property to get.
public java.util.Collection getProperties(java.lang.String parentName)
Question
getProperties in interface QuestionparentName - the name of the parent property to return the children for.
public void setProperty(java.lang.String name,
java.lang.String value)
Question
setProperty in interface Questionname - the name of the property to set.value - the new value for the property.public void deleteProperty(java.lang.String name)
Questionname does not exist, this method will do nothing.
deleteProperty in interface Questionname - the name of the property to delete.public java.util.Iterator getPropertyNames()
Question
getPropertyNames in interface Questionpublic int getCachedSize()
Cacheable
getCachedSize in interface Cacheablepublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
Jive Forums Project Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||