com.ondelette.servlet.webforum
Class Forum

java.lang.Object
  |
  +--com.ondelette.servlet.webforum.Forum

public final class Forum
extends java.lang.Object

A forum object containing posts and folder of posts


Field Summary
protected  int mAuthorizationLevel
          Threshold to be able to view the forum.
protected  java.io.File mConfigFile
          File containing the configuration parameters of this forum.
protected  java.lang.String mCSSURL
          URL pointing to the CSS file.
protected  java.lang.String mFailedLoginURL
           
protected  java.lang.String mForumFooter
          A string used in the footer of the HTML pages.
protected  ForumLocale mForumLocale
          The object which determines how things are displayed (including language, charset encoding...)
protected  java.io.File mForumLocaleFile
          File containing the parameter of the ForumLocale object.
protected  java.lang.String mForumSubTitle
          A subtitle to be displayed in HTML
protected  java.lang.String mForumTitle
          The title to be displayed in HTML
protected  java.io.File mMessageArchiveDirectory
          Directory where the database is stored.
protected  MessageFolder mMessageFolder
          MessageFolder object, maintains a database of sorts.
protected  int mPostPrivilege
          Threshold on user level for post privilege (default is 0).
protected  long mSaveDelay
          How often messages are written to disk.
protected  UserList mUserList
          List of all users registered with this forum.
protected  java.io.File mUserListFile
          File containing the list of users.
protected  java.lang.String mWelcomeURL
          A URL to the login page.
 
Constructor Summary
Forum(java.io.File forumconfigfile)
          Constructor for the Forum object
 
