public class CSTemplateAsset extends CSItem
The CSTemplateAsset
class includes methods for the retrieval of a particular asset's details. It also
provides a method that checks for the existence of an asset for a particular template. All such methods require that
certain database and key information (template ID, for example) be specified via the set
methods
provided, prior to their invocation.
All database access/connectivity is handled internally by the CSTemplateAsset
class.
CSTemplateAssetContent
,
CSTemplateAssetConstraint
,
Serialized FormModifier and Type | Field and Description |
---|---|
static java.lang.String |
TYPE_ARTICLES
A valid value that is used to indicate the type of
CSTemplateAsset . |
static java.lang.String |
TYPE_EVENTS
A valid value that is used to indicate the type of
CSTemplateAsset . |
static java.lang.String |
TYPE_FEATURES
A valid value that is used to indicate the type of
CSTemplateAsset . |
static java.lang.String |
TYPE_FORMS
A valid value that is used to indicate the type of
CSTemplateAsset . |
static java.lang.String |
TYPE_FORUMS
A valid value that is used to indicate the type of
CSTemplateAsset . |
static java.lang.String |
TYPE_LINKS
A valid value that is used to indicate the type of
CSTemplateAsset . |
static java.lang.String |
TYPE_MEDIA
A valid value that is used to indicate the type of
CSTemplateAsset . |
static java.lang.String |
TYPE_METADATA
A valid value that is used to indicate the type of
CSTemplateAsset . |
static java.lang.String |
TYPE_POLLS
A valid value that is used to indicate the type of
CSTemplateAsset . |
static java.lang.String |
TYPE_PRODUCTS
A valid value that is used to indicate the type of
CSTemplateAsset . |
static java.lang.String |
TYPE_RACKS
A valid value that is used to indicate the type of
CSTemplateAsset . |
static java.lang.String |
TYPE_SITE_SECURITY
A valid value that is used to indicate the type of
CSTemplateAsset . |
static java.lang.String |
TYPE_TEXT
A valid value that is used to indicate the type of
CSTemplateAsset . |
ACCESS_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 |
---|
CSTemplateAsset()
Creates an empty
CSTemplateAsset object. |
CSTemplateAsset(java.lang.String strPropertyFile)
Creates an empty
CSTemplateAsset 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
CSTemplateAsset . |
boolean |
exist()
Checks to see whether a template asset exists on the database.
|
void |
get()
Retrieves the details of an asset from the database.
|
int |
getAssetID()
Gets the ID of the asset.
|
java.util.ArrayList |
getConstraints()
Gets the constraints of the template asset.
|
java.lang.String |
getDescription()
Gets the description of the template asset.
|
int |
getTemplateID()
Gets the ID of the template.
|
java.lang.String |
getType()
Gets the type of the template asset.
|
void |
setAssetID(int nAssetID)
Sets the ID of the template asset.
|
void |
setConstraints(java.util.ArrayList arrConstraints)
Sets the constraints of the template asset.
|
void |
setDescription(java.lang.String strDescription)
Sets the description of the template asset.
|
void |
setDetailLevel(int nDetailLevel)
Sets the level of detail to be handled by the
get method. |
void |
setTemplateID(int nTemplateID)
Sets the ID of the template.
|
void |
setType(java.lang.String strType)
Sets the type of the template asset.
|
void |
update()
Not currently implemented for
CSTemplateAsset . |
equals, getID, getStatus, hashCode, jsonString, serialiseWithTypes, setID, setStatus, toString, unset
clearRecordedGatewayMessages, clone, count, getCache, getCachingEnabled, getDatabaseVersion, getDatabaseVersion, getDebugOutput, getDetailLevel, getPreview, getPropertyFile, getPropertyFileExtension, getPropertyFilePathname, getRecordedGatewayMessages, getRecordGatewayMessages, getSendGatewayMessages, getUseCache, setDebugOutput, setPreview, setPropertyFile, setRecordGatewayMessages, setSendGatewayMessages, setUseCache
public static final java.lang.String TYPE_ARTICLES
CSTemplateAsset
. TYPE_ARTICLES
indicates an article asset type.public static final java.lang.String TYPE_EVENTS
CSTemplateAsset
. TYPE_EVENTS
indicates an event asset type.public static final java.lang.String TYPE_FEATURES
CSTemplateAsset
. TYPE_FEATURES
indicates a feature asset type.public static final java.lang.String TYPE_FORMS
CSTemplateAsset
. TYPE_FORMS
indicates a form asset type.public static final java.lang.String TYPE_FORUMS
CSTemplateAsset
. TYPE_FORUMS
indicates a forum asset type.public static final java.lang.String TYPE_LINKS
CSTemplateAsset
. TYPE_LINK
indicates a link asset type.public static final java.lang.String TYPE_MEDIA
CSTemplateAsset
. TYPE_MEDIA
indicates a media asset type.public static final java.lang.String TYPE_METADATA
CSTemplateAsset
. TYPE_METADATA
indicates a metadata asset type.public static final java.lang.String TYPE_POLLS
CSTemplateAsset
. TYPE_POLLS
indicates a poll asset type.public static final java.lang.String TYPE_PRODUCTS
CSTemplateAsset
. TYPE_PRODUCTS
indicates a product asset type.public static final java.lang.String TYPE_RACKS
CSTemplateAsset
. TYPE_RACKS
indicates a rack asset type.public static final java.lang.String TYPE_SITE_SECURITY
CSTemplateAsset
. TYPE_SITE_SECURITY
indicates a site security asset type.public static final java.lang.String TYPE_TEXT
CSTemplateAsset
. TYPE_TEXT
indicates a article text asset type.public CSTemplateAsset()
CSTemplateAsset
object.
Use the various set methods provided to initialise the CSTemplateAsset
object prior to invoking any
of its query methods.
public CSTemplateAsset(java.lang.String strPropertyFile)
CSTemplateAsset
object, specifying a property file that contains all of the
database connection details.
Use the various set methods provided to initialise the CSTemplateAsset
object prior to invoking any
of its query methods.
strPropertyFile
- the name of the property file from which the database connection details are to be read.public final void setDetailLevel(int nDetailLevel) throws CSParameterException
get
method.
Valid detail levels for an asset are :
LEVEL_ALL
- all details are processedLEVEL_SUMMARY
- retrieves the asset ID, asset Type, and asset Description.LEVEL_ALL
- retrieves all asset data including its constraints.setDetailLevel
in class CSDatabaseItem
nDetailLevel
- the detail level to be used.CSParameterException
- if an invalid detail level is specified.public final void setAssetID(int nAssetID)
setAssetID
followed by a call to exist
will determine whether an asset with that
ID exists on the database.
setTemplateID
and setType
followed by a call to exist
will determine
whether an asset of the specified type is defined for the specified template.
setAssetID
followed by a call to get
will populate this CSTemplateAsset
object with that asset's details.
setTemplateID
and setType
followed by a call to get
will populate this
CSTemplateAsset
instance with a particular type of asset for the specified template.
nAssetID
- the numeric identifier of the asset.public final int getAssetID()
public final void setTemplateID(int nTemplateID)
setTemplateID
and setType
followed by a call to exist
will determine
whether an asset of that type exists for the specified template.
setTemplateID
and setType
followed by a call to get
will populate this
CSTemplateAsset
instance with a particular type of asset for the specified template.
nTemplateID
- the numeric identifier of the template.public final int getTemplateID()
public final java.lang.String getType()
public final void setType(java.lang.String strType) throws CSParameterException
All template assets will be of a pre-determined type, and a maximum of one of each type will be associated with
any one template. The asset's type is retrieved for the LEVEL_ID
setting of the detail level (see
setDetailLevel
).
Valid asset types are :
TYPE_ARTICLES
- Articles.TYPE_EVENTS
- Events.TYPE_FEATURES
- Features.TYPE_FORMS
- Forms.TYPE_FORUMS
- Forums.TYPE_LINKS
- Links.TYPE_MEDIA
- Media.TYPE_METADATA
- Metadata.TYPE_POLLS
- Polls.TYPE_PRODUCTS
- Products.TYPE_RACKS
- Racks.TYPE_SITE_SECURITY
- Site Security.TYPE_TEXT
- Text.strType
- the template asset's type.CSParameterException
- if the specified asset type is not one of the valid constantspublic final java.lang.String getDescription()
public final void setDescription(java.lang.String strDescription)
strDescription
- the template asset's description.public final java.util.ArrayList getConstraints()
CSTemplateAssetConstraint
objects.public final void setConstraints(java.util.ArrayList arrConstraints)
arrConstraints
- the template asset's constraints, a collection of CSTemplateAssetConstraint
objects.public final boolean exist() throws CSException
Use setTemplateID
and setType
followed by
exist
to check for the existence of an asset of a particular type within a specified template.
exist
in class CSItem
true
if the asset exists on the database, false
otherwise.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 final void get() throws CSException
Use setAssetID
followed by get
to populate this
CSTemplateAsset
instance with the details of the asset identified by the specified ID.
Use setTemplateID
along with setType
followed by
get
to populate this CSTemplateAsset
instance with the details of a particular type of
asset for the template.
Use the setDetailLevel
method to determine the exact information that is retrieved
and stored within this CSTemplateAsset
instance.
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 template cannot be found on the database.CSSecurityException
- if security has been breached.CSException
- the base class for exceptions thrown by this method.public final void update() throws CSException
CSTemplateAsset
.
update
in class CSItem
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 items cannot be found on the database.CSException
- the base class for exceptions thrown by this method.public final void delete() throws CSException
CSTemplateAsset
.
delete
in class CSItem
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 items cannot be found on the database.CSException
- the base class for exceptions thrown by this method.Copyright © 2022 Goss Interactive Ltd. All Rights Reserved.