public class CSMediaGroup extends CSItem
A media group is a container for media items and other media groups. The CSMediaGroup
class includes
methods for the retrieval of a particular media group's details.
All such methods require that certain database and key information (media group ID, for example) be specified via the
set
methods provided, prior to their invocation.
All database access/connectivity is handled internally by the CSMediaGroup
class.
CSMediaGroupContent
,
CSMediaGroupMultiple
,
CSState
,
Serialized FormACCESS_GRANTED, DOES_NOT_EXIST, EMPTY, EXISTS, SECURE_ACCESS_DENIED, SECURE_ACCESS_GRANTED, UPDATE_ACTION_INSERTED, UPDATE_ACTION_UPDATED
LEVEL_ALL, LEVEL_ALL_PLUS_RELATED, LEVEL_DETAIL, LEVEL_ID, LEVEL_SUMMARY
Constructor and Description |
---|
CSMediaGroup()
Creates an empty
CSMediaGroup object. |
CSMediaGroup(java.lang.String strPropertyFile)
Creates an empty
CSMediaGroup 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 a media group from the database.
|
int |
getGroupID()
Get the ID of the media group.
|
java.lang.String |
getGroupList()
Get the list of group IDs to which the UserID belongs.
|
java.lang.String |
getName()
Get the name of the media group.
|
int |
getParentGroupID()
Get the ID of the parent media group.
|
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 |
setGroupID(int nGroupID)
Set the ID of the media group.
|
void |
setGroupList(java.lang.String strGroupList)
Set the list of group IDs to which the UserID belongs (provided to optimise performance).
|
void |
setName(java.lang.String strName)
Set the name of the media group.
|
void |
setParentGroupID(int nParentGroupID)
Set the ID of the parent media group.
|
void |
setUserID(int nUserID)
Sets the website User ID to be used as key information.
|
java.lang.String |
toString()
Output the contents of this
CSMediaGroup object to a String object in a
user-friendly format. |
delete, equals, exist, getID, getStatus, hashCode, jsonString, serialiseWithTypes, setID, setStatus, unset, 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 CSMediaGroup()
CSMediaGroup
object.
Use the various set methods provided to initialise the CSMediaGroup
object prior to invoking any
of its query methods.
public CSMediaGroup(java.lang.String strPropertyFile)
CSMediaGroup
object, specifying a property file that contains all of the database
connection details.
strPropertyFile
- the name of the property file from which the database connection details are to be read.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 setGroupID(int nGroupID)
get()
method is called.
nGroupID
- numeric ID of the media group.public int getGroupID()
public void setName(java.lang.String strName)
strName
- the name of the media group.public java.lang.String getName()
public void setParentGroupID(int nParentGroupID)
nParentGroupID
- numeric ID of the parent media group.public int getParentGroupID()
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 an appropriate setGroupID
followed by a call to get
will return details of the media group which is either unsecured or secured to a group of which the specified
user is a member.
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 get() throws CSException
Use setGroupID(int)
to set ID of the group which you are interested in, then get()
to
load the details from the database. This CSMediaGroup
object is then populated with the details of
the media group, which can be accessed using the getXXX()
methods.
NOTE ON MEDIA SECURITY :
A CSSecurityException
will be thrown if no User ID has been specified using the
setUserID
method, and the media group is a secured item.
A CSSecurityException
will also be thrown if a User ID has been specified, but the specified user
does not have access to the media group if it is secured.
For performance reasons, you should not specify a User ID if you are not interested in secure 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 CSItem
CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSNotFoundException
- if the specified media group cannot be found on the database.CSSecurityException
- if access to the requested item is denied.CSException
- the base class for exceptions thrown by this method.Copyright © 2022 Goss Interactive Ltd. All Rights Reserved.