public class CSLink extends CSItem
The CSLink
class includes methods for the retrieval of a particular link's details.
All such methods require that certain database and key information (link ID, for example) be specified via the
set
methods provided, prior to their invocation.
All database access/connectivity is handled internally by the CSLink
class.
CSLinkContent
,
CSLinkMultiple
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
STATUS_DEAD
A valid parameter value for the
setLinkStatus method and return value for the
getLinkStatus method. |
static int |
STATUS_LIVE
A valid parameter value for the
setLinkStatus method and return value for the
getLinkStatus method. |
static int |
STATUS_MISSING
A valid parameter value for the
setLinkStatus method and return value for the
getLinkStatus method. |
static int |
STATUS_UNKNOWN
A valid parameter value for the
setLinkStatus method and return value for the
getLinkStatus method. |
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 |
---|
CSLink()
Creates an empty
CSLink object. |
CSLink(java.lang.String strPropertyFile)
Creates a new
CSLink object, specifying a property file that contains all of the required database
connection details. |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Not currently implemented for
CSLink . |
void |
get()
Retrieves the details of a link from the database.
|
int |
getGroupID()
Gets the link ID of the link group to which the link belongs.
|
java.lang.String |
getGroupName()
Gets the name of the link group to which the link belongs.
|
boolean |
getHttpAutoInsert()
Gets whether 'http://' should be automatically inserted in the link address if there is no protocol specifier
already present.
|
java.lang.String |
getLinkAddress()
Gets the address (URL) of the link.
|
java.lang.String |
getLinkDescription()
Gets the description of the link.
|
int |
getLinkID()
Gets the link ID currently specified as key information.
|
int |
getLinkStatus()
Gets the current link accessibility status.
|
java.lang.String |
getLinkText()
Gets the link text to be displayed on the website.
|
void |
setDetailLevel(int nDetailLevel)
Sets the level of detail to be handled by the
get method. |
void |
setGroupID(int nGroupID)
Sets the ID of the link group to which the link belongs.
|
void |
setGroupName(java.lang.String strGroupName)
Sets the name of the link group to which the link belongs.
|
void |
setHttpAutoInsert(boolean bHttpAutoInsert)
Used to indicate whether 'http://' should be automatically inserted in the link address if there is no protocol
specifier already present.
|
void |
setLinkAddress(java.lang.String strLinkAddress)
Sets the address (URL) of the link, for example 'www.gossinteractive.com' or 'http://www.gossinteractive.com'.
|
void |
setLinkDescription(java.lang.String strLinkDescription)
Sets the description of the link.
|
void |
setLinkID(int nLinkID)
Sets the link ID to be used as key information.
|
void |
setLinkStatus(int nLinkStatus)
Sets the current link accessibility status.
|
void |
setLinkText(java.lang.String strLinkText)
Sets the link text to be displayed on the website.
|
java.lang.String |
toString()
Provides debug information on the contents of the
CSLink object. |
void |
update()
Not currently implemented for
CSLink . |
equals, exist, 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 static final int STATUS_UNKNOWN
setLinkStatus
method and return value for the
getLinkStatus
method. STATUS_UNKNOWN
is used to indicate that the
accessibility of the link target is unknown.public static final int STATUS_LIVE
setLinkStatus
method and return value for the
getLinkStatus
method. STATUS_LIVE
is used to indicate that the link
target is accessible.public static final int STATUS_MISSING
setLinkStatus
method and return value for the
getLinkStatus
method. STATUS_MISSING
is used to indicate that the link
target is temporarily inaccessible.public static final int STATUS_DEAD
setLinkStatus
method and return value for the
getLinkStatus
method. STATUS_DEAD
is used to indicate that the link
target is inaccessible.public CSLink()
CSLink
object.
Use the various set
methods provided to initialise the CSLink
object prior to
invoking any of its query methods.
public CSLink(java.lang.String strPropertyFile)
CSLink
object, specifying a property file that contains all of the required database
connection details.
Use the various set methods provided to initialise the CSLink
object prior to invoking any of its
query manipulation methods.
strPropertyFile
- the property file that contains the connection details.public void setLinkID(int nLinkID)
setLinkID
followed by a call to get
will return details of the link with the
specified link ID.
nLinkID
- the integer ID of the link to be retrieved.public int getLinkID()
public void setGroupID(int nGroupID)
nGroupID
- the integer ID of the link group.public int getGroupID()
String
object.public void setGroupName(java.lang.String strGroupName)
strGroupName
- the name of the link group as a String
object.public java.lang.String getGroupName()
String
object.public void setLinkDescription(java.lang.String strLinkDescription)
strLinkDescription
- the link's description as a String
object.public java.lang.String getLinkDescription()
String
object.public void setLinkAddress(java.lang.String strLinkAddress)
It is not necessary to include 'http://' in the address. It will be added automatically if omitted, unless
specified otherwise using the setHttpAutoInsert
method and provided there is
no other protocol specifier already present.
strLinkAddress
- the link's URL (address) as a String
object.public java.lang.String getLinkAddress()
If not already present, 'http://' is automatically inserted in the address, unless specified otherwise using the
setHttpAutoInsert
method.
String
object.public void setHttpAutoInsert(boolean bHttpAutoInsert)
bHttpAutoInsert
- indicates whether or not the 'http' prefix should be prepended.public boolean getHttpAutoInsert()
public void setLinkText(java.lang.String strLinkText)
strLinkText
- text representing the link for display on the website.public java.lang.String getLinkText()
public void setLinkStatus(int nLinkStatus)
Links newly added via iCM will be assigned an initial status of STATUS_LIVE
. This status is
thereafter maintained by the ExternalLinkCheck
housekeeping task.
Valid values for a link status are :
STATUS_UNKNOWN
- The status has not been retrieved from the database.STATUS_LIVE
- The link is accessible.STATUS_MISSING
- The link is temporarily inaccessible.STATUS_DEAD
- The link is inaccessible.nLinkStatus
- the predefined status value.public int getLinkStatus()
Links newly added via iCM will be assigned an initial status of STATUS_LIVE
. This status is
thereafter maintained by the ExternalLinkCheck
housekeeping task.
Valid values for a link status are :
STATUS_UNKNOWN
- The status has not been retrieved from the database.STATUS_LIVE
- The link is accessible.STATUS_MISSING
- The link is temporarily inaccessible.STATUS_DEAD
- The link is inaccessible.public void setDetailLevel(int nDetailLevel) throws CSParameterException
get
method.
Valid detail levels for a link are :
LEVEL_ID
Retrieves Link ID only.
LEVEL_ALL
Retrieves all link data, including Link Text.
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 setLinkID
followed by get
to populate this CSLink
object with the details of the link identified by the specified ID.
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 attribute cannot be found on the database.CSSecurityException
- if security has been breached.CSException
- the base class for exceptions thrown by this method.public void delete() throws CSException
CSLink
.
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 attributes cannot be found on the database.CSException
- the base class for exceptions thrown by this method.public void update() throws CSException
CSLink
.
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 attributes cannot be found on the database.CSException
- the base class for exceptions thrown by this method.Copyright © 2022 Goss Interactive Ltd. All Rights Reserved.