public class CSEventMultiple extends CSItemMultiple
The CSEventMultiple
class provides a method that retrieves several events 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 CSEventMultiple
class.
CSEvent
,
Serialized FormLEVEL_ALL, LEVEL_ALL_PLUS_RELATED, LEVEL_DETAIL, LEVEL_ID, LEVEL_SUMMARY
Constructor and Description |
---|
CSEventMultiple()
Creates an empty
CSEventMultiple object. |
CSEventMultiple(java.lang.String strPropertyFile)
Creates a new
CSEventMultiple , specifying a properties files that contains all of the database
connection details. |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Not currently implemented for
CSEventMultiple . |
boolean |
exist()
Not currently implemented for
CSEventMultiple . |
void |
get()
Retrieves the details of several events from the database.
|
int |
getArticleID()
Gets the article ID specified as key information for the purposes of retrieving its related events.
|
java.util.Date |
getEndDate()
Gets the End Date specified as key information for the purposes of retrieving events which are active (actually
occur) within a specified period.
|
java.lang.String |
getEventList()
Gets the list of event IDs specified as key information.
|
java.lang.String |
getExcludeMetaDataIDs()
Gets the list of exclude metadata values IDs specified as key information.
|
java.lang.String |
getGroupName()
Gets the event group name specified as key information for the purposes of retrieving events which belong
directly to it.
|
int |
getMetaDataID()
Deprecated.
Use
getMetaDataIDs() instead. |
java.lang.String |
getMetaDataIDs()
Gets the list of metadata values IDs specified as key information.
|
java.lang.String |
getMetaDataOptionalIDs()
Gets the list of optional metadata values IDs specified as key information.
|
boolean |
getRecurse()
Gets the recurse option when retrieving events below an event group.
|
java.lang.String |
getRootEventIDs()
Gets the IDs of Root Event Groups.
|
java.util.Date |
getStartDate()
Gets the Start Date specified as key information for the purposes of retrieving events which are active (actually
occur) within a specified period.
|
void |
setArticleID(int nArticleID)
Sets the article ID of the article whose related events to be retrieved.
|
void |
setDetailLevel(int nDetailLevel)
Sets the level of detail to be handled by the
get method. |
void |
setEndDate(java.util.Date objEndDate)
Sets the End Date of the period whose active events to be retrieved.
|
void |
setEventList(java.lang.String strEventList)
Specifies IDs of the events whose details are to be retrieved.
|
void |
setExcludeMetaDataIDs(java.lang.String strExcludeMetaDataIDs)
Specifies IDs of the metadata values that all retrieved events must NOT be related to.
|
void |
setGroupName(java.lang.String strGroupName)
Sets the name of the event group to be used as key information.
|
void |
setMetaDataID(int nMetaDataID)
Deprecated.
Use
setMetaDataIDs(String) instead. |
void |
setMetaDataIDs(java.lang.String strMetaDataIDs)
Specifies IDs of the metadata values that all retrieved events must be related to.
|
void |
setMetaDataOptionalIDs(java.lang.String strMetaDataOptionalIDs)
Specifies IDs of the metadata values that all retrieved events must be related to one or more of.
|
void |
setRecurse(boolean bRecurse)
Sets the recurse option when retrieving events below an event group.
|
void |
setRootEventIDs(java.lang.String strRootEventIDs)
Sets the IDs of Root Event Groups.
|
void |
setSortOrder(java.lang.String strSortOrderList)
Sets the order in which the events are to be retrieved.
|
void |
setStartDate(java.util.Date objStartDate)
Sets the Start Date of the period whose active events are to be retrieved.
|
java.lang.String |
toString()
Outputs the contents of this
CSEventMultiple object to a String object in a
user-friendly format. |
void |
update()
Not currently implemented for
CSEventMultiple . |
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 CSEventMultiple()
CSEventMultiple
object.
Use the various set
methods provided to initialise the CSEventMultiple
object prior
to invoking any of its query methods.
public CSEventMultiple(java.lang.String strPropertyFile)
CSEventMultiple
, specifying a properties files that contains all of the database
connection details.
Use the various set methods provided to initialise the CSEventMultiple
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_DETAIL.
Valid detail levels for an event are :
LEVEL_ID
Retrieves Event ID only.
LEVEL_SUMMARY
Retrieves Event ID, Description, Start Date, End Date, Group Name and Group ID
only.
LEVEL_DETAIL
Retrieves all event data, except for the associated Metadata.
LEVEL_ALL
Retrieves all event data, including the associated Metadata.
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 events of
the specified article.
nArticleID
- the ID of the article whose related events are to be retrieved.public int getArticleID()
get
method.public void setMetaDataID(int nMetaDataID)
setMetaDataIDs(String)
instead.nMetaDataID
- the ID of the metadata item which is asociated with the events to be retrieved.public int getMetaDataID()
getMetaDataIDs()
instead.get
method.public void setMetaDataIDs(java.lang.String strMetaDataIDs)
setMetaDataIDs
followed by a call to get
returns details of all the events that are
related to ALL of the specified metadata values.
setMetaDataIDs
may be used as a primary key or in conjunction with other primary keys (setArticleID
and setGroupName
) as a further filter.
strMetaDataIDs
- a comma-separated list of metadata value IDs.setMetaDataOptionalIDs
,
setExcludeMetaDataIDs
public java.lang.String getMetaDataIDs()
public void setMetaDataOptionalIDs(java.lang.String strMetaDataOptionalIDs)
setMetaDataOptionalIDs
followed by a call to get
returns details of all the events
that are related to at least one of the specified metadata values.
setMetaDataOptionalIDs
may be used as a primary key or in conjunction with other primary keys (setArticleID
and setGroupName
) as a further filter.
strMetaDataOptionalIDs
- a comma-separated list of metadata value IDs.setMetaDataIDs
,
setExcludeMetaDataIDs
public java.lang.String getMetaDataOptionalIDs()
public void setExcludeMetaDataIDs(java.lang.String strExcludeMetaDataIDs)
setExcludeMetaDataIDs
followed by a call to get
returns details of all the events
that are NOT related to any of the specified metadata values.
setExcludeMetaDataIDs
may be used as a primary key or in conjunction with other primary keys (setArticleID
and setGroupName
) as a further filter.
strExcludeMetaDataIDs
- a comma-separated list of metadata value IDs.setMetaDataOptionalIDs
,
setMetaDataIDs
public java.lang.String getExcludeMetaDataIDs()
public void setGroupName(java.lang.String strGroupName)
setGroupName
followed by a call to get
will return details of the events which
directly belong to the specified event group.
Events belonging to any nested groups of the specified event group will not be retrieved.
To include events belonging to nested groups, call setRecurse(true)
before calling
get
.
strGroupName
- the name of the event group whose events retrieved by the get
method.public java.lang.String getGroupName()
Events belonging to any nested groups of the specified event group will not be retrieved.
To include events belonging to nested groups, call setRecurse(true)
before calling
get
.
get
method.public void setRecurse(boolean bRecurse)
setGroupName
and setRecurse(true)
followed by a call to
get
will return details of the events which belong to the specified event group as well as any
events belonging to any nested groups.
To retrieve only the events belonging directly to the specified group, call setGroupName
and
setRecurse(false)
followed by a call to get
.
bRecurse
- indicates if events of nested groups are to be retrieved, or not.public boolean getRecurse()
setGroupName
and setRecurse(true)
followed by a call to
get
will return details of the events which belong to the specified event group as well as any
events belonging to any nested groups.
To retrieve only the events belonging directly to the specified group, call setGroupName
and
setRecurse(false)
followed by a call to get
.
public void setEventList(java.lang.String strEventList)
setEventList
followed by a call to get
returns details of the events specified in
the list.
strEventList
- a comma-separated list of event IDs.public java.lang.String getEventList()
public void setStartDate(java.util.Date objStartDate)
setStartDate
and setEndDate
followed by a call to
get
will return details of the events which occur within the specified period.
Note that an event is not retrieved simply because the period defined by the event's start and end dates overlaps with the period defined by the specified start and end dates. The event must actually occur within the specified period. For example, a monthly event may not actually occur within a specified two week period, even though the two week period is within the start and end dates of the event.
objStartDate
- the start date to be used as key information.public java.util.Date getStartDate()
get
method.public void setEndDate(java.util.Date objEndDate)
setStartDate
and setEndDate
followed by a call to
get
will return details of the events which occur within the specified period.
Note that an event is not retrieved simply because the period defined by the event's start and end dates overlaps with the period defined by the specified start and end dates. The event must actually occur within the specified period. For example, a monthly event may not actually occur within a specified two week period, even though the two week period is within the start and end dates of the event.
objEndDate
- the end date to be used as key information.public java.util.Date getEndDate()
get
method.public void setRootEventIDs(java.lang.String strRootEventIDs)
This parameter is useful to restrict event queries to one particular subsite.
strRootEventIDs
- A comma seperated list of event group IDs.public java.lang.String getRootEventIDs()
public void setSortOrder(java.lang.String strSortOrderList) throws CSParameterException
This method should not be used if the setEventList
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, "GroupName DESC" would order in descending
order of event group name. The default sort order in this instance is 'Description ASC'.
Available sort orders are :
GroupName - order by the event group name
EventID - order by event's unique identifier
Description - order by event description
GroupID - order by the event group ID
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
CSEventMultiple
.
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 events cannot be found on the database.CSException
- the base class for exceptions thrown by this method.public void delete() throws CSException
CSEventMultiple
.
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 events cannot be found on the database.CSException
- the base class for exceptions thrown by this method.public boolean exist() throws CSException
CSEventMultiple
.
exist
in class CSItemMultiple
true
if all events 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 setEventList
followed by get
to populate this
CSEventMultiple
object with the details of the events specified in the list. The retrieved events
will appear within CSEventMultiple
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
CSEventMultiple
object with the details of the related events of the specified article.
Use setGroupName
followed by get
to populate this
CSEventMultiple
object with the events directly below the specified event group. Events belonging
to any nested groups of the specified event group will not be retrieved.
Use setGroupName
and setRecurse(true)
followed by
get
to populate this CSEventMultiple
object with the events directly below the
specified event group as well as events below any nested groups.
Use setMetaDataIDs
followed by get
to populate this
CSEventMultiple
object with the details of the events that are related to ALL of the specified
metadata values.
Use setMetaDataOptionalIDs
followed by get
to populate
this CSEventMultiple
object with the details of the events that are related to one or more of the
specified metadata values.
Use setExcludeMetaDataIDs
followed by get
to populate this
CSEventMultiple
object with the details of the events that are NOT related to any of the specified
metadata values.
The setMetaDataIDs
, setMetaDataOptionalIDs
and setExcludeMetaDataIDs
methods can be used on as primary key information or in conjunction with other primary keys (setArticleID
for example) as a filter.
Each retrieved event is stored as a CSEvent
object within the item ArrayList
member of
CSEventMultiple
- use getItems
or iterator
to
access/navigate through them. These events will be stored in the ArrayList
in the order specified
using the setSortOrder
method, or the default sort order of 'Description ASC').
However, if a list of event IDs was specified, the events are stored in the same order as in the specified list.
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 events 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.String toString()
CSEventMultiple
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.