Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.RuntimeCollective.bboard.bean
Interface Topic  view Topic download Topic.java

All Superinterfaces:
com.RuntimeCollective.content.bean.Content, com.RuntimeCollective.webapps.bean.Duplicable, com.RuntimeCollective.webapps.bean.EntityBean, com.RuntimeCollective.webapps.bean.PermissionBean, java.io.Serializable
All Known Implementing Classes:
SimpleTopic

public interface Topic
extends com.RuntimeCollective.content.bean.Content, com.RuntimeCollective.webapps.bean.PermissionBean

An interface defining a topic within a bulletin board. The details of this topic (title, author, flag, etc) are usually taken from the details of the first message in it -- though this can be determined by a concrete implementation.

If you want to be spared the hassle of writing JSPs for the creation of your Topic objects, do have a look at the pages written for the Sussex Enterprise project. You can find them by checking out the relevent project: "cvs co rsework", then look in rsework/web and in rsework/web/admin.

The pages are called add/edit/delete(Board)TopicXXX.jsp. They should be pretty self-explanatory. The rsework/struts-config.xml file is also worth checking, for the action mappings etc.

And while you're at it, why not vanilla them and copy them to bboard/web/admin ...

You can also check the Sussex Enterprise staging server (ask Fabrice, JoeH or Sophie).

Version:
$Id: Topic.java,v 1.10 2003/09/30 15:12:43 joe Exp $

Field Summary
static java.lang.String DATABASE_TABLE
          The name of the database table for this bean type.
 
Fields inherited from interface com.RuntimeCollective.webapps.bean.EntityBean
INTERFACE_BEAN, NULL_ID
 
Method Summary
 void addMessage(Message message)
          Add a message to this topic.
 Board getBoard()
          Get the bulletin board that this topic is part of.
 java.lang.String getDescription(java.lang.String format)
          Get the description under a given format.
 java.lang.String getFlag()
          Get a string identifying a flag to be shown next to the topic.
 java.util.Date getLastMessageDate()
          Get the date the last message was added to this topic.
 com.RuntimeCollective.bboard.MessageList getMessageList()
          Get the message list for this topic.
 java.lang.Object[] getMessagesInfo()
          Return an array of Objects that provide metadata about this Topic's messages.
 int getNumMessages()
          Get the number of messages that belong to this topic.
 boolean getOpen()
          Get whether this topic is currently accepting new topics.
 java.util.Date getReadDate(com.RuntimeCollective.webapps.bean.User user)
          Get the date that this topic was last read by this user.
 boolean hasUnread(com.RuntimeCollective.webapps.bean.User user)
          Whether this topic contains any messages that this user has not read.
 void removeMessage(Message message)
          Remove a message from this topic.
 void setBoard(Board board)
          Set the bulletin board that this topic is part of.
 void setDescription(java.lang.String description, java.lang.String format)
          Set the description under a given format.
 void setFirstMessage(Message message)
          Set the first message of this topic.
 void setFlag(java.lang.String flag)
          Set a string identifying a flag to be shown next to the topic.
 void setLastMessageDate(java.util.Date lastMessageDate)
          Set the date the last message was added to this topic.
 void setOpen(boolean open)
          Set whether this topic is currently accepting new topics.
 void setReadDate(com.RuntimeCollective.webapps.bean.User user)
          Record that this topic has been read by this user.
 
Methods inherited from interface com.RuntimeCollective.content.bean.Content
getAuthor, getCreationDate, getDescription, getLastModifiedDate, getLastModifierUser, getTitle, setAuthor, setCreationDate, setDescription, setLastModifiedDate, setLastModifierUser, setTitle, viewFormat
 
Methods inherited from interface com.RuntimeCollective.webapps.bean.EntityBean
delete, getId, save, setId
 
Methods inherited from interface com.RuntimeCollective.webapps.bean.Duplicable
customiseDuplicate, makeDuplicate, makeDuplicate
 
Methods inherited from interface com.RuntimeCollective.webapps.bean.PermissionBean
canEdit, canView
 

Field Detail

DATABASE_TABLE

public static final java.lang.String DATABASE_TABLE
The name of the database table for this bean type.

See Also:
Constant Field Values
Method Detail

getBoard

public Board getBoard()
Get the bulletin board that this topic is part of.


setBoard

public void setBoard(Board board)
Set the bulletin board that this topic is part of.


getFlag

public java.lang.String getFlag()
Get a string identifying a flag to be shown next to the topic.


setFlag

public void setFlag(java.lang.String flag)
Set a string identifying a flag to be shown next to the topic.


getNumMessages

public int getNumMessages()
Get the number of messages that belong to this topic.


getMessagesInfo

public java.lang.Object[] getMessagesInfo()
Return an array of Objects that provide metadata about this Topic's messages. Element 0 will be lastMessageDate. Element 1 will be numMessages.

This method could merely return:

new Object[]{getLastMessageDate(), new Integer(getNumMessages())}
or could perform a single db query for efficiency.


getLastMessageDate

public java.util.Date getLastMessageDate()
Get the date the last message was added to this topic.


setLastMessageDate

public void setLastMessageDate(java.util.Date lastMessageDate)
Set the date the last message was added to this topic.


getOpen

public boolean getOpen()
Get whether this topic is currently accepting new topics.


setOpen

public void setOpen(boolean open)
Set whether this topic is currently accepting new topics.


setDescription

public void setDescription(java.lang.String description,
                           java.lang.String format)
Set the description under a given format.


getDescription

public java.lang.String getDescription(java.lang.String format)
Get the description under a given format.


getMessageList

public com.RuntimeCollective.bboard.MessageList getMessageList()
Get the message list for this topic.


addMessage

public void addMessage(Message message)
Add a message to this topic. This also adds the message to the relevant MessageList.


removeMessage

public void removeMessage(Message message)
Remove a message from this topic. This also removes the message from the relevant MessageList.


hasUnread

public boolean hasUnread(com.RuntimeCollective.webapps.bean.User user)
Whether this topic contains any messages that this user has not read.


setReadDate

public void setReadDate(com.RuntimeCollective.webapps.bean.User user)
Record that this topic has been read by this user.


getReadDate

public java.util.Date getReadDate(com.RuntimeCollective.webapps.bean.User user)
Get the date that this topic was last read by this user.


setFirstMessage

public void setFirstMessage(Message message)
Set the first message of this topic. This adds the message to the message list for this topic and sets the relevant topic details (author, title, flag, createDate etc).