public class CSFormMultiple extends CSItemMultiple
The CSFormMultiple
class provides a method that retrieves several forms (definitions) from the
database. This method requires that certain database and key information (article ID, for example) be specified via
the set
methods provided, prior to its invocation.
All database access/connectivity is handled internally by the CSFormMultiple
class.
CSForm
,
Serialized FormLEVEL_ALL, LEVEL_ALL_PLUS_RELATED, LEVEL_DETAIL, LEVEL_ID, LEVEL_SUMMARY
Constructor and Description |
---|
CSFormMultiple()
Creates an empty
CSFormMultiple object. |
CSFormMultiple(java.lang.String strPropertyFile)
Creates a new
CSFormMultiple , specifying a property files that contains all of the database
connection details. |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Creates a duplicate of this
CSFormMultiple object. |
void |
delete()
Not currently implemented for
CSFormMultiple . |
boolean |
exist()
Not currently implemented for
CSFormMultiple . |
void |
get()
Retrieves the details of several forms from the database.
|
int |
getArticleID()
Gets the article ID specified as key information for the purposes of retrieving its related forms.
|
java.lang.String |
getFormList()
Gets the list of form IDs specified as key information.
|
java.lang.String |
getFormNameList()
Gets the list of form names specified as key information.
|
void |
setArticleID(int nArticleID)
Sets the article ID of the article whose related forms are to be retrieved.
|
void |
setDetailLevel(int nDetailLevel)
Sets the level of detail to be handled by the
get method. |
void |
setFormList(java.lang.String strFormList)
Specifies IDs of the forms whose details are to be retrieved.
|
void |
setFormNameList(java.lang.String strFormNameList)
Specifies names of the forms whose details are to be retrieved.
|
void |
setSortOrder(java.lang.String strSortOrderList)
Sets the order in which the forms are to be retrieved.
|
java.lang.String |
toString()
Outputs the contents of this
CSFormMultiple object to a String object in a
user-friendly format. |
void |
update()
Not currently implemented for
CSFormMultiple . |
equals, getItems, getMaxRows, getSortOrder, getStartRow, iterator, setItems, setMaxRows, setStartRow
clearRecordedGatewayMessages, count, getCache, getCachingEnabled, getDatabaseVersion, getDatabaseVersion, getDebugOutput, getDetailLevel, getPreview, getPropertyFile, getPropertyFileExtension, getPropertyFilePathname, getRecordedGatewayMessages, getRecordGatewayMessages, getSendGatewayMessages, getUseCache, setDebugOutput, setPreview, setPropertyFile, setRecordGatewayMessages, setSendGatewayMessages, setUseCache
public CSFormMultiple()
CSFormMultiple
object.
Use the various set
methods provided to initialise the CSFormMultiple
object prior
to invoking any of its query methods.
public CSFormMultiple(java.lang.String strPropertyFile)
CSFormMultiple
, specifying a property files that contains all of the database
connection details.
Use the various set methods provided to initialise the CSFormMultiple
object prior to invoking any
of its query methods.
strPropertyFile
- the property file that contains the connection details.public void setDetailLevel(int nDetailLevel) throws CSParameterException
get
method. Default is LEVEL_SUMMARY.
Valid detail levels for a form are :
LEVEL_ID
Retrieves Form ID only.
LEVEL_SUMMARY
Retrieves Form ID, and Form Name only.
LEVEL_DETAIL
Retrieves Form ID, Form Name, and an array of Section information but omitting
the actual form item details
LEVEL_ALL
Retrieves all form data, including the form item details.
setDetailLevel
in class CSDatabaseItem
nDetailLevel
- the detail level to be used.CSParameterException
- if an invalid detail level is specified.public void setArticleID(int nArticleID)
setArticleID
followed by a call to get
will return details of the related forms for
the specified article.
nArticleID
- the ID of the article whose related forms are to be retrieved.public int getArticleID()
get
method.public void setFormList(java.lang.String strFormList)
setFormList
followed by a call to get
returns details of the forms specified in the
list.
strFormList
- a comma-separated list of form IDs.public java.lang.String getFormList()
public void setFormNameList(java.lang.String strFormNameList)
setFormList
followed by a call to get
returns details of the forms specified in the
list.
strFormNameList
- a comma-separated list of form names.public java.lang.String getFormNameList()
public void setSortOrder(java.lang.String strSortOrderList) throws CSParameterException
This method should not be used if the setFormList
key information is being supplied.
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, "FormName DESC" would order in descending order of form
name. The default sort order in this instance is 'FormID ASC'.
Available sort orders are :
FormID - order by form's unique identifier
FormName - order by the form name
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 update() throws CSException
CSFormMultiple
.
update
in class CSItemMultiple
CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSNotFoundException
- if one of the specified forms cannot be found on the database.CSException
- the base class for exceptions thrown by this method.public void delete() throws CSException
CSFormMultiple
.
delete
in class CSItemMultiple
CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSNotFoundException
- if one of the specified forms cannot be found on the database.CSException
- the base class for exceptions thrown by this method.public boolean exist() throws CSException
CSFormMultiple
.
exist
in class CSItemMultiple
true
if all forms exist on the database.CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSException
- the base class for exceptions thrown by this method.public void get() throws CSException
Use setFormList
followed by get
to populate this
CSFormMultiple
object with the details of the forms specified in the list. The retrieved forms
will appear within CSFormMultiple
in the order that their IDs appear within the supplied list. Key
information set using setSortOrder
, setMaxRows
and
setStartRow
is not valid in this instance.
Use setArticleID
followed by get
to populate this
CSFormMultiple
object with the details of the related forms of the specified article.
Each retrieved form is stored as a CSForm
object within the item ArrayList
member of
CSFormMultiple
- use getItems
or iterator
to
access/navigate through them. If neither ArticleID or FormList is specified, these forms will be stored in the
ArrayList
in the order specified using the setSortOrder
method, or
the default sort order of 'FormID ASC'). If a list of form IDs is specified via the FormList parameter, the forms
are stored in the same order as in the specified list. Finally, if ArticleID is specified, the forms will be
ordered as configured within iCM.
get
in class CSItemMultiple
CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSNotFoundException
- if one of the specified forms cannot be found on the database.CSSecurityException
- if security has been breached.CSException
- the base class for exceptions thrown by this method.public java.lang.Object clone() throws java.lang.CloneNotSupportedException, java.lang.OutOfMemoryError
CSFormMultiple
object.
clone
in class CSDatabaseItem
CSFormMultiple
object.java.lang.CloneNotSupportedException
- if cloning is not supported/allowed.java.lang.OutOfMemoryError
- if there are any problems allocating memory.public java.lang.String toString()
CSFormMultiple
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.