blackboard.data.discussionboard
Class Forum

java.lang.Object
  extended by blackboard.data.BbObject
      extended by blackboard.data.discussionboard.Forum
All Implemented Interfaces:
IBbObject, Identifiable, Positionable, java.lang.Cloneable

public class Forum
extends BbObject
implements Positionable

The Forum class provides a representation of a discussion board forum within the Bb Course Management System.

Since:
Bb 5.5
Version:
$Revision: #1 $ $Date: 2007/06/27 $

Field Summary
static DataType DATA_TYPE
           
 
Fields inherited from class blackboard.data.BbObject
_bbAttributes
 
Fields inherited from interface blackboard.data.Positionable
POS_UNDEFINED
 
Constructor Summary
Forum()
          Creates an instance of Forum with default property values.
 
Method Summary
 void appendTopLevelThread(Message msg)
          Appends the given Message to the current list of top level message threads currently defined for this Forum.
 java.lang.String getAvgPostPosition()
          Returns the average post position associated with this Forum
 java.lang.String getAvgPostSize()
          Returns the average post size associated with this Forum
 Id getConferenceId()
          Returns the parent conference Id associated with this Forum
 DataType getDataType()
          Returns the DataType identifier for this object.
 FormattedText getDescription()
          Returns the description of this Forum
 java.util.Calendar getEndDate()
          Returns the End date restriction on this Forum.
 boolean getIsAvailable()
          Returns whether this Conference is available.
 boolean getIsAvailableWithinDateRestrictions()
          Convenience method that returns whether this form is available within the date restrictions (if any ).
 java.lang.String getMaxPostSize()
          Returns the maximum post size associated with this Forum
 java.lang.String getMinPostSize()
          Returns the minimum post size associated with this Forum
 java.lang.String getMostRecentPost()
          Returns the most recent post date associated with this Forum
 int getPosition()
          Returns the position of this Forum.
 ForumProperties getProperties()
          Returns the ForumProperties associated with this Forum
 java.util.Calendar getStartDate()
          Returns the Start date restriction on this Forum.
 ForumStatus getStatus()
          Returns the ForumStatus associated with this Forum
 java.lang.String getTitle()
          Returns the title associated with this Forum
 BbList getTopLevelThreads()
          Returns the list of top level message threads for this Forum.
 void setAvgPostPosition(int avgPostPosition)
          Sets the average post positon for this Forum
 void setAvgPostSize(java.lang.String avgPostSize)
          Sets the average post size for this Forum
 void setConferenceId(Id iConfId)
          Sets the conference Id value for this Forum
 void setDescription(FormattedText desc)
          Sets the description of this Forum
 void setEndDate(java.util.Calendar endDate)
          Sets the end date restriction on this forum.
 void setIsAvailable(boolean bIsAvailable)
          Sets whether this Conference is available.
 void setMaxPostSize(java.lang.String maxPostSize)
          Sets the maximum post size for this Forum
 void setMinPostSize(java.lang.String minPostSize)
          Sets the minimum post size for this Forum
 void setMostRecentPost(java.lang.String mostRecentPost)
          Sets the most recent post date for this Forum
 void setPosition(int nPos)
          Sets the position of this Forum.
 void setProperties(ForumProperties properties)
          Sets the ForumProperties value for this Forum
 void setStartDate(java.util.Calendar startDate)
          Sets the start date restriction on this forum.
 void setStatus(ForumStatus status)
          Sets the ForumStatus value for this Forum
 void setTitle(java.lang.String strTitle)
          Sets the title associated with this Forum
 void setTopLevelThreads(BbList msgs)
          Sets the list of top level message threads for this Forum.
 void validate()
          Validates the contents of this Forum.
 
Methods inherited from class blackboard.data.BbObject
clone, getBbAttributes, getCreatedDate, getId, getModifiedDate, persist, setCreatedDate, setId, setModifiedDate, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DATA_TYPE

public static final DataType DATA_TYPE
Constructor Detail

Forum

public Forum()
Creates an instance of Forum with default property values.

Method Detail

getConferenceId

public Id getConferenceId()
Returns the parent conference Id associated with this Forum

Returns:
conference Id value for this forum

setConferenceId

public void setConferenceId(Id iConfId)
Sets the conference Id value for this Forum

Parameters:
iConfId - the conference Id value to use for this forum

getIsAvailable

public boolean getIsAvailable()
Returns whether this Conference is available.

Returns:
true if this conference is available, false otherwise

setIsAvailable

public void setIsAvailable(boolean bIsAvailable)
Sets whether this Conference is available.

Parameters:
bIsAvailable - true if this conference is available, false otherwise

getStartDate

public java.util.Calendar getStartDate()
Returns the Start date restriction on this Forum. If there is no restriction, this will be null.

Returns:
the start date restriction on this Forum
Since:
Bb 7.3

setStartDate

public void setStartDate(java.util.Calendar startDate)
Sets the start date restriction on this forum. Set to null to remove any restriction.

Parameters:
startDate - the start date restriction to set on the forum
Since:
Bb 7.3

getEndDate

public java.util.Calendar getEndDate()
Returns the End date restriction on this Forum. If there is no restriction, this will be null.

Returns:
the end date restriction on this Forum
Since:
Bb 7.3

setEndDate

public void setEndDate(java.util.Calendar endDate)
Sets the end date restriction on this forum. Set to null to remove any restriction.

