public class CSLinkMultiple extends CSItemMultiple
The CSLinkMultiple
class provides a method that retrieves several external links from the database.
This method requires that certain database and key information (article ID, for example) be specified via the
set
methods provided, prior to its invocation.
All database access/connectivity is handled internally by the CSLinkMultiple
class.
CSLink
,
Serialized FormLEVEL_ALL, LEVEL_ALL_PLUS_RELATED, LEVEL_DETAIL, LEVEL_ID, LEVEL_SUMMARY
Constructor and Description |
---|
CSLinkMultiple()
Creates an empty
CSLinkMultiple object. |
CSLinkMultiple(java.lang.String strPropertyFile)
Creates a new
CSLinkMultiple , specifying a properties files that contains all of the database
connection details. |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Not currently implemented for
CSLinkMultiple . |
boolean |
exist()
Not currently implemented for
CSLinkMultiple . |
void |
get()
Retrieves the details of several external links from the database.
|
int |
getArticleID()
Gets the article ID specified as key information for the purposes of retrieving its related links.
|
int |
getGroupID()
Gets the ID of the group whose member links to be retrieved.
|
java.lang.String |
getGroupName()
Gets the name of the group whose member links to be retrieved.
|
boolean |
getHttpAutoInsert()
Gets whether 'http://' should be automatically inserted in the link address if there is no protocol specifier
already present.
|
boolean |
getIncludeAllLinks()
Gets whether all links should be returned, regardless of their status.
|
java.lang.String |
getLinkList()
Gets the list of link IDs specified as key information.
|
void |
setArticleID(int nArticleID)
Sets the article ID of the article whose related links to be retrieved.
|
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 group whose member links are to be retrieved.
|
void |
setGroupName(java.lang.String strGroupName)
Sets the name of the group whose member links are to be retrieved.
|
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 |
setIncludeAllLinks(boolean bIncludeAllLinks)
Specifies whether all links should be returned, regardless of their status.
|
void |
setLinkList(java.lang.String strLinkList)
Specifies IDs of the links whose details are to be retrieved.
|
void |
setSortOrder(java.lang.String strSortOrderList)
Sets the order in which the links are to be retrieved.
|
java.lang.String |
toString()
Outputs the contents of this
CSLinkMultiple object to a String object in a
user-friendly format. |
void |
update()
Not currently implemented for
CSLinkMultiple . |
equals, getItems, getMaxRows, getSortOrder, getStartRow, iterator, setItems, setMaxRows, setStartRow
clearRecordedGatewayMessages, clone, count, getCache, getCachingEnabled, getDatabaseVersion, getDatabaseVersion, getDebugOutput, getDetailLevel, getPreview, getPropertyFile, getPropertyFileExtension, getPropertyFilePathname, getRecordedGatewayMessages, getRecordGatewayMessages, getSendGatewayMessages, getUseCache, setDebugOutput, setPreview, setPropertyFile, setRecordGatewayMessages, setSendGatewayMessages, setUseCache
public CSLinkMultiple()
CSLinkMultiple
object.
Use the various set
methods provided to initialise the CSLinkMultiple
object prior
to invoking any of its query methods.
public CSLinkMultiple(java.lang.String strPropertyFile)
CSLinkMultiple
, specifying a properties files that contains all of the database
connection details.
Use the various set methods provided to initialise the CSLinkMultiple
object prior to invoking any
of its query manipulation methods.
strPropertyFile
- the property file that contains the connection details.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 setArticleID(int nArticleID)
setArticleID
followed by a call to get
will return details of the related links of
the specified article.
nArticleID
- the ID of the article whose related links are to be retrieved.public int getArticleID()
get
method.public void setLinkList(java.lang.String strLinkList)
setLinkList
followed by a call to get
returns details of the links specified in the
list.
strLinkList
- a comma-separated list of link IDs.public java.lang.String getLinkList()
public void setGroupID(int nGroupID)
setGroupID
followed by a call to get
will return details of the member links of
the specified group.
nGroupID
- the ID of the group whose member links are to be retrieved.public int getGroupID()
get
method.public java.lang.String getGroupName()
get
method.public void setGroupName(java.lang.String strGroupName)
setGroupName
followed by a call to get
will return details of the member links of
the specified group.
strGroupName
- the name of the group whose member links are to be retrieved.public void setIncludeAllLinks(boolean bIncludeAllLinks)
Set setIncludeAllLinks
to true
prior to a call to get
to include
dead links within the returned items. By default, only live links will be retrieved.
bIncludeAllLinks
- indicates if all links should be returned, or only LIVE links.public boolean getIncludeAllLinks()
public void setHttpAutoInsert(boolean bHttpAutoInsert)
bHttpAutoInsert
- indicates whether or not the 'http' prefix should be prepended.public boolean getHttpAutoInsert()
public void setSortOrder(java.lang.String strSortOrderList) throws CSParameterException
This method should not be used if the setLinkList
key information is being supplied.
One or more of the available sort orders may be specified as a comma-delimited list. Use ASC or DESC to indicate
the direction of ordering for a sort order. For example, "GroupName DESC" would order in descending order of link
group name. The default sort order in this instance is 'LinkText ASC'.
Available sort orders are :
GroupName - order by the link group name
LinkID - order by link's unique identifier
LinkText - order by link text
GroupID - order by the link group ID
setSortOrder
in class CSItemMultiple
strSortOrderList
- a comma-separated list of one or more of the available sort orders.CSParameterException
- if an invalid sort order was specified.public void update() throws CSException
CSLinkMultiple
.
update
in class CSItemMultiple
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 links cannot be found on the database.CSException
- the base class for exceptions thrown by this method.public void delete() throws CSException
CSLinkMultiple
.
delete
in class CSItemMultiple
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 links cannot be found on the database.CSException
- the base class for exceptions thrown by this method.public boolean exist() throws CSException
CSLinkMultiple
.
exist
in class CSItemMultiple
true
if all links exist 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 setLinkList
followed by get
to populate this
CSLinkMultiple
object with the details of the links specified in the list. The retrieved links
will appear within CSLinkMultiple
in the order that their IDs appear within the supplied list. Key
information set using setSortOrder
, setMaxRows
and
setStartRow
, therefore, is not valid in this instance.
Use setArticleID
followed by get
to populate this
CSLinkMultiple
object with the details of the related links of the specified article. The
retrieved links will be ordered as per the ordering stored on the iCM database.
Use setGroupID
followed by get
to populate this
CSLinkMultiple
object with the details of the links which are a member of the specified group.
Use setGroupName
followed by get
to populate this
CSLinkMultiple
object with the details of the links which are a member of the specified group.
Use setHttpAutoInsert
followed by get
to insert 'http://' into
the link address if it is not already present.
Use setIncludeAllLinks
prior to calling get
to indicate
whether 'dead' links are to be included or not. By default, only live links will be returned.
Each retrieved link is stored as a CSLink
object within the item ArrayList
member of
CSLinkMultiple
- use getItems
or iterator
to
access/navigate through them. These links will be stored in the ArrayList
in the order specified
using the setSortOrder
method, or the default sort order of 'LinkText ASC').
However, if a list of link IDs was specified, the links are stored in the same order as in the specified list.
get
in class CSItemMultiple
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 links cannot be found on the database.CSSecurityException
- if security has been breached.CSException
- the base class for exceptions thrown by this method.public java.lang.String toString()
CSLinkMultiple
object to a String
object in a
user-friendly format.
toString
in class CSItemMultiple
String
containing the user-friendly output.Copyright © 2022 Goss Interactive Ltd. All Rights Reserved.