Method Summary
 MessageReference addMessage(Message message)
          Adds a feature to the Message attribute of the Forum object
 MessageReference addMessage(java.lang.String subjectString, java.lang.String messageString, java.lang.String authorString, java.lang.String emailString, java.lang.String optionalURLString, java.lang.String linkTitleString, User user)
          Adds a feature to the Message attribute of the Forum object
 MessageReference addReply(int k, java.lang.String subjectString, java.lang.String messageString, java.lang.String authorString, java.lang.String emailString, java.lang.String optionalURLString, java.lang.String linkTitleString, User user)
          Adds a feature to the Reply attribute of the Forum object
 void askForConfirmationOnDeletingMessage(int k, java.io.PrintWriter out, User user, java.lang.String servletPath)
           
 void deleteMessage(int k, java.io.PrintWriter out, User user, java.lang.String servletPath)
           
 void destroy()
           
 void displayUser(java.lang.String name, java.io.PrintWriter out, java.lang.String servletPath)
           
 void displayUserList(java.io.PrintWriter out, java.lang.String servletPath)
           
 void getLastMessages(int k, java.io.PrintWriter out, User user, java.lang.String servletPath)
          Gets the lastMessages attribute of the Forum object
 void getPage(int k, java.io.PrintWriter out, User user, java.lang.String servletPath)
          Gets the page attribute of the Forum object
 void showMessage(int k, java.io.PrintWriter out, User user, java.lang.String servletPath)
           
 void showWarningAutorizationRequired(java.io.PrintWriter out)
           
 void showWarningCannotChangeAdmin(java.io.PrintWriter out)
           
 void showWarningNameInUse(java.lang.String name, java.io.PrintWriter out)
           
 void showWarningPasswordsDontMatch(java.lang.String name, java.io.PrintWriter out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mForumTitle

protected java.lang.String mForumTitle
The title to be displayed in HTML

Since:
0.30

mForumSubTitle

protected java.lang.String mForumSubTitle
A subtitle to be displayed in HTML

Since:
0.30

mForumLocale

protected ForumLocale mForumLocale
The object which determines how things are displayed (including language, charset encoding...)

Since:
0.30

mSaveDelay

protected long mSaveDelay
How often messages are written to disk.

Since:
0.30

mPostPrivilege

protected int mPostPrivilege
Threshold on user level for post privilege (default is 0).

Since:
0.30

mMessageFolder

protected MessageFolder mMessageFolder
MessageFolder object, maintains a database of sorts.

Since:
0.30

mUserList

protected UserList mUserList
List of all users registered with this forum.

Since:
0.30

mMessageArchiveDirectory

protected java.io.File mMessageArchiveDirectory
Directory where the database is stored.

Since:
0.30

mConfigFile

protected java.io.File mConfigFile
File containing the configuration parameters of this forum.

Since:
0.30

mForumLocaleFile

protected java.io.File mForumLocaleFile
File containing the parameter of the ForumLocale object.

Since:
0.30

mUserListFile

protected java.io.File mUserListFile
File containing the list of users.

Since:
0.30

mAuthorizationLevel

protected int mAuthorizationLevel
Threshold to be able to view the forum.

Since:
0.30

mForumFooter

protected java.lang.String mForumFooter
A string used in the footer of the HTML pages.

Since:
0.30

mWelcomeURL

protected java.lang.String mWelcomeURL
A URL to the login page.

Since:
0.30

mFailedLoginURL

protected java.lang.String mFailedLoginURL

mCSSURL

protected java.lang.String mCSSURL
URL pointing to the CSS file.

Since:
0.30
Constructor Detail

Forum

public Forum(java.io.File forumconfigfile)
      throws java.io.IOException
Constructor for the Forum object

Parameters:
forumconfigfile -
Throws:
java.io.IOException
Since:
0.30
Method Detail

getPage

public void getPage(int k,
                    java.io.PrintWriter out,
                    User user,
                    java.lang.String servletPath)
             throws java.io.IOException
Gets the page attribute of the Forum object

Parameters:
k -
out -
user -
servletPath -
Throws:
java.io.IOException
Since:
0.30

getLastMessages

public void getLastMessages(int k,
                            java.io.PrintWriter out,
                            User user,
                            java.lang.String servletPath)
                     throws java.io.IOException
Gets the lastMessages attribute of the Forum object

Parameters:
k -
out -
user -
servletPath -
Throws:
java.io.IOException
Since:
0.30

addMessage

public MessageReference addMessage(java.lang.String subjectString,
                                   java.lang.String messageString,
                                   java.lang.String authorString,
                                   java.lang.String emailString,
                                   java.lang.String optionalURLString,
                                   java.lang.String linkTitleString,
                                   User user)
                            throws java.io.IOException
Adds a feature to the Message attribute of the Forum object

Parameters:
subjectString - The subject of this message
messageString - The actual message itself
optionalURLString - A URL that was given along with the message
linkTitleString - The title of the link
user - The feature to be added to the Message attribute
Returns:
an index to the message that has just been added
Throws:
java.io.IOException
Since:
0.30

addMessage

public MessageReference addMessage(Message message)
                            throws java.io.IOException
Adds a feature to the Message attribute of the Forum object

Parameters:
message - The feature to be added to the Message attribute
Returns:
Throws:
java.io.IOException
Since:
0.30

addReply

public MessageReference addReply(int k,
                                 java.lang.String subjectString,
                                 java.lang.String messageString,
                                 java.lang.String authorString,
                                 java.lang.String emailString,
                                 java.lang.String optionalURLString,
                                 java.lang.String linkTitleString,
                                 User user)
                          throws java.io.IOException
Adds a feature to the Reply attribute of the Forum object

Parameters:
k - The ID of this message
subjectString - The subject of this message
messageString - The body of this message
authorString - The name of the author of this message
emailString - The email address of the author of this message
optionalURLString - The URL of a link that goes at the bottom of the message
linkTitleString - The title of the link to be added
user - The user posting the message
Returns:
A reference to the message just added
Throws:
java.io.IOException
Since:
0.30

showMessage

public void showMessage(int k,
                        java.io.PrintWriter out,
                        User user,
                        java.lang.String servletPath)
                 throws java.io.IOException
Parameters:
k -
out -
user -
servletPath -
Throws:
java.io.IOException
Since:
0.30

deleteMessage

public void deleteMessage(int k,
                          java.io.PrintWriter out,
                          User user,
                          java.lang.String servletPath)
                   throws java.io.IOException
Parameters:
k -
out -
user -
servletPath -
Throws:
java.io.IOException
Since:
0.30

askForConfirmationOnDeletingMessage

public void askForConfirmationOnDeletingMessage(int k,
                                                java.io.PrintWriter out,
                                                User user,
                                                java.lang.String servletPath)
                                         throws java.io.IOException
Parameters:
k -
out -
user -
servletPath -
Throws:
java.io.IOException
Since:
0.30

destroy

public void destroy()
Since:
0.30

showWarningNameInUse

public void showWarningNameInUse(java.lang.String name,
                                 java.io.PrintWriter out)
                          throws java.io.IOException
Parameters:
name -
out -
Throws:
java.io.IOException
Since:
0.30

showWarningPasswordsDontMatch

public void showWarningPasswordsDontMatch(java.lang.String name,
                                          java.io.PrintWriter out)
                                   throws java.io.IOException
Parameters:
name -
out -
Throws:
java.io.IOException
Since:
0.30

showWarningAutorizationRequired

public void showWarningAutorizationRequired(java.io.PrintWriter out)
                                     throws java.io.IOException
Parameters:
out -
Throws:
java.io.IOException
Since:
0.30

showWarningCannotChangeAdmin

public void showWarningCannotChangeAdmin(java.io.PrintWriter out)
                                  throws java.io.IOException
Parameters:
out -
Throws:
java.io.IOException
Since:
0.30

displayUserList

public void displayUserList(java.io.PrintWriter out,
                            java.lang.String servletPath)
                     throws java.io.IOException
Parameters:
out -
servletPath -
Throws:
java.io.IOException
Since:
0.30

displayUser

public void displayUser(java.lang.String name,
                        java.io.PrintWriter out,
                        java.lang.String servletPath)
                 throws java.io.IOException
Parameters:
name -
out -
servletPath -
Throws:
java.io.IOException
Since:
0.30