Parameters:
endDate - the end date restriction to set on the forum
Since:
Bb 7.3

getIsAvailableWithinDateRestrictions

public boolean getIsAvailableWithinDateRestrictions()
Convenience method that returns whether this form is available within the date restrictions (if any ). If there are no date restrictions, will return the same result as getIsAvailable

Since:
Bb 7.3

getPosition

public int getPosition()
Returns the position of this Forum. This position should be used when displaying forums relative to each other. Position values are zero-based (the first element has a position value of zero, not one).

Specified by:
getPosition in interface Positionable
Returns:
the position of this forum within its current context. If this value has not been set or is unknown its value will be Positionable.POS_UNDEFINED.

setPosition

public void setPosition(int nPos)
Sets the position of this Forum. Position values are zero-based (the first element has a position value of zero, not one).

Specified by:
setPosition in interface Positionable
Parameters:
nPos - the new position value of this forum. This value should be a positive value.

getTitle

public java.lang.String getTitle()
Returns the title associated with this Forum

Returns:
the title value of this forum as a String

setTitle

public void setTitle(java.lang.String strTitle)
Sets the title associated with this Forum

Parameters:
strTitle - a String containing the title for this forum

getMostRecentPost

public java.lang.String getMostRecentPost()
Returns the most recent post date associated with this Forum

Returns:
the most recent post date of this forum as a String

setMostRecentPost

public void setMostRecentPost(java.lang.String mostRecentPost)
Sets the most recent post date for this Forum

Parameters:
mostRecentPost - the most recent post date to use for this Forum

getMinPostSize

public java.lang.String getMinPostSize()
Returns the minimum post size associated with this Forum

Returns:
the minimum post size of this conference

setMinPostSize

public void setMinPostSize(java.lang.String minPostSize)
Sets the minimum post size for this Forum

Parameters:
minPostSize - the minimum post size to use for this Forum

getMaxPostSize

public java.lang.String getMaxPostSize()
Returns the maximum post size associated with this Forum

Returns:
the maximum post size of this conference

setMaxPostSize

public void setMaxPostSize(java.lang.String maxPostSize)
Sets the maximum post size for this Forum

Parameters:
maxPostSize - the maximum post size to use for this Forum

getAvgPostSize

public java.lang.String getAvgPostSize()
Returns the average post size associated with this Forum

Returns:
the average post size of this conference

setAvgPostSize

public void setAvgPostSize(java.lang.String avgPostSize)
Sets the average post size for this Forum

Parameters:
avgPostSize - the average post size to use for this Forum

getAvgPostPosition

public java.lang.String getAvgPostPosition()
Returns the average post position associated with this Forum

Returns:
the average post position of this conference

setAvgPostPosition

public void setAvgPostPosition(int avgPostPosition)
Sets the average post positon for this Forum

Parameters:
avgPostPosition - the average post position to use for this Forum

getStatus

public ForumStatus getStatus()
Returns the ForumStatus associated with this Forum

Returns:
the ForumStatus value of this conference

setStatus

public void setStatus(ForumStatus status)
Sets the ForumStatus value for this Forum

Parameters:
status - the ForumStatus value to use for this Forum

setProperties

public void setProperties(ForumProperties properties)
Sets the ForumProperties value for this Forum

Parameters:
properties - the ForumProperties value to use for this Forum

getProperties

public ForumProperties getProperties()
Returns the ForumProperties associated with this Forum

Returns:
the ForumProperties value of this conference

getDescription

public FormattedText getDescription()
Returns the description of this Forum

Returns:
a {FormattedText} representing the description of this forum

setDescription

public void setDescription(FormattedText desc)
Sets the description of this Forum

Parameters:
desc - a FormattedText containing the description of this forum

getTopLevelThreads

public BbList getTopLevelThreads()
Returns the list of top level message threads for this Forum.

Returns:
a BbList with the top level threads for this forum

setTopLevelThreads

public void setTopLevelThreads(BbList msgs)
Sets the list of top level message threads for this Forum.

When top level threads are added to a forum in this manner, no enforcement of the relationship between a forum and its messages is performed. It is therefore the responsibility of the caller to have properly enforced these constraints. If enforcement of the elements of the relationship is desired, use appendTopLevelThread(Message) instead.

Parameters:
msgs - a BbList containing the set of top level message threads to use for this forum

appendTopLevelThread

public void appendTopLevelThread(Message msg)
Appends the given Message to the current list of top level message threads currently defined for this Forum.

This method enforces all constraints in the relationship of a top level thread and a forum. First, the parent/child relationship between a forum and a message is enforced by calling Message.setForumId(Id), passing in the local forum id value, on the provided Message prior to adding it to the list of top level threads. Top level thread do not have parent messages so an unset id value (Id.UNSET_ID is also enforced for the message parent id value.

Parameters:
msg - the Message to append to the current list of top level message threads

getDataType

public DataType getDataType()
Returns the DataType identifier for this object. Can be used to uniquely identify the "type" of this data object.

Specified by:
getDataType in interface IBbObject
Specified by:
getDataType in interface Identifiable
Specified by:
getDataType in class BbObject
Returns:
the DataType for this object

validate

public void validate()
              throws ValidationException
Validates the contents of this Forum. Internal consistency checks are also performed.

Specified by:
validate in interface IBbObject
Overrides:
validate in class BbObject
Throws:
ValidationException - if validation of this object fails


Copyright © 2003 Blackboard, Inc. All Rights Reserved.