public class CSTemplate extends CSItem
A template governs the layout of an article's content. The name and location of each template is stored on the
database and it is this information that is handled by the CSTemplate
class. Typically, the TEMPLATES
section of iCM is used to specify this information.
The CSTemplate
class includes methods for the retrieval, update, and removal of a particular
template's details. It also provides a method that checks for the existence of a template on the database. 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 CSTemplate
class.
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 |
---|
CSTemplate()
Creates an empty
CSTemplate object. |
CSTemplate(java.lang.String strPropertyFile)
Creates an empty
CSTemplate 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
CSTemplate . |
boolean |
exist()
Checks to see whether a template exists on the database.
|
void |
get()
Retrieves the details of a template from the database.
|
boolean |
getAllowWYSIWYGEdit()
Gets whether the template renders articles in a form suitable for use with the WYSIWYG article editor.
|
int |
getArticleID()
Gets the article ID currently specified as key information.
|
java.util.ArrayList |
getAssets()
Gets the array of assets supported by the template.
|
java.lang.String |
getDefaultDocExt()
Gets the filename extension of this template's default document.
|
java.lang.String |
getDescription()
Gets the template's description.
|
java.lang.String |
getDeveloperHelp()
Gets the HTML stream that provides guidance to the article contributor using this template.
|
java.lang.String |
getExtensionFormName()
Gets the template's article extension form name.
|
java.lang.String |
getHint()
Gets the template hint text.
|
java.util.ArrayList |
getImages()
Gets the details of the images associated with the template.
|
int |
getImportInlineTypeID()
Gets the ID of the inline type used to embed media items back into article text after document import
if the
ImportType is set to Inline . |
int |
getImportMediaGroupID()
Gets the ID of the media group where media items extracted during document import will be created.
|
int |
getImportMediaTypeID()
Gets the ID of the media type used to define media items extracted during document import.
|
java.lang.String |
getImportPlaceholderText()
Gets the text inserted into the article body to mark the locations where media items were
extracted during document import if the
ImportType is
set to Related . |
java.lang.String |
getImportType()
Gets the type of relationship established between the article and any media items extracted from
within a document when document text is imported into articles that are based on this template.
|
java.lang.String |
getListAssetTypes()
Gets a comma-delimited list of the asset types supported by the template.
|
java.lang.String |
getName()
Gets the name of the template.
|
java.util.ArrayList |
getPreviewModes()
Gets the preview modes supported by the template.
|
java.lang.String |
getStylesheet()
Gets the filename of the stylesheet to be used when this template renders an article.
|
int |
getSubsiteID()
Gets the ID of the subsite used to identify a subgroup of the template settings.
|
int |
getTemplateID()
Gets the ID of the template.
|
boolean |
getTemplateInjectsWYSIWYGMarkers()
Gets whether or not the template code is responsible for injecting markers
where related content items should appear within the rendered article
when the article is being edited within iCM's WYSIWYG article editor.
|
void |
setAllowWYSIWYGEdit(boolean allowWYSIWYGEdit)
Sets whether the template renders articles in a form suitable for use with the WYSIWYG article editor.
|
void |
setArticleID(int nArticleID)
Sets the ID of the article to be used as key information.
|
void |
setAssets(java.util.ArrayList assets)
Sets the array of assets supported by the template.
|
void |
setDefaultDocExt(java.lang.String defaultDocExt)
Sets the filename extension of this template's default document.
|
void |
setDescription(java.lang.String strDescription)
Sets the description for the template.
|
void |
setDetailLevel(int nDetailLevel)
Sets the level of detail to be handled by the
get method. |
void |
setDeveloperHelp(java.lang.String htmlDeveloperHelp)
Sets the HTML used to provide assistance to contributors using this template.
|
void |
setExtensionFormName(java.lang.String strFormName)
Sets the name of the article extension form for the template.
|
void |
setHint(java.lang.String hint)
Sets the template hint text.
|
void |
setImages(java.util.ArrayList images)
Sets the details of the images associated with the template.
|
void |
setImportInlineTypeID(int inlineTypeID)
Sets the ID of the inline type used to embed media items back into article text after document import
if the
ImportType is set to Inline . |
void |
setImportMediaGroupID(int mediaGroupID)
Sets the ID of the media group where media items extracted during document import will be created.
|
void |
setImportMediaTypeID(int mediaTypeID)
Sets the ID of the media type used to define media items extracted during document import.
|
void |
setImportPlaceholderText(java.lang.String placeholderText)
Sets the text inserted into the article body to mark the locations where media items were
extracted during document import if the
ImportType is
set to Related . |
void |
setImportType(java.lang.String importType)
Sets the type of relationship to be established between an article and any media items extracted from
within a document during document import.
|
void |
setName(java.lang.String strName)
Sets the name of the template.
|
void |
setPreviewModes(java.util.ArrayList previewModes)
Sets the preview modes supported by the template.
|
void |
setStylesheet(java.lang.String Stylesheet)
Sets the filename of the stylesheet to be used when this template renders an article.
|
void |
setSubsiteID(int nSubsiteID)
|
void |
setTemplateID(int nTemplateID)
Sets the ID of the template.
|
java.lang.String |
toString()
Outputs the contents of this
CSTemplate object to a String object in a
user-friendly format. |
void |
update()
Not currently implemented for
CSTemplate . |
equals, getID, getStatus, hashCode, jsonString, serialiseWithTypes, setID, setStatus, 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 CSTemplate()
CSTemplate
object.
Use the various set methods provided to initialise the CSTemplate
object prior to invoking any of
its query methods.
public CSTemplate(java.lang.String strPropertyFile)
CSTemplate
object, specifying a property file that contains all of the database
connection details.
Use the various set methods provided to initialise the CSTemplate
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 void setDetailLevel(int nDetailLevel) throws CSParameterException
get
method.
Valid detail levels for a template are :
LEVEL_ALL - all details are processed
.
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 template
associated with the specified article.
nArticleID
- the numeric identifier of the article.public int getArticleID()
public void setTemplateID(int nTemplateID)
setTemplateID
followed by a call to exist
will determine whether a template with
that ID exists on the database.
setTemplateID
followed by a call to get
will populate this CSTemplate
object with that template's details.
nTemplateID
- the numeric identifier of the template.public int getTemplateID()
public void setSubsiteID(int nSubsiteID)
exist
and get
method calls.
Calling setTemplateID
and setSubsiteID
followed by a call to get
will return the set of template details for the specified subsite. Note, however, that the returned details
may not be explicitly defined on the database: template settings for subsites may be based upon general
subsite defaults and/or the settings for the main iCM site.
If the subsite ID is not set, it defaults to a value of zero, which is interpreted as meaning the main iCM site.
Specifying a value of -1
may be used to retrieve the default settings for all subsites.
The subsite ID is ignored during calls to exist
.
nSubsiteID
- the numeric identifier of the subsite.public int getSubsiteID()
public void setName(java.lang.String strName)
setName
followed by a call to exist
will determine whether a template with that
name exists on the database. If the template ID is known, it will be used in preference to the name.
setName
followed by a call to get
will populate this CSTemplate
object with details of the template with the specified name. If the template ID is known, it will be used in
preference to the name.
strName
- the template's name.public java.lang.String getName()
public void setDescription(java.lang.String strDescription)
strDescription
- the template's description.public java.lang.String getDescription()
public void setExtensionFormName(java.lang.String strFormName)
strFormName
- the template extension form name.public java.lang.String getExtensionFormName()
public java.lang.String getDefaultDocExt()
public void setDefaultDocExt(java.lang.String defaultDocExt)
defaultDocExt
- the document extension to set (without the leading '.' character).public boolean getTemplateInjectsWYSIWYGMarkers()
true
as the Java API never
injects these markers.public java.lang.String getDeveloperHelp()
public void setDeveloperHelp(java.lang.String htmlDeveloperHelp)
htmlDeveloperHelp
- the HTML help to set.public java.lang.String getHint()
public void setHint(java.lang.String hint)
hint
- the hint text to set.public java.lang.String getListAssetTypes()
public java.util.ArrayList getAssets()
public void setAssets(java.util.ArrayList assets)
assets
- the array of CSTemplateAsset
objects to setpublic boolean getAllowWYSIWYGEdit()
true
if the template renders editor compatible HTML, false
otherwise.public void setAllowWYSIWYGEdit(boolean allowWYSIWYGEdit)
allowWYSIWYGEdit
- true
if the template renders editor compatible HTML, false
otherwise.public java.lang.String getStylesheet()
public void setStylesheet(java.lang.String Stylesheet)
Stylesheet
- the stylesheet filename to setpublic java.util.ArrayList getPreviewModes()
CSTemplatePreviewMode
instances.public void setPreviewModes(java.util.ArrayList previewModes)
previewModes
- an ArrayList of CSTemplatePreviewMode
instances to set.public java.util.ArrayList getImages()
/media/templateimages@0/
folder.CSTemplateImage
instances.public void setImages(java.util.ArrayList images)
/media/templateimages@0/
folder.images
- an ArrayList of CSTemplateImage
instances to set.public java.lang.String getImportType()
Related
or Inline
.public void setImportType(java.lang.String importType)
importType
- the type of relationship. Must be either Related
or Inline
.public int getImportInlineTypeID()
ImportType
is set to Inline
.public void setImportInlineTypeID(int inlineTypeID)
ImportType
is set to Inline
.inlineTypeID
- the inline TypeID to setpublic int getImportMediaGroupID()
public void setImportMediaGroupID(int mediaGroupID)
mediaGroupID
- the media group ID to set.public int getImportMediaTypeID()
public void setImportMediaTypeID(int mediaTypeID)
mediaTypeID
- the media TypeID to setpublic java.lang.String getImportPlaceholderText()
ImportType
is
set to Related
.public void setImportPlaceholderText(java.lang.String placeholderText)
ImportType
is
set to Related
.placeholderText
- the placeholder text to set.public boolean exist() throws CSException
Use setTemplateID
followed by exist
to determine whether a template
with the specified ID exists on the database.
Use setName
followed by exist
to determine whether a template with the
specified name exists on the database.
exist
in class CSItem
true
if the template exists 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 setTemplateID
followed by get
to populate this
CSTemplate
object with the details of the template identified by the specified ID.
Use setName
followed by get
to populate this CSTemplate
object with the details of the template identified by the specified name.
Use setArticleID
followed by get
to populate this
CSTemplate
object with the details of the template used by the specified article.
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 void update() throws CSException
CSTemplate
.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 the specified template cannot be found on the database.CSException
- the base class for exceptions thrown by this method.public void delete() throws CSException
CSTemplate
.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 the specified template cannot be found on the database.CSException
- the base class for exceptions thrown by this method.Copyright © 2022 Goss Interactive Ltd. All Rights Reserved.