public class CSPollMultiple extends CSItemMultiple
The CSPollMultiple
class provides a method that retrieves several polls from the database. This method
requires that certain database and key information (poll IDs, for example) be specified via the set
methods provided, prior to its invocation.
All database access/connectivity is handled internally by the CSPollMultiple
class.
CSPoll
,
CSPollContent
,
CSPollContentAnswer
,
Serialized FormLEVEL_ALL, LEVEL_ALL_PLUS_RELATED, LEVEL_DETAIL, LEVEL_ID, LEVEL_SUMMARY
Constructor and Description |
---|
CSPollMultiple()
Creates an empty
CSPollMultiple object. |
CSPollMultiple(java.lang.String strPropertyFile)
Creates a
CSPollMultiple object, specifying a property file that contains all of the database
connection details. |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Not currently implemented for
CSPollMultiple . |
boolean |
exist()
Not currently implemented for
CSPollMultiple . |
void |
get()
Retrieves the details of several polls from the database.
|
int |
getArticleID()
Gets the article ID currently specified as key information.
|
java.lang.String |
getFilter()
Gets the poll name filter currently specified as key information.
|
boolean |
getIgnoreVisibility()
Gets the flag that determines whether invisible polls are retrieved by the
get method. |
java.lang.String |
getNameList()
Gets the list of poll names currently specified as key information.
|
java.lang.String |
getPollList()
Gets list of poll IDs currently specified as key information.
|
java.lang.String |
getRootPollIDs()
Gets the IDs of Root Poll Groups.
|
void |
setArticleID(int nArticleID)
Specifies the article ID to be used as key information.
|
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 |
setIgnoreVisibility(boolean bIgnoreVisibility)
Sets the flag that determines whether invisible polls are retrieved by the
get method. |
void |
setNameList(java.lang.String strNameList)
Specifies a list of poll names to be used as key information.
|
void |
setPollList(java.lang.String strPollList)
Specifies a list of poll IDs to be used as key information.
|
void |
setRootPollIDs(java.lang.String strRootPollIDs)
Sets the IDs of Root Poll Groups.
|
void |
setSortOrder(java.lang.String strSortOrderList)
Sets the order in which the polls are to be retrieved.
|
java.lang.String |
toString()
Outputs the contents of this
CSPollMultiple object to a String object in a
user-friendly format. |
void |
update()
Not currently implemented for
CSPollMultiple . |
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 CSPollMultiple()
CSPollMultiple
object.
Use the various set
methods provided to initialise the CSPollMultiple
object prior
to invoking any of its query methods.
public CSPollMultiple(java.lang.String strPropertyFile)
CSPollMultiple
object, specifying a property file that contains all of the database
connection details.
Use the various set methods provided to initialise the CSPollMultiple
object prior to invoking any
of its query methods.
strPropertyFile
- The name of the property filepublic void setSortOrder(java.lang.String strSortOrderList) throws CSParameterException
This method should not be used if the setPollList
or
setNameList
key information is being supplied - in these instances the polls 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, "POLLNAME DESC" would order in descending poll name order. ASC is assumed if neither ASC or DESC are
specified. If using the setArticleID
method, the default sort order will be as
configured for the polls within iCM. If using the setFilter
method, the default sort
order will be POLLID.
Available sort orders are :
POLLID - order by poll ID
POLLNAME - order by poll name
AUTHOR - order by poll author
QUESTION - order by poll question
STARTDATE - order by poll start date
ENDDATE - order by poll end date
TOTALVOTES - order by poll total votes
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 specified.public void setDetailLevel(int nDetailLevel) throws CSParameterException
get
method.
Valid detail levels for a poll are :
LEVEL_ID - the poll ID
LEVEL_SUMMARY - the poll name, type and question
LEVEL_DETAIL - the poll author, start date and end date
LEVEL_ALL - the poll's questions and the total number of votes
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_ALL.
setDetailLevel
in class CSDatabaseItem
nDetailLevel
- The detail level to be usedCSParameterException
- if an invalid detail level is specified.public void setPollList(java.lang.String strPollList)
setPollList
followed by a call to get
will populate this
CSPollMultiple
object with details of all the listed polls. Each poll will be stored as a
CSPoll
object within the item ArrayList
member - use getItems
or
iterator
to access/navigate through the polls. The polls will be stored in the
ArrayList
in the order that the IDs are specified in the supplied list.
strPollList
- A String
object containing a comma-separated list of poll IDspublic java.lang.String getPollList()
String
object containing a comma-separated list of poll IDs.public void setNameList(java.lang.String strNameList)
setNameList
followed by a call to get
will populate this
CSPollMultiple
object with details of all the listed polls. Each poll will be stored as a
CSPoll
object within the item ArrayList
member - use getItems
or
iterator
to access/navigate through the polls. The polls will be stored in the
ArrayList
in the order that the names are specified in the supplied list.
strNameList
- A String
object containing a comma-separated list of poll names.public java.lang.String getNameList()
String
object containing a comma-separated list of poll 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 and end so that any poll whose name is found to CONTAIN the specified text will be retrieved.
setFilter
followed by get
will result in this CSPollMultiple
object
being populated with the details of all polls whose name matches the filter specified. Each poll will be stored
as a CSPoll
object within the item ArrayList
member - use getItems
or
iterator
to access/navigate through the polls. By default, the polls will be stored in the
ArrayList
in poll ID order. This can be overridden by using the
setSortOrder
method. Use the setStartRow
and
setMaxRows
methods to limit the number of polls retrieved.
strFilter
- The poll name filterpublic java.lang.String getFilter()
public void setArticleID(int nArticleID)
setArticleID
followed by get
will result in this CSPollMultiple
object being populated with the details of all polls that are related to the article specified. Each poll will be
stored as a CSPoll
object within the item ArrayList
member - use
getItems
or iterator
to access/navigate through the polls. By default,
the polls will be stored in the ArrayList
in display order configured via iCM. This can be
overridden by using the setSortOrder
method. Use the
setStartRow
and setMaxRows
methods to limit the number of
polls retrieved.
nArticleID
- The ID of the article whose related polls are required.public int getArticleID()
public void setIgnoreVisibility(boolean bIgnoreVisibility)
get
method.
bIgnoreVisibility
- Whether out-of-date and turned-off polls are to be returned.public boolean getIgnoreVisibility()
get
method.
public void setRootPollIDs(java.lang.String strRootPollIDs)
strRootPollIDs
- A comma seperated list of poll group IDs.public java.lang.String getRootPollIDs()
public boolean exist() throws CSException
CSPollMultiple
.
exist
in class CSItemMultiple
true
if all polls 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
CSNotFoundException
to be thrown. Use
the setIgnoreVisibility
method with a true
parameter if you
wish to retrieve polls regardless of their visibility settings.
Use setPollList
followed by get
to populate this
CSPollMultiple
object with details of all the polls identified by the specified IDs. The retrieved
polls will appear within CSPollMultiple
in the order that their IDs appear within the supplied
list - as such, setSortOrder
, setMaxRows
and
setStartRow
are not valid in this instance.
Use setNameList
followed by get
to populate this
CSPollMultiple
object with the details of all the polls identified by the specified names. The
retrieved polls will appear within CSPollMultiple
in the order that their names appear within the
supplied list - as such, setSortOrder
, setMaxRows
and
setStartRow
are not valid in this instance.
Use setFilter
followed by get()
to populate this
CSPollMultiple
object with the details of all polls whose name matches the filter specified. By
default the polls will be retrieved in poll ID order. This can be overridden if required by using the
setSortOrder
method. The setStartRow
and setMaxRows
methods can be
used to restrict the number of polls that are retrieved.
Use setArticleID
followed by get
to populate this
CSPollMultiple
object with the details of all polls that are related to the specified article. By
default, the polls will be retrieved in the display order configured via iCM. This can be overridden if required
by using the setSortOrder
method. The setStartRow
and setMaxRows
methods can be used to restrict the number of polls that are retrieved.
If none of setPollList
, setNameList
, setFilter
or
setArticleID
are specified, ALL polls will be retrieved.
Each retrieved poll will be stored as a CSPoll
object within the item ArrayList
member of
this CSPollMultiple
object - use getItems
or iterator
to
access/navigate through the polls.
get
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 polls 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
CSPollMultiple
.
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 polls cannot be found on the databaseCSException
- the base class for exceptions thrown by this method.public void delete() throws CSException
CSPollMultiple
.
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 polls cannot be found on the databaseCSException
- the base class for exceptions thrown by this method.public java.lang.String toString()
CSPollMultiple
object to a String
object in a
user-friendly format.
toString
in class CSItemMultiple
String
containing the user-friendly outputCopyright © 2022 Goss Interactive Ltd. All Rights Reserved.