public class CSForumMultiple extends CSItemMultiple
The CSForumMultiple
class provides a method, get()
, that retrieves several fora from
the database. This method requires that certain database and key information (forum IDs, for example) be specified
via the set
methods provided, prior to its invocation.
All database access/connectivity is handled internally by the CSForumMultiple
class.
LEVEL_ALL, LEVEL_ALL_PLUS_RELATED, LEVEL_DETAIL, LEVEL_ID, LEVEL_SUMMARY
Constructor and Description |
---|
CSForumMultiple()
Creates an empty
CSForumMultiple object. |
CSForumMultiple(java.lang.String strPropertyFile)
Creates an empty
CSForumMultiple object. |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Not currently implemented for forums.
|
boolean |
exist()
Not currently implemented for
CSForumMultiple . |
void |
get()
Retrieves the details of several forums from the database.
|
java.lang.String |
getFilter()
Gets the forum name filter currently specified as key information.
|
java.lang.String |
getForumList()
Gets list of forum IDs currently specified as key information.
|
java.lang.String |
getNameList()
Gets list of forum Names currently specified as key information.
|
int |
getRelatedArticleID()
Gets the article ID currently specified as key information.
|
java.lang.String |
getRootForumIDs()
Gets the IDs of Root Forum Groups.
|
boolean |
getTolerateNotFound()
Gets the flag that indicates whether a 'not found' exception is suppressed when a requested forum cannot be
found.
|
void |
setDetailLevel(int nDetailLevel)
Sets the level of detail to be handled by the
get method. |
void |
setFilter(java.lang.String strFilter)
Specifies the name filter to be used as key information.
|
void |
setForumList(java.lang.String strForumList)
Specify a list of forum IDs to be used as key information.
|
void |
setNameList(java.lang.String strNameList)
Specifies a list of forum names to be used as key information.
|
void |
setRelatedArticleID(int nRelatedArticleID)
Specifies the related article ID to be used as key information.
|
void |
setRootForumIDs(java.lang.String strRootForumIDs)
Sets the IDs of Root Forum Groups.
|
void |
setSortOrder(java.lang.String strSortOrderList)
Set the order in which fora will be retrieved.
|
void |
setTolerateNotFound(boolean bTolerateNotFound)
Sets a flag to prevent a 'not found' exception from being generated when a requested forum cannot be found.
|
java.lang.String |
toString()
Output the contents of this
CSForumMultiple object to a String object in a
user-friendly format. |
void |
update()
Not currently implemented for forums.
|
equals, getItems, getMaxRows, getSortOrder, getStartRow, iterator, setItems, setMaxRows, setStartRow
clearRecordedGatewayMessages, clone, count, getCache, getCachingEnabled, getDatabaseVersion, getDatabaseVersion, getDebugOutput, getDetailLevel, getPreview, getPropertyFile, getPropertyFileExtension, getPropertyFilePathname, getRecordedGatewayMessages, getRecordGatewayMessages, getSendGatewayMessages, getUseCache, setDebugOutput, setPreview, setPropertyFile, setRecordGatewayMessages, setSendGatewayMessages, setUseCache
public CSForumMultiple()
CSForumMultiple
object.
Use the various set
methods to initialise the CSForumMultiple
object prior to
invoking get
.
public CSForumMultiple(java.lang.String strPropertyFile)
CSForumMultiple
object. Database details are specified in a db properties file.
Use the various set
methods to initialise the CSForumMultiple
object prior to
invoking get
.
strPropertyFile
- the name of the property file from which the database connection details are to be read.public void setForumList(java.lang.String strForumList)
setForumList
followed by a call to get
will populate this
CSForumMultiple
with details of all the listed fora. Each forum will be stored as a
CSForum
object within the ArrayList
member - use getItems
or
iterator
to access/navigate through the fora. The fora will be stored in the
ArrayList
in the order that the IDs are specified in strForumList
strForumList
- a String
object containing a comma-separated list of forum IDs.public java.lang.String getForumList()
String
containing a comma-separated list of forum IDs.public void setNameList(java.lang.String strNameList)
setNameList
followed by a call to get
will populate this
CSForumMultiple
object with details of all the listed fora. Each forum will be stored as a
CSForum
object within the item ArrayList
member - use getItems
or
iterator
to access/navigate through the polls. The fora will be stored in the
ArrayList
in the order that the names are specified in the supplied list.
strNameList
- a String
containing a comma-separated list of forum names.public java.lang.String getNameList()
String
containing a comma-separated list of forum names.public void setFilter(java.lang.String strFilter)
If a filter is specified and no % is included in the filter, % is placed at the beginning so that any fora whose name is found to CONTAIN the specified text will be retrieved.
setFilter
followed by get
will result in this CSForumMultiple
object
being populated with the details of all fora whose name matches the filter specified. Each forum will be stored
as a CSForum
object within the item ArrayList
member - use getItems
or
iterator
to access/navigate through the forum. By default, fora will be stored in the
ArrayList
in name. This can be overridden by using the setSortOrder
method.
strFilter
- the forum name filter.public java.lang.String getFilter()
public void setRelatedArticleID(int nRelatedArticleID)
setRelatedArticleID
followed by get
will result in this
CSForumMultiple
object being populated with the details of all fora that are related to the
article specified. Each forum will be stored as a CSForum
object within the item ArrayList
member - use getItems
or iterator
to access/navigate through each forum.
By default, the fora will be stored in the ArrayList
in display order configured via iCM. This can
be overridden by using the setSortOrder
method.
nRelatedArticleID
- the ID of the article whose related polls are required.public int getRelatedArticleID()
public void setSortOrder(java.lang.String strSortOrderList) throws CSParameterException
This method should not be used if the setForumList
or
setNameList
key information is being supplied - in these instances the fora are
retrieved in the same order as the supplied IDs/Names. Otherwise, one or more of the available sort orders may be
specified as a comma-delimited list. Use ASC or DESC to indicate the direction of ordering for a sort order. For
example, "FORUMNAME DESC" would order in descending poll name order. ASC is assumed if neither ASC or DESC are
specified. If using the setRelatedArticleID
method, the default sort order will
be as configured for the fora within iCM.
Available sort orders are :
FORUMID - order by forum ID
FORUMNAME - order by forum name
MESSAGECOUNT - order by number of messages
LASTMESSAGE - order by date of most recent message
setSortOrder
in class CSItemMultiple
strSortOrderList
- a comma-separated list of one or more of the available sort orders.CSParameterException
- if an invalid sort order was specifiedpublic 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 setTolerateNotFound(boolean bTolerateNotFound)
If this flag is set, any forums not found will be included in the list of returned items but with 'nulled' content.
bTolerateNotFound
- The flag indicating if missing forums should be included in the returned set.public boolean getTolerateNotFound()
If this flag is set, any forums not found will be included in the set of returned items but with 'nulled' content.
public boolean exist() throws CSException
CSForumMultiple
.
exist
in class CSItemMultiple
true
if all forums exist on the databaseCSParameterException
- if an invalid combination of key information has been suppliedCSDatabaseException
- if there are problems accessing the databaseCSException
- the base class for exceptions thrown by this method.public void get() throws CSException
Use setForumList
or setNameList
followed by
get
to populate this CSForumMultiple
object with the details of the listed forums.
In this instance, the forums will be returned in the same order the IDs/Names are specified in the list. As such,
the setSortOrder
, setStartRow
and
setMaxRows
methods do not apply.
Use setRelatedArticleID
followed by get
to populate this
CSForumMultiple
object with the details of all forums that are related to the specified article.
By default, the retrieved forums will be in the order specified via iCM for the related forums. This can be
overridden by using the setSortOrder
method, however.
Each retrieved forum will be stored as a CSForum
object within the item ArrayList
member
of CSForumMultiple
- use getItems
or iterator
to
access/navigate through them.
get
in class CSItemMultiple
CSParameterException
- if an invalid combination of key information has been suppliedCSDatabaseException
- if there are problems accessing the databaseCSNotFoundException
- if a requested value cannot be found on the databaseCSSecurityException
- if security has been breachedCSException
- the base class for exceptions thrown by this method.public void update() throws CSException
update
in class CSItemMultiple
CSParameterException
- if an invalid combination of key information has been suppliedCSDatabaseException
- if there are problems accessing the databaseCSNotFoundException
- if one of the specified forums cannot be found on the databaseCSException
- the base class for exceptions thrown by this method.public void delete() throws CSException
delete
in class CSItemMultiple
CSParameterException
- if an invalid combination of key information has been suppliedCSDatabaseException
- if there are problems accessing the databaseCSNotFoundException
- if one of the specified forums cannot be found on the databaseCSException
- the base class for exceptions thrown by this method.public java.lang.String toString()
CSForumMultiple
object to a String
object in a
user-friendly format.
toString
in class CSItemMultiple
String
containing the user-friendly output.Copyright © 2022 Goss Interactive Ltd. All Rights Reserved.