Jive Forums API (5.5.8) Developer Javadocs

com.jivesoftware.forum
Interface Question

All Known Implementing Classes:
DbQuestion, QuestionProxy

public interface Question

Questions provide additional workflow around a thread; the thread creator asks a question and the question moves from unresolved to resolved as one or more answers are posted to the question. Note: Gold Edition feature only.


Nested Class Summary
static class Question.State
          Type-safe enumeration for the state a question is in.
 
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.
 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.
 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.
 

Method Detail

getUser

User getUser()
Returns the user that created the question.

Returns:
the user the created the question.

getForumThread

ForumThread getForumThread()
Returns the thread that the question is associated with.

Returns:
the thread that the question is associated with.

getState

Question.State getState()
Returns the resolution state of this question.

Returns:
the resolution state.

setState

void setState(Question.State state)
              throws UnauthorizedException
Sets the resolution state of this question. Rules for who is allowed to set the state of the question are as follows: When to set the state is left open in order to accomodate a variety of workflows and business rules. However, the typical rules are as follows:

Parameters:
state - the resolution state.
Throws:
UnauthorizedException - if not allowed to change the resolution state to the specified value.

getCreationDate

java.util.Date getCreationDate()
Returns the date this question was created.

Returns:
the date the question was created.

getResolutionDate

java.util.Date getResolutionDate()
Returns the date that question was resolved, or null if the question has not been resolved. A question is considered resolved if the state is Question.State.assumed_resolved or Question.State.resolved. The rules for the resolution date are as follows:

Returns:
the date the question was resolved, or null if the question has not been resolved.

addHelpfulAnswer

void addHelpfulAnswer(ForumMessage message)
                      throws UnauthorizedException
Marks the specified message as a helpful answer to this question.

Parameters:
message - the message.
Throws:
UnauthorizedException - if not allowed to mark the message as a helpful answer.
java.lang.IllegalArgumentException - if the message is not in the thread assocated with this question.

isHelpfulAnswer

boolean isHelpfulAnswer(ForumMessage message)
Returns true if the specified message has been marked as a helpful answer to this question.

Parameters:
message - the message.
Returns:
true if the specified message is a helpful answer to this question.

getHelpfulAnswers

java.util.Collection getHelpfulAnswers()
Returns a read-only Collection of ForumMessage objects that have been marked as helpful. If there are no helpful answers, this method will return an empty collection.

Returns:
a Collection of helpful answers (ForumMessage objects).

setCorrectAnswer

void setCorrectAnswer(ForumMessage message)
                      throws UnauthorizedException
Sets the specified message as the correct answer.

Parameters:
message - the message.
Throws:
UnauthorizedException - if not allowed to set the specified message as the correct answer to this question.
java.lang.IllegalArgumentException - if the message is not in the thread assocated with this question.

isCorrectAnswer

boolean isCorrectAnswer(ForumMessage message)
Returns true if the specified message is the correct answer.

Parameters:
message - the message.
Returns:
true if the specified message is the correct.

getCorrectAnswer

ForumMessage getCorrectAnswer()
Returns the correct answer, or null if no correct answer has been set.

Returns:
the correct answer.

getProperty

java.lang.String getProperty(java.lang.String name)
Returns an extended property of this object. Each question can have an arbitrary number of extended properties. This lets particular skins or filters provide enhanced functionality that is not part of the base interface.

Parameters:
name - the name of the property to get.
Returns:
the value of the property.

getProperties

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. A parent/child relationship is denoted by the "." character. For example, given the properties X.Y.A, X.Y.B, X.Y.C and X.Y.C.D, then the immediate child properties of X.Y are X.Y.A, X.Y.B, and X.Y.C (the value of X.Y.C.D would not be returned using this method).

Parameters:
parentName - the name of the parent property to return the children for.
Returns:
all Collection of all child property values for the given parent.

setProperty

void setProperty(java.lang.String name,
                 java.lang.String value)
                 throws UnauthorizedException
Sets an extended property of object. This object can have an arbitrary number of extended properties. This lets particular skins or filters provide enhanced functionality that is not part of the base interface.

Parameters:
name - the name of the property to set.
value - the new value for the property.
Throws:
UnauthorizedException - if not allowed to edit the message.

deleteProperty

void deleteProperty(java.lang.String name)
                    throws UnauthorizedException
Deletes an extended property. If the property specified by name does not exist, this method will do nothing.

Parameters:
name - the name of the property to delete.
Throws:
UnauthorizedException - if not allowed to edit the message.

getPropertyNames

java.util.Iterator getPropertyNames()
Returns an Iterator of String values for all the names of the properties.

Returns:
an Iterator for the names of all properties.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.