Jive API (3.0.13) Core Javadocs

com.jivesoftware.community
Interface Question

All Superinterfaces:
JiveObject

public interface Question
extends JiveObject

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.


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.
 ForumMessage getCorrectAnswer()
          Returns the correct answer, or null if no correct answer has been set.
 Date getCreationDate()
          Returns the date this question was created.
 ForumThread getForumThread()
          Returns the thread that the question is associated with.
 Collection<ForumMessage> getHelpfulAnswers()
          Returns a read-only Collection of ForumMessage objects that have been marked as helpful.
 Map<String,String> getProperties()
          Retrieve a map of all the extended properties for the question.
 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 isAssumedResolved()
          Determines if the state is Question.State.assumed_resolved
 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.
 boolean isOpen()
          Determines if the state is Question.State.open
 boolean isPossiblyResolved()
          Determines if the state is Question.State.possibly_resolved
 boolean isResolved()
          Determines if the state is Question.State.resolved
 void setAssumedResolved()
          Sets the state to Question.State.assumed_resolved
 void setCorrectAnswer(ForumMessage message)
          Sets the specified message as the correct answer.
 void setOpen()
          Sets the state to Question.State.open
 void setPossiblyResolved()
          Sets the state to Question.State.possibly_resolved
 void setResolved()
          Sets the state to Question.State.resolved
 void setState(Question.State state)
          Sets the resolution state of this question.
 
Methods inherited from interface com.jivesoftware.community.JiveObject
getID, getObjectType
 

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.

isResolved

boolean isResolved()
Determines if the state is Question.State.resolved

Returns:
true if the state is Question.State.resolved, false otherwise.

isAssumedResolved

boolean isAssumedResolved()
Determines if the state is Question.State.assumed_resolved

Returns:
true if the state is Question.State.assumed_resolved, false otherwise.

isPossiblyResolved

boolean isPossiblyResolved()
Determines if the state is Question.State.possibly_resolved

Returns:
true if the state is Question.State.possibly_resolved, false otherwise.

isOpen

boolean isOpen()
Determines if the state is Question.State.open

Returns:
true if the state is Question.State.open, false otherwise.

setResolved

void setResolved()
Sets the state to Question.State.resolved


setAssumedResolved

void setAssumedResolved()
Sets the state to Question.State.assumed_resolved


setPossiblyResolved

void setPossiblyResolved()
Sets the state to Question.State.possibly_resolved


setOpen

void setOpen()
Sets the state to Question.State.open


getCreationDate

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

Returns:
the date the question was created.

getResolutionDate

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.
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

Collection<ForumMessage> 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.
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.

getProperties

Map<String,String> getProperties()
Retrieve a map of all the extended properties for the question. Each question can have an arbitrary number of extended properties. This allows for enhanced functionality that is not part of the base interface. The map is alterable if the user is authorized to modify the document, however only a mapping of key -> value is allowed. Null keys and values are not allowed.

Returns:
a map of question extended properties.

Jive Product Page

Copyright © 1999-2007 Jive Software.