public class CSMediaGroupMultiple extends CSItemMultiple
The CSMediaGroupMultiple
class provides a method, get()
, that retrieves several media
groups from the database. This method requires that certain database and key information (media ID, for example) be
specified via the set
methods provided, prior to its invocation.
All database access/connectivity is handled internally by the CSMediaGroupMultiple
class.
CSMediaGroup
,
CSMediaGroupContent
,
Serialized FormLEVEL_ALL, LEVEL_ALL_PLUS_RELATED, LEVEL_DETAIL, LEVEL_ID, LEVEL_SUMMARY
Constructor and Description |
---|
CSMediaGroupMultiple()
Default constructor that creates an empty
CSMediaGroupMultiple object. |
CSMediaGroupMultiple(java.lang.String strPropertyFile)
Creates an empty
CSMediaGroupMultiple object, specifying a property file that contains all of the
database connection details. |
Modifier and Type | Method and Description |
---|---|
void |
get()
Retrieves the details of several media groups from the database.
|
java.lang.String |
getGroupList()
Get the list of group IDs to which the UserID belongs.
|
int |
getMediaGroupID()
Get the media group ID.
|
int |
getMediaID()
Get the media ID.
|
int |
getUserID()
Gets the website User ID specified as key information.
|
void |
setDetailLevel(int nDetailLevel)
Sets the level of detail to be handled by the
get method. |
void |
setGroupList(java.lang.String strGroupList)
Set the list of group IDs to which the UserID belongs (provided to optimise performance).
|
void |
setMediaGroupID(int nGroupID)
Set the media group ID.
|
void |
setMediaID(int nMediaID)
Set the media ID.
|
void |
setUserID(int nUserID)
Sets the website User ID to be used as key information.
|
java.lang.String |
toString()
Output the contents of this
CSMediaGroupMultiple object to a String object in a
user-friendly format. |
delete, equals, exist, getItems, getMaxRows, getSortOrder, getStartRow, iterator, setItems, setMaxRows, setSortOrder, setStartRow, update
clearRecordedGatewayMessages, clone, count, getCache, getCachingEnabled, getDatabaseVersion, getDatabaseVersion, getDebugOutput, getDetailLevel, getPreview, getPropertyFile, getPropertyFileExtension, getPropertyFilePathname, getRecordedGatewayMessages, getRecordGatewayMessages, getSendGatewayMessages, getUseCache, setDebugOutput, setPreview, setPropertyFile, setRecordGatewayMessages, setSendGatewayMessages, setUseCache
public CSMediaGroupMultiple()
CSMediaGroupMultiple
object.
Use the various set methods provided to initialise the CSMediaGroupMultiple
object prior to
invoking any of its query methods.
public CSMediaGroupMultiple(java.lang.String strPropertyFile)
CSMediaGroupMultiple
object, specifying a property file that contains all of the
database connection details.
Use the various set
methods to initialise the CSMediaGroupMultiple
object prior to
invoking get()
.
strPropertyFile
- the name of the property file from which the database connection details are to be read.public void setMediaID(int nMediaID)
get
. If the
media ID is is specified, MediaGroupID should not be.
nMediaID
- the unique numeric ID of the media item whose related media will be retrieved.public int getMediaID()
public void setMediaGroupID(int nGroupID)
get
. If
the media group ID is is specified, MediaID should not be.
nGroupID
- the unique numeric ID of the media group whose child groups will be retrieved.public int getMediaGroupID()
public void setUserID(int nUserID)
Do not set User ID if you are only interested in retrieving unsecured media groups, as this will result in a faster query.
setUserID
and the setMediaGroupID
method followed by a call to get
will return details of the media groups which are either unsecured groups, or secured groups to which the
specified user has access.
nUserID
- the ID of the user to be used in media security checks.public int getUserID()
public void setGroupList(java.lang.String strGroupList)
strGroupList
- a String
containing a comma-separated list of IDs of the UserID's groups.public java.lang.String getGroupList()
String
containing a comma-separated list of IDs of the UserID's groups.public void setDetailLevel(int nDetailLevel) throws CSParameterException
get
method.
Valid detail levels for media are :
LEVEL_ID - the media group ID
LEVEL_ALL - the media group ID and Name
The default detail level is LEVEL_ALL.
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 setMediaID
followed by get
to populate this
CSMediaGroupMultiple
object with the details of the media groups that are the parents of the
specified media item. The retrieved media groups will appear within CSMediaMultiple
in the parent
hierarchy order, starting with the immediate parent of the media item.
Use setMediaGroupID
followed by get
to populate this
CSMediaGroupMultiple
object with the details of the media groups that are children of the
specified group.
Use setUserID
in conjunction with the setMediaGroupID
methods followed by get
to retrieve the child groups that are accessible to the specified user. If
UserID
is not specified, only unsecured media groups will be retrieved.
Use setGroupList
in conjunction with the setUserID
and
setMediaGroupID
methods followed by get
to optimise evaluation of
the accessible media groups.
Each retrieved media group item is stored as a CSMediaGroup
object within the item ArrayList
member of CSMediaGroupMultiple
- use getItems
or iterator
to access/navigate through them.
For performance reasons, you should not specify a User ID if you are not interested in secure media groups. It is
also more efficient to specify the user groups to which the user belongs, using the
setGroupList
method, if they are already known.
get
in class CSItemMultiple
CSException
- one of:
public java.lang.String toString()
CSMediaGroupMultiple
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.