org.liquidsite.core.content
Class ContentTopic

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

public class ContentTopic
extends Content

A discussion forum topic.


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 ContentTopic(ContentManager manager, ContentData data, DataSource src)
          Creates a new topic.
  ContentTopic(ContentManager manager, ContentForum parent)
          Creates a new topic with default values.
 
Method Summary
protected  void doValidate()
          Validates the object data before writing to the database.
 java.lang.String getSubject()
          Returns the topic subject.
 boolean isLocked()
          Checks if the topic locked flag is set.
 void setLocked(boolean locked)
          Sets the topic locked flag.
 void setName(java.lang.String name)
          Sets the topic name.
 void setSubject(java.lang.String subject)
          Sets the topic subject.
 
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, 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

ContentTopic

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

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

ContentTopic

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

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

setName

public void setName(java.lang.String name)
Sets the topic name. The topic name must be numeric and if assigned manually, care must be taken to make sure all topics in a forum have assigned names (or errors may occur). If no name is set one will be assigned automatically upon insertion in the database. Topic names should NEVER be changed.

Overrides:
setName in class Content
Parameters:
name - the new name

getSubject

public java.lang.String getSubject()
Returns the topic subject.

Returns:
the topic subject

setSubject

public void setSubject(java.lang.String subject)
Sets the topic subject.

Parameters:
subject - the new topic subject

isLocked

public boolean isLocked()
Checks if the topic locked flag is set.

Returns:
true if the topic locked flag is set, or false otherwise

setLocked

public void setLocked(boolean locked)
Sets the topic locked flag.

Parameters:
locked - the new topic locked flag

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