public class CSForum extends CSItem
A Forum contains threads, which in turn contain messages.
This class is used to read details of a forum from the database, write details of a new forum to the database, or modify details of an existing thread.
The setXXX(...)
methods are used to set forum details before a database get()
or
update()
is performed. getXXX()
methods are then used to access details of the forum.
CSForumMessage
,
CSForumThread
,
Serialized FormACCESS_GRANTED, DOES_NOT_EXIST, EMPTY, EXISTS, SECURE_ACCESS_DENIED, SECURE_ACCESS_GRANTED, UPDATE_ACTION_INSERTED, UPDATE_ACTION_UPDATED
LEVEL_ALL, LEVEL_ALL_PLUS_RELATED, LEVEL_DETAIL, LEVEL_ID, LEVEL_SUMMARY
Constructor and Description |
---|
CSForum()
Creates a new CSForumObject, no datasource is specified.
|
CSForum(java.lang.String strPropertyFile)
Creates a new CSForumObject, database details are specified in a database properties file.
|
Modifier and Type | Method and Description |
---|---|
void |
delete()
Not currently implemented for a forum.
|
void |
get()
Retrieves the details of a Forum from the database.
|
java.lang.String |
getDescription()
Get the description of this forum.
|
int |
getForumID()
Get the ID of this forum.
|
java.lang.String |
getForumName()
Get the name of this forum.
|
int |
getGroupID()
Get the ID of the immediate parent forum group.
|
java.lang.String |
getGroupName()
Get the name of the immediate parent forum group.
|
java.util.Date |
getLastMessage()
Get the date of the most recent message in this forum.
|
int |
getMessageCount()
Get the number of messages in this forum.
|
boolean |
getModerated()
Find out whether or not this is a moderated forum.
|
java.lang.String |
getRootForumIDs()
Gets the IDs of Root Forum Groups.
|
void |
setDescription(java.lang.String strDesc)
Set the description of this forum.
|
void |
setDetailLevel(int nDetailLevel)
Sets the level of detail to be handled by the
get method. |
void |
setForumID(int nForumID)
Set the ID of this forum.
|
void |
setForumName(java.lang.String strForumName)
Set the name of this forum.
|
void |
setGroupID(int nGroupID)
Set the ID of the immediate parent forum group.
|
void |
setGroupName(java.lang.String strGroupName)
Set the name of the immediate parent forum group.
|
void |
setLastMessage(java.util.Date LastMessage)
Set the date of the last message in this forum.
|
void |
setMessageCount(int nMessageCount)
Set the number of messages in this forum.
|
void |
setModerated(boolean bModerated)
Mark this as a moderated/unmoderated forum.
|
void |
setRootForumIDs(java.lang.String strRootForumIDs)
Sets the IDs of Root Forum Groups.
|
void |
update()
Not currently implemented for a forum.
|
equals, exist, getID, getStatus, hashCode, jsonString, serialiseWithTypes, setID, setStatus, toString, unset
clearRecordedGatewayMessages, clone, count, getCache, getCachingEnabled, getDatabaseVersion, getDatabaseVersion, getDebugOutput, getDetailLevel, getPreview, getPropertyFile, getPropertyFileExtension, getPropertyFilePathname, getRecordedGatewayMessages, getRecordGatewayMessages, getSendGatewayMessages, getUseCache, setDebugOutput, setPreview, setPropertyFile, setRecordGatewayMessages, setSendGatewayMessages, setUseCache
public CSForum()
public CSForum(java.lang.String strPropertyFile)
strPropertyFile
- the name of the property file from which the database connection details are to be read.public void setForumID(int nForumID)
nForumID
- the unique ID number of the forum which will be loaded or updated.public int getForumID()
public void setForumName(java.lang.String strForumName)
strForumName
- the name of this forum which will be saved onto the database.public java.lang.String getForumName()
public void setDescription(java.lang.String strDesc)
strDesc
- the description of this forum which will be saved onto the database.public java.lang.String getDescription()
public void setModerated(boolean bModerated)
bModerated
- a value of true indicates that this is a moderated forum, and all new threads and messages must be
approved before they are published.public boolean getModerated()
public void setMessageCount(int nMessageCount)
CSForumMultiple
when an individual forum is loaded from the database, the message count is not defined.
nMessageCount
- the number of messages in this forum.public int getMessageCount()
CSForum
has been
created by CSForumMultiple. When an individual forum is loaded from the database, the message count is not
defined.
public void setLastMessage(java.util.Date LastMessage)
getLastMessage()
.
LastMessage
- this date in not saved to the database, it represents the date of the most recent message in this
forum.public java.util.Date getLastMessage()
public void setGroupID(int nGroupID)
This property will only be set for database versions from 5.2.1.0 onwards.
nGroupID
- the ID of the parent forum group.public int getGroupID()
This property will only be set for database versions from 5.2.1.0 onwards.
public void setGroupName(java.lang.String strGroupName)
This property will only be set for database versions from 5.2.1.0 onwards.
strGroupName
- the name of the parent forum group.public java.lang.String getGroupName()
This property will only be set for database versions from 5.2.1.0 onwards.
public void setRootForumIDs(java.lang.String strRootForumIDs)
This parameter is useful to restrict forum queries to one particular subsite.
strRootForumIDs
- A comma seperated list of forum group IDs.public java.lang.String getRootForumIDs()
public void setDetailLevel(int nDetailLevel) throws CSParameterException
get
method.
Valid detail levels for a forum are :
LEVEL_ID - the forum ID
LEVEL_SUMMARY - the forum name, description and whether the forum is moderated or not
LEVEL_ALL - the message count and date of last message
Each detail level processes the information specified alongside it in addition to the information specified for all detail levels listed above it. The default detail level is LEVEL_SUMMARY.
setDetailLevel
in class CSDatabaseItem
nDetailLevel
- the detail level to be used.CSParameterException
- if an invalid detail level is specified.public void get() throws CSException
Use setForumID
or setForumName
to set the forum ID or name
which you are interested in, then get
to load the details from the database. This
CSForum
object is then populated with the details of the forum, which can be accessed using the
getXXX()
methods.
get
in class CSItem
CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSNotFoundException
- if the specified forum cannot be found on the database.CSSecurityException
- if security has been breached.CSException
- the base class for exceptions thrown by this method.public void update() throws CSException
update
in class CSItem
CSParameterException
- if an invalid combination of key information has been suppliedCSDatabaseException
- if there are problems accessing the databaseCSNotFoundException
- if the specified forum cannot be found on the databaseCSException
- the base class for exceptions thrown by this method.public void delete() throws CSException
delete
in class CSItem
CSParameterException
- if an invalid combination of key information has been suppliedCSDatabaseException
- if there are problems accessing the databaseCSNotFoundException
- if the specified forum cannot be found on the databaseCSException
- the base class for exceptions thrown by this method.Copyright © 2022 Goss Interactive Ltd. All Rights Reserved.