org.liquidsite.core.content
Class ContentForum

java.lang.Object
  extended byorg.liquidsite.core.content.PersistentObject
      extended byorg.liquidsite.core.content.Content
          extended byorg.liquidsite.core.content.ContentForum

public class ContentForum
extends Content

A discussion forum.


Field Summary
 
Fields inherited from class org.liquidsite.core.content.Content
DOCUMENT_CATEGORY, FILE_CATEGORY, FOLDER_CATEGORY, FORUM_CATEGORY, NAME_CHARS, PAGE_CATEGORY, POST_CATEGORY, SECTION_CATEGORY, SITE_CATEGORY, TEMPLATE_CATEGORY, TOPIC_CATEGORY, TRANSLATOR_CATEGORY
 
Fields inherited from class org.liquidsite.core.content.PersistentObject
BINDERS, LOWER_CASE, NUMBERS, UPPER_CASE
 
Constructor Summary
protected ContentForum(ContentManager manager, ContentData data, DataSource src)
          Creates a new forum.
  ContentForum(ContentManager manager, ContentSection parent)
          Creates a new forum with default values.
 
Method Summary
protected  void doValidate()
          Validates the object data before writing to the database.
 java.lang.String getDescription()
          Returns the forum description.
 Group getModerator()
          Returns the moderator group.
 java.lang.String getModeratorName()
          Returns the moderator group name.
 java.lang.String getRealName()
          Returns the real forum name.
 boolean isModerator(User user)
          Checks if the specified user is a forum moderator.
 void setDescription(java.lang.String description)
          Sets the forum description.
 void setModerator(Group moderator)
          Sets the moderator group.
 void setModeratorName(java.lang.String moderator)
          Sets the moderator group name.
 void setRealName(java.lang.String name)
          Sets the real forum name.
 
Methods inherited from class org.liquidsite.core.content.Content
deleteRevision, doDelete, doInsert, doUpdate, equals, equals, getAllRevisions, getAttribute, getAttributeNames, getAuthor, getAuthorName, getCategory, getComment, getDomain, getDomainName, getId, getLock, getMaxRevisionNumber, getModifiedDate, getName, getOfflineDate, getOnlineDate, getParent, getParentId, getPermissions, getRevision, getRevisionNumber, isLatestRevision, isOnline, isPublishedRevision, setAttribute, setAuthorName, setComment, setId, setModifiedDate, setName, setOfflineDate, setOnlineDate, setParent, setParentId, setRevisionNumber, toString
 
Methods inherited from class org.liquidsite.core.content.PersistentObject
decodeMap, delete, delete, encodeMap, getContentManager, hasAdminAccess, hasPublishAccess, hasReadAccess, hasWriteAccess, isPersistent, restore, restore, save, save, validateChars, validateSize
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContentForum

public ContentForum(ContentManager manager,
                    ContentSection parent)
             throws ContentException
Creates a new forum with default values.

Parameters:
manager - the content manager to use
parent - the parent content section
Throws:
ContentException - if the database couldn't be accessed properly

ContentForum

protected ContentForum(ContentManager manager,
                       ContentData data,
                       DataSource src)
                throws ContentException
Creates a new forum.

Parameters:
manager - the content manager to use
data - the content data object
src - the data source to use
Throws:
ContentException - if the database couldn't be accessed properly
Method Detail

getRealName

public java.lang.String getRealName()
Returns the real forum name.

Returns:
the real forum name

setRealName

public void setRealName(java.lang.String name)
Sets the real forum name.

Parameters:
name - the new forum name

getDescription

public java.lang.String getDescription()
Returns the forum description.

Returns:
the forum description

setDescription

public void setDescription(java.lang.String description)
Sets the forum description.

Parameters:
description - the new forum description

getModerator

public Group getModerator()
                   throws ContentException
Returns the moderator group.

Returns:
the moderator group, or null for none
Throws:
ContentException - if the database couldn't be accessed properly

setModerator

public void setModerator(Group moderator)
Sets the moderator group.

Parameters:
moderator - the new moderator group, or null for none

getModeratorName

public java.lang.String getModeratorName()
Returns the moderator group name.

Returns:
the moderator group name, or an empty string for none

setModeratorName

public void setModeratorName(java.lang.String moderator)
Sets the moderator group name.

Parameters:
moderator - the new moderator group

isModerator

public boolean isModerator(User user)
                    throws ContentException
Checks if the specified user is a forum moderator.

Parameters:
user - the user to check
Returns:
true if the user is a forum moderator, or false otherwise
Throws:
ContentException - if the database couldn't be accessed properly

doValidate

protected void doValidate()
                   throws ContentException
Validates the object data before writing to the database.

Overrides:
doValidate in class Content
Throws:
ContentException - if the object data wasn't valid