public class CSMediaType extends CSItem
The CSMediaType
class includes methods for the retrieval of a particular media type's details.
All such methods require that certain database and key information (media type ID, for example) be specified via the
set
methods provided, prior to their invocation.
All database access/connectivity is handled internally by the CSMediType
class.
CSMediaTypeContent
,
CSMediaTypeMultiple
,
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 |
---|
CSMediaType()
Creates an empty
CSMediaType object. |
CSMediaType(java.lang.String strPropertyFile)
Creates an empty
CSMediaType 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 type from the database.
|
java.lang.String |
getDescription()
Get the description of the media type.
|
boolean |
getIndexContent()
Get the content indexed flag which indicates whether the contents of the file are included within the search
index or not.
|
int |
getMediaTypeID()
Get the ID of the media type.
|
java.util.ArrayList |
getSubTypes()
Get the array of subtypes associated with this media type.
|
java.lang.String |
getType()
Get the name of the media type.
|
void |
setDescription(java.lang.String strDesc)
Set the description of the media type.
|
void |
setDetailLevel(int nDetailLevel)
Sets the level of detail to be handled by the
get method. |
void |
setIndexContent(boolean bIndexContent)
Set the content indexed flag which indicates whether the contents of the file are included within the search
index or not.
|
void |
setMediaTypeID(int nMediaTypeID)
Set the ID of the media type.
|
void |
setSubTypes(java.util.ArrayList arrSubTypes)
Set the array of subtypes associated with this media type.
|
void |
setSubTypes(java.lang.String strSubTypes)
Set the array of subtypes for this media type from a text string in the format retrieved from the database,
"Thumbnail;m;u,Image;o;u,LargeImage;o;u" for example.
|
void |
setType(java.lang.String strType)
Set the name of the media type.
|
delete, equals, exist, getID, getStatus, hashCode, jsonString, serialiseWithTypes, setID, setStatus, toString, 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 CSMediaType()
CSMediaType
object.
Use the various set methods provided to initialise the CSMediaType
object prior to invoking any of
its query methods.
public CSMediaType(java.lang.String strPropertyFile)
CSMediaType
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 type ID
LEVEL_SUMMARY - the type (directory)
LEVEL_ALL - the description, indexcontent flag and subtypes
Each detail level processes the information specified alongside it in addition to the information specified for all detail levels listed above it. 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 setMediaTypeID(int nMediaTypeID)
get()
is called.
nMediaTypeID
- numeric ID of the media type.public int getMediaTypeID()
public void setType(java.lang.String strType)
strType
- the name of the media type.public java.lang.String getType()
public void setDescription(java.lang.String strDesc)
strDesc
- the description of the media type.public java.lang.String getDescription()
public void setSubTypes(java.lang.String strSubTypes)
CSMediaTypeContentFile
object will be
created for each subtype, all of which are stored in an ArrayList
.
strSubTypes
- a String
containing the subtype information.public void setSubTypes(java.util.ArrayList arrSubTypes)
arrSubTypes
- an ArrayList
populated with CSMediaTypeContentFile
objects each of which
represents a subtype (file type) for this media type.public java.util.ArrayList getSubTypes()
ArrayList
populated with CSMediaTypeContentFile
objects which represent
subtypes (file types) associated with this media type.public void setIndexContent(boolean bIndexContent)
bIndexContent
- true if the file content is indexed, false otherwisepublic boolean getIndexContent()
public void get() throws CSException
Use setMediaTypeID
to set the media type ID which you are interested in, then
get()
to load the details from the database. This CSMediaType
object is then
populated with the details of the media type, which can be accessed using the getXXX()
methods.
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.Copyright © 2022 Goss Interactive Ltd. All Rights Reserved.