public class CSArticleMultiple extends CSItemMultiple
The CSArticleMultiple
class provides a method that retrieves several articles from the database. This
method requires that certain database and key information (parent article ID, for example) be specified via the
set
methods provided, prior to its invocation.
All database access/connectivity is handled internally by the CSArticleMultiple
class.
NOTE: This Class does not support iCM databases earlier than 5.0.0.0
CSArticle
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
CHANGE_CREATED
A valid value that can be passed to the
setChangedAction method. |
static int |
CHANGE_UPDATED
A valid value that can be passed to the
setChangedAction method. |
static java.lang.String |
LOGIC_BETWEEN
One of the logic values that may be passed to the
setFilterLogic method. |
static java.lang.String |
LOGIC_EQUAL
One of the logic values that may be passed to the
setFilterLogic method. |
static java.lang.String |
LOGIC_GREATERTHAN
One of the logic values that may be passed to the
setFilterLogic method. |
static java.lang.String |
LOGIC_GREATERTHANEQUAL
One of the logic values that may be passed to the
setFilterLogic method. |
static java.lang.String |
LOGIC_LESSTHAN
One of the logic values that may be passed to the
setFilterLogic method. |
static java.lang.String |
LOGIC_LESSTHANEQUAL
One of the logic values that may be passed to the
setFilterLogic method. |
static java.lang.String |
LOGIC_LIKE
One of the logic values that may be passed to the
setFilterLogic method. |
static int |
MAX_DEPTH_LEVEL
Maximum depth allowed for article queries.
|
LEVEL_ALL, LEVEL_ALL_PLUS_RELATED, LEVEL_DETAIL, LEVEL_ID, LEVEL_SUMMARY
Constructor and Description |
---|
CSArticleMultiple()
Creates an empty
CSArticleMultiple object. |
CSArticleMultiple(java.lang.String strPropertyFile)
Creates a new
CSArticleMultiple , specifying a properties file that contains all of the database
connection details. |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Not currently implemented for
CSArticleMultiple . |
boolean |
exist()
Not currently implemented for
CSArticleMultiple . |
void |
get()
Retrieves the details of several articles from the database.
|
java.lang.String |
getArticleList()
Gets the list of article IDs specified as key information.
|
boolean |
getChanged()
Gets the flag that indicates whether only those articles that have been changed within a specified time frame are
to be retrieved.
|
int |
getChangedAction()
Gets the type of changes that are of interest when the
setChanged method is used. |
java.util.Date |
getChangedEndDate()
Gets the End Date of the time frame used by the
setChanged method. |
boolean |
getChangedSignificantly()
Gets the flag used by the
setChanged method that indicates whether only articles
that have been changed significantly are of interest. |
java.util.Date |
getChangedStartDate()
Gets the Start Date of the time frame used by the
setChanged method. |
boolean |
getDisplayAll()
Deprecated.
Replaced by
getIgnoreVisibility() . |
java.lang.String |
getEventList()
Gets the list of event IDs specified as key information.
|
java.lang.String |
getEventOptionalList()
Gets the list of the optional event IDs specified as key information.
|
boolean |
getExcludeFailedItems()
Gets a flag which indicates whether or not articles which could not not be retrieved should be included in
the results.
|
java.lang.String |
getExcludeMetaDataIDs()
Gets the list of exclude metadata values IDs specified as key information.
|
java.lang.String |
getExcludeTemplateList()
Gets the list of excluded template IDs specified as key information.
|
boolean |
getExtensionDataReqd()
Gets the flag which indicates whether article extension data should be retrieved.
|
java.lang.String |
getFilterColumn()
Gets the name of the article column whose value is to be compared to the value supplied via the
setFilterValue method. |
java.lang.String |
getFilterLogic()
Gets the logic operation that is to be used when comparing the contents of the column specified via the
setFilterColumn method and the value specified via the
setFilterValue method. |
java.lang.Object |
getFilterValue()
Gets the value that is to be used as the only or lower range setting in a filtering operation on the column whose
name is supplied via the
setFilterColumn method. |
java.lang.Object |
getFilterValue2()
Gets the value that is to be used as the second (upper) filter value in a
LOGIC_BETWEEN filtering
operation. |
java.lang.String |
getFriendlyURL()
Gets the friendly URL string specified as key information.
|
java.lang.String |
getGroupList()
Gets the list of IDs of the website User Groups to which the specified user belongs.
|
boolean |
getIgnoreVisibility()
Gets the indicator specifying whether articles should be retrieved regardless of whether they are in date or
whether their display flag has been set to 'off'.
|
int |
getLevelDepth()
Gets the level depth specified as key information for the purpose of recursively retrieving child articles.
|
java.lang.String |
getMetaDataIDs()
Gets the list of metadata values IDs specified as key information.
|
java.lang.String |
getMetadataList()
Deprecated.
Use
getMetaDataIDs instead. |
java.lang.String |
getMetaDataOptionalIDs()
Gets the list of optional metadata values IDs specified as key information.
|
java.lang.String |
getMetadataOptionalList()
Deprecated.
Use
getMetaDataOptionalIDs instead. |
boolean |
getOverrideSecurity()
Gets the flag which indicates whether articles should be retrieved, even if they fail article security checks.
|
int |
getParentArticleID()
Deprecated.
Use
getParentArticleIDList() instead. |
java.lang.String |
getParentArticleIDList()
Gets the list of article IDs specified as key information for the purpose of retrieving its child articles.
|
int |
getPathArticleID()
Gets the article ID specified as key information for the purpose of retrieving its path articles.
|
int |
getRelatedArticleID()
Gets the article ID specified as key information for the purpose of retrieving its related articles.
|
java.lang.String |
getRootArticleIDList()
Returns IDs of articles that most be a parent of the selected articles.
|
int |
getSuggestedArticleID()
Gets the article ID specified as key information for the purpose of retrieving its suggested articles.
|
java.lang.String |
getSuggestedRangeName()
Obtained the current suggested range name.
|
java.lang.String |
getTemplateList()
Gets the list of template IDs specified as key information.
|
boolean |
getTolerateNotFound()
Gets the flag which indicates whether a 'not found' exception failure is prevented when a requested article
cannot be found.
|
int |
getUserID()
Gets the website User ID specified as key information.
|
void |
setArticleList(java.lang.String strArticleList)
Specifies IDs of the articles whose details are to be retrieved.
|
void |
setChanged(boolean bChanged)
Set to True to retrieve just those articles that have been changed within a specified time frame.
|
void |
setChangedAction(int nAction)
Specifies the type of changes that are of interest when the
setChanged method is
used. |
void |
setChangedEndDate(java.util.Date objEndDate)
Sets the End Date of the time frame used by the
setChanged method. |
void |
setChangedSignificantly(boolean bChangedSignificantly)
Set to false when using the
setChanged method to indicate that all article changes
(both creates and updates) are of interest. |
void |
setChangedStartDate(java.util.Date objStartDate)
Sets the Start Date of the time frame used by the
setChanged method. |
void |
setDetailLevel(int nDetailLevel)
Sets the level of detail to be handled by the
get method. |
void |
setDisplayAll(boolean bDisplayAll)
Deprecated.
Replaced by
setIgnoreVisibility(boolean) . |
void |
setEventList(java.lang.String strEventList)
Specifies the event IDs to be used in determining which articles are to be retrieved.
|
void |
setEventOptionalList(java.lang.String strEventOptionalList)
Specifies the optional event IDs to be used in retrieving all those articles that have any of these as related
events - an article only needs to have one of the specified events in order to be retrieved.
|
void |
setExcludeFailedItems(boolean bExcludeFailedItems)
Sets a flag which indicates whether or not articles which could not not be retrieved should be included in
the results.
|
void |
setExcludeMetaDataIDs(java.lang.String strExcludeMetaDataIDs)
Specifies IDs of the metadata values that all retrieved articles must NOT be related to.
|
void |
setExcludeTemplateList(java.lang.String strExcludeTemplateList)
Specifies the excluded template IDs to be used in determining which articles are to be retrieved.
|
void |
setExtensionDataReqd(boolean bExtensionDataReqd)
Sets a flag to allow article extension data to be retrieved.
|
void |
setFilterColumn(java.lang.String strName)
Specifies the name of the article column whose value is to be compared to the value supplied via the
setFilterValue method. |
void |
setFilterLogic(java.lang.String strLogic)
Specifies the logic to be used when comparing the contents of the column specified via the
setFilterColumn method and the value specified via the
setFilterValue method. |
void |
setFilterValue(java.lang.Object objValue)
Specifies the value that is to be used as the only or lower range setting in a filtering operation on the column
whose name is supplied via the
setFilterColumn method. |
void |
setFilterValue2(java.lang.Object objValue)
Specifies the value that is to be used as the second (upper) filter value in a
LOGIC_BETWEEN
filtering operation. |
void |
setFriendlyURL(java.lang.String strFriendlyURL)
Sets the friendly URL string specified as key information.
|
void |
setGroupList(java.lang.String strGroupList)
Sets a list of the IDs of the User Groups to which the specified user belongs.
|
void |
setIgnoreVisibility(boolean bIgnoreVisibility)
Indicates whether articles should be retrieved regardless of whether they are in date or whether their display
flag has been set to 'off'.
|
void |
setLevelDepth(int nLevelDepth)
Sets the number of generations of child articles to be recursively retrieved.
|
void |
setMetaDataIDs(java.lang.String strMetaDataIDs)
Specifies IDs of the metadata values that all retrieved articles must be related to.
|
void |
setMetadataList(java.lang.String strMetadataList)
Deprecated.
Use
setMetaDataIDs instead. |
void |
setMetaDataOptionalIDs(java.lang.String strMetaDataOptionalIDs)
Specifies IDs of the metadata values that all retrieved articles must be related to one or more of.
|
void |
setMetadataOptionalList(java.lang.String strMetadataList)
Deprecated.
Use
setMetaDataOptionalIDs instead. |
void |
setOverrideSecurity(boolean bOverrideSecurity)
Sets a flag to indicate whether articles should be retrieved, even if they fail the article security checks.
|
void |
setParentArticleID(int nParentArticleID)
Deprecated.
Use
setParentArticleIDList(String) instead. |
void |
setParentArticleIDList(java.lang.String strParentArticleIDList)
Specifies IDs of the articles whose child articles are to be retrieved.
|
void |
setPathArticleID(int nPathArticleID)
Sets the article ID of the article whose path articles are to be retrieved.
|
void |
setRelatedArticleID(int nRelatedArticleID)
Sets the article ID of the articles whose Related Articles are to be retrieved.
|
void |
setRootArticleIDList(java.lang.String strRootArticleIDList)
Specifies IDs of articles that most be a parent of the selected articles.
|
void |
setSortOrder(java.lang.String strSortOrderList)
Sets the order in which the articles are to be retrieved.
|
void |
setSuggestedArticleID(int nSuggestedArticleID)
Sets the article ID of the articles whose Suggested Articles are to be retrieved.
|
void |
setSuggestedRangeName(java.lang.String strSuggestedRangeName)
Set the name of the particular range of suggested articles to be returned when suggested articles are being
returned by setting
SuggestedArticleI . |
void |
setTemplateList(java.lang.String strTemplateList)
Specifies the template IDs to be used in determining which articles are to be retrieved.
|
void |
setTolerateNotFound(boolean bTolerateNotFound)
Sets a flag to prevent a 'not found' exception failure from being generated when a requested article cannot be
found.
|
void |
setUserID(int nUserID)
Sets the website User ID to be used as key information.
|
java.lang.String |
toString()
Outputs the contents of this
CSArticleMultiple object to a String object in a
user-friendly format. |
void |
update()
Not currently implemented for
CSArticleMultiple . |
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 static final int CHANGE_CREATED
setChangedAction
method.
CHANGE_CREATED
indicates that just articles created within the specified timeframe should be
retrieved. Refer to the help for the setChanged
method for more information.public static final int CHANGE_UPDATED
setChangedAction
method.
CHANGE_UPDATED
indicates that just articles updated within the specified time frame should be
retrieved. Refer to the help for the setChanged
method for more information.public static final java.lang.String LOGIC_LIKE
setFilterLogic
method. Only
valid when filtering on the contents of a text column such as ArticleHeading
.
LOGIC_LIKE
indicates that the contents of the column specified via the
setFilterColumn
method will be compared to the value specified via the
setFilterValue
method. The %
character may be used to indicate a
wildcard match. For example, %@gossinteractive.com
will match if the column's value ends with
@gossinteractive.com
. If no %
is found within the supplied value, the two must be an
exact match.
public static final java.lang.String LOGIC_BETWEEN
setFilterLogic
method.
LOGIC_BETWEEN
will find a match if the contents of the column specified via the
setFilterColumn
method lies within the range of values specified via the
setFilterValue
and setFilterValue2
methods.
public static final java.lang.String LOGIC_GREATERTHAN
setFilterLogic
method.
LOGIC_GREATERTHAN
will find a match if the contents of the column specified via the
setFilterColumn
method are deemed to be greater than the value specified via the
setFilterValue
method.
public static final java.lang.String LOGIC_LESSTHAN
setFilterLogic
method.
LOGIC_LESSTHAN
will find a match if the contents of the column specified via the
setFilterColumn
method are deemed to be less than the value specified via the
setFilterValue
method.
public static final java.lang.String LOGIC_LESSTHANEQUAL
setFilterLogic
method.
LOGIC_LESSTHANEQUAL
will find a match if the contents of the column specified via the
setFilterColumn
method are deemed to be less than or equal to the value
specified via the setFilterValue
method.
public static final java.lang.String LOGIC_GREATERTHANEQUAL
setFilterLogic
method.
LOGIC_GREATERTHANEQUAL
will find a match if the contents of the column specified via the
setFilterColumn
method are deemed to be greater than or equal to the value
specified via the setFilterValue
method.
public static final java.lang.String LOGIC_EQUAL
setFilterLogic
method.
LOGIC_EQUAL
will find a match if the contents of the column specified via the
setFilterColumn
method are deemed to be equal to the value specified via the
setFilterValue
method.
public static final int MAX_DEPTH_LEVEL
public CSArticleMultiple()
CSArticleMultiple
object.
Use the various set
methods provided to initialise the CSArticleMultiple
object
prior to invoking any of its query methods.
public CSArticleMultiple(java.lang.String strPropertyFile)
CSArticleMultiple
, specifying a properties file that contains all of the database
connection details.
Use the various set methods provided to initialise the CSArticleMultiple
object prior to invoking
any of its query methods.
strPropertyFile
- the property file that contains the connection details.public void setChanged(boolean bChanged)
Use in conjunction with the setChangedStartDate
,
setChangedEndDate
, setChangedAction
and setChangedSignificantly
methods to indicate the type of change and
the time frame within which the changes need to have occurred.
As well as being specified on their own, these methods can also be used in conjunction with the other methods
such as setRelatedArticleID
and
setParentArticleIDList
. It may not, however, be used in conjunction with
the setArticleList
method.
bChanged
- true if only retrieving articles that have been changed within a specified time frame, false
otherwise.public boolean getChanged()
public void setChangedAction(int nAction) throws CSParameterException
setChanged
method is
used.
Valid actions are :
CSArticleMultiple.CHANGE_CREATED
Retrieves just those articles that were created
within the specified time frame.
CSArticleMultiple.CHANGE_UPDATED
Retrieves just those articles that were updated
within the specified time frame.
More than one action can be specified by ORing valid actions together. The default, for example, is CSArticleMultiple.CHANGE_CREATED | CSArticleMultiple.CHANGE_UPDATED so that both created and updated articles will be retrieved.
nAction
- the action to be used.CSParameterException
- if an invalid action is specified.public int getChangedAction()
setChanged
method is used.
public void setChangedStartDate(java.util.Date objStartDate)
setChanged
method.
Articles created/modified after this date and before the date specified via the
setChangedEndDate
method (inclusive) will be retrieved. Defaults to 7
days before the current date.
objStartDate
- the start date to be used as key information.public java.util.Date getChangedStartDate()
setChanged
method.
Articles created/modified after this date and before the date specified via the
setChangedEndDate
method (inclusive) will be retrieved.
public void setChangedEndDate(java.util.Date objEndDate)
setChanged
method.
Articles modified before this date and after the 'ChangedStartDate' (inclusive) will be retrieved. Defaults to the current date.
objEndDate
- the end date to be used as key information.public java.util.Date getChangedEndDate()
setChanged
method.
public void setChangedSignificantly(boolean bChangedSignificantly)
setChanged
method to indicate that all article changes
(both creates and updates) are of interest. Defaults to true so that only articles that are marked as having
significant changes made during the specified time frame will be retrieved. The ability to flag a change as
significant was introduced in iCM 7.0 and so this parameter will be ignored when running against earlier versions
of the database.
Use in conjunction with the setChangedStartDate
,
setChangedEndDate
, setChangedAction
methods to indicate the type of change and the time frame within which the changes need to have occurred.
bChangedSignificantly
- true to retrieve articles flagged as having significant changes, false to retrieve articles that have
been changed regardless of significance.public boolean getChangedSignificantly()
setChanged
method that indicates whether only articles
that have been changed significantly are of interest.
The ability to flag a change as significant was introduced in iCM 7.0.
public void setRelatedArticleID(int nRelatedArticleID)
setRelatedArticleID
followed by a call to get
will return details of the articles
which are Related Articles of the specified article.
This method may also be used in conjunction with the setEventList
,
setEventOptionalList
and setMetadataList
methods to further filter the retrieved articles.
nRelatedArticleID
- the ID of the article whose related articles are to be retrieved.public int getRelatedArticleID()
get
method.public void setSuggestedArticleID(int nSuggestedArticleID)
Suggested articles are determined by the article content and Web Metrics information that shows what other articles a user viewed following the article specified in this parameter. NOTE: This information is built by the YouMayLikeRefresh iCM scheduled task. If this is not executed at least once there will be no suggested articles available.
setSuggestedArticleID
followed by a call to get
will return details of the articles
which are Suggested Articles of the specified article.
This method may also be used in conjunction with the setEventList
,
setEventOptionalList
and setMetadataList
methods to further filter the retrieved articles.
nSuggestedArticleID
- the ID of the article whose suggested articles are to be retrieved.public int getSuggestedArticleID()
get
method.public void setSuggestedRangeName(java.lang.String strSuggestedRangeName)
SuggestedArticleI
.
The range names are defined in the icm/custom/metrics/you-may-like-settings.cfm file.
If no range name is specified the default range will be used. This is the first range defined in the above file.
strSuggestedRangeName
- Suggested range namepublic java.lang.String getSuggestedRangeName()
public void setPathArticleID(int nPathArticleID)
setPathArticleID
followed by a call to get
will return details of the articles
which are in the article path of the specified article in the article hierarchy.
This method may also be used in conjunction with the setEventList
,
setEventOptionalList
and setMetadataList
methods to further filter the retrieved articles.
nPathArticleID
- the ID of the article whose related articles are to be retrieved.public int getPathArticleID()
get
method.public void setParentArticleID(int nParentArticleID)
setParentArticleIDList(String)
instead.
setParentArticleID
followed by a call to get
will return details of the child
articles of the specified article in the article hierarchy.
nParentArticleID
- the ID of the article whose child articles are to be retrieved.public int getParentArticleID()
getParentArticleIDList()
instead.get
method.public void setParentArticleIDList(java.lang.String strParentArticleIDList)
setParentArticleIDList
followed by a call to get
will return details of the child
articles of the specified specified articles in the list.
If setPreview
is false then this list will be
treated as a list of live articles, if setPreview
is true then this list will be treated as a list
of preview articles.
For iCM version 6.0.0.0 or later the following applies.
1) If a sort order is specified using the CSItemMultiple.getSortOrder()
property then the retrieved child articles
within CSArticleMultiple
will be in that order.
2) If no sort order is specified then the retrieved child articles within CSArticleMultiple
are firstly
ordered by their parent article. The retrieved child articles for each parent article are then further ordered in
the following ways:
strParentArticleIDList
- a comma-separated list of article IDs whose child articles are to be retrieved.public java.lang.String getParentArticleIDList()
get
method.public void setIgnoreVisibility(boolean bIgnoreVisibility)
bIgnoreVisibility
- true if out of date and 'off' articles are to be retrieved by the get
method.public boolean getIgnoreVisibility()
get
method.public void setDisplayAll(boolean bDisplayAll)
setIgnoreVisibility(boolean)
.bDisplayAll
- true if out of date and 'off' articles are to be retrieved by the get
method.public boolean getDisplayAll()
getIgnoreVisibility()
.get
method.public void setArticleList(java.lang.String strArticleList)
setArticleList
followed by a call to get
returns details of the articles specified
in the list.
strArticleList
- a comma-separated list of article IDs.public java.lang.String getRootArticleIDList()
public void setRootArticleIDList(java.lang.String strRootArticleIDList)
strRootArticleIDList
- Root article idspublic java.lang.String getArticleList()
public void setTemplateList(java.lang.String strTemplateList)
setTemplateList
followed by a call to get
returns details of the articles which use
the iCM templates specified in the list.
strTemplateList
- a comma-separated list of template IDs.public java.lang.String getTemplateList()
public void setExcludeTemplateList(java.lang.String strExcludeTemplateList)
setExcludeTemplateList
followed by a call to get
returns details of the articles
which do not use the iCM templates specified in the list.
strExcludeTemplateList
- a comma-separated list of template IDs.public java.lang.String getExcludeTemplateList()
public void setFriendlyURL(java.lang.String strFriendlyURL)
setFriendlyURL
followed by a call to get
returns details of the articles
that have the specified friendly URL. There may be more than one article returned if the URL is used
by different subsites. If the supplied URL is a string representation of a live article ID, that article
will be included in the returned results.
A supplied friendly URL should NOT include a leading '/' character.
strFriendlyURL
- a friendly URL.public java.lang.String getFriendlyURL()
public void setMetadataList(java.lang.String strMetadataList)
setMetaDataIDs
instead.strMetadataList
- a comma-separated list of metadata IDs.public java.lang.String getMetadataList()
getMetaDataIDs
instead.public void setMetadataOptionalList(java.lang.String strMetadataList)
setMetaDataOptionalIDs
instead.strMetadataList
- a comma-separated list of metadata IDs.public java.lang.String getMetadataOptionalList()
getMetaDataOptionalIDs
instead.public void setMetaDataIDs(java.lang.String strMetaDataIDs)
setMetaDataIDs
followed by a call to get
returns details of all the articles that
are related to ALL of the specified metadata values.
setMetaDataIDs
may be used as a primary key or in conjunction with other primary keys (setParentArticleIDList
and setRelatedArticleID
) as a further filter.
strMetaDataIDs
- a comma-separated list of metadata value IDs.setMetaDataOptionalIDs
,
setExcludeMetaDataIDs
public java.lang.String getMetaDataIDs()
public void setMetaDataOptionalIDs(java.lang.String strMetaDataOptionalIDs)
setMetaDataOptionalIDs
followed by a call to get
returns details of all the
articles that are related to at least one of the specified metadata values.
setMetaDataOptionalIDs
may be used as a primary key or in conjunction with other primary keys (setParentArticleIDList
and setRelatedArticleID
) as a further filter.
strMetaDataOptionalIDs
- a comma-separated list of metadata value IDs.setMetaDataIDs
,
setExcludeMetaDataIDs
public java.lang.String getMetaDataOptionalIDs()
public void setExcludeMetaDataIDs(java.lang.String strExcludeMetaDataIDs)
setExcludeMetaDataIDs
followed by a call to get
returns details of all the articles
that are NOT related to any of the specified metadata values.
setExcludeMetaDataIDs
may be used as a primary key or in conjunction with other primary keys (setParentArticleIDList
and setRelatedArticleID
) as a further filter.
strExcludeMetaDataIDs
- a comma-separated list of metadata value IDs.setMetaDataIDs
,
setMetaDataOptionalIDs
public java.lang.String getExcludeMetaDataIDs()
public void setEventList(java.lang.String strEventList)
setEventList
followed by a call to get
returns details of the articles which have
ALL the iCM event items specified in the list.
Note that setEventList
may be used in conjunction with
setEventList
.
strEventList
- a comma-separated list of event IDs.public java.lang.String getEventList()
public void setEventOptionalList(java.lang.String strEventOptionalList)
setEventOptionalList
followed by a call to get
returns details of the articles with
one or more of the iCM event items specified in the list.
Note that setEventOptionalList
may be used in conjunction with
setEventList
.
strEventOptionalList
- a comma-separated list of event IDs.public java.lang.String getEventOptionalList()
public void setFilterColumn(java.lang.String strName) throws CSParameterException
setFilterValue
method.
This method cannot be used in conjunction with the setArticleList
method.
Available filter columns are (case insensitive) :
ArticleID - filter by article ID
ArticleHeading - filter by article heading
ArticleIntroText - filter by article intro text
ArticleDate - filter by article creation date
ArticleDisplayDate - filter by article display start date
ArticleDisplayEDate - filter by the article display end date
ArticleTemplateID - filter by the article template ID
ArticleUserID - filter by the unique identifier of the last iCM user to update the article
ArticleLastModifiedDate - filter by date on which the article was last modified
strName
- The column name, for example ArticleDisplayDate
CSParameterException
- if an invalid column name is specifiedpublic java.lang.String getFilterColumn()
setFilterValue
method.
ArticleDisplayDate
public void setFilterValue(java.lang.Object objValue)
setFilterColumn
method.
FilterValue
, setFilterColumn
and
setFilterLogic
can be used to filter the retrieved articles.
setFilterValue
specifies the value that is to be compared to the contents of the article column
whose name is supplied via the setFilterColumn()
method. The operation specified via the
setFilterLogic()
method will determine the type of comparison undertaken.
For date columns such as ARTICLEDISPLAYDATE
this value should be a java.util.Date
object. For all other columns this value should be a String
object containing the text or number
to be compared.
When the setFilterLogic
method is used to specify a LOGIC_BETWEEN
operation, the
setFilterValue2
method should be used to supply the upper range limit for the
filtering operation.
objValue
- The filter valuepublic java.lang.Object getFilterValue()
setFilterColumn
method.
FilterValue
, setFilterColumn
and
setFilterLogic
can be used to filter the retrieved articles.
setFilterValue
specifies the value that is to be compared to the contents of the article column
whose name is supplied via the setFilterColumn()
method. The operation specified via the
setFilterLogic()
method will determine the type of comparison undertaken.
For date columns such as ARTICLEDISPLAYDATE
this value should be a java.util.Date
object. For all other columns this value should be a String
object containing the text or number
to be compared.
When the setFilterLogic
method is used to specify a LOGIC_BETWEEN
operation, the
setFilterValue2
method should be used to supply the upper range limit for the
filtering operation.
public void setFilterValue2(java.lang.Object objValue)
LOGIC_BETWEEN
filtering operation. The FilterValue2
setting is only used when
setFilterLogic
is used to set a LOGIC_BETWEEN
. filtering logic.
It is ignored in all other cases.
FilterValue
and FilterValue2
represent the lower and upper boundaries respectively
of the allowed range. For date columns such as ArticleDisplayDate
, FilterValue2
must be a java.util.Date
object. For all other columns the value must be a String
instance containing the text or number to be compared.
See the setFilterColumn
, setFilterLogic
and
setFilterValue
documentation for details of setting up and using the filtering
process.
objValue
- The filter valuepublic java.lang.Object getFilterValue2()
LOGIC_BETWEEN
filtering
operation. The FilterValue2
setting is only used when
setFilterLogic
is used to set a LOGIC_BETWEEN
. filtering logic.
It is ignored in all other cases.
FilterValue
and FilterValue2
represent the lower and upper boundaries respectively
of the allowed range. For date columns such as ArticleDisplayDate
, FilterValue2
must be a java.util.Date
object. For all other columns the value must be a String
instance containing the text or number to be compared.
See the setFilterColumn
, setFilterLogic
and
setFilterValue
documentation for details of setting up and using the filtering
process.
public void setFilterLogic(java.lang.String strLogic) throws CSParameterException
setFilterColumn
method and the value specified via the
setFilterValue
method.
Valid logic operations are :
CSArticleMultiple.LOGIC_EQUAL
- the column's value must be equal to the supplied value
CSArticleMultiple.LOGIC_LESSTHAN
- the column's value must be less than the supplied value
CSArticleMultiple.LOGIC_LESSTHANEQUAL
- the column's value must be less than or equal to the
supplied value
CSArticleMultiple.LOGIC_GREATERTHAN
- the column's value must be greater than the supplied
value
CSArticleMultiple.LOGIC_GREATERTHANEQUAL
- the column's value must be greater than or equal
to the supplied value
CSArticleMultiple.LOGIC_LIKE
- the column's value must be LIKE
the supplied
value, %
can be used as a wildcard character
CSArticleMultiple.LOGIC_BETWEEN
- the column's value must be BETWEEN
the
supplied value and value2 settings
strLogic
- One of the above logic valuesCSParameterException
- if an invalid logic value is specifiedpublic java.lang.String getFilterLogic()
setFilterColumn
method and the value specified via the
setFilterValue
method.
Valid logic operations are :
CSArticleMultiple.LOGIC_EQUAL
- the column's value must be equal to the supplied value
CSArticleMultiple.LOGIC_LESSTHAN
- the column's value must be less than the supplied value
CSArticleMultiple.LOGIC_LESSTHANEQUAL
- the column's value must be less than or equal to the
supplied value
CSArticleMultiple.LOGIC_GREATERTHAN
- the column's value must be greater than the supplied
value
CSArticleMultiple.LOGIC_GREATERTHANEQUAL
- the column's value must be greater than or equal
to the supplied value
CSArticleMultiple.LOGIC_LIKE
- the column's value must be LIKE
the supplied
value, %
can be used as a wildcard character
public void setUserID(int nUserID)
Do not set User ID if you are only interested in retrieving unsecured articles, as this will result in a faster query.
setUserID
and an appropriate set
method for article ID followed by a call to
get
will return details of the articles which are either unsecured articles, or secured articles
to which the specified has access.
nUserID
- the ID of the user to be used in article security checks.public int getUserID()
public void setGroupList(java.lang.String strGroupList)
Do not set this list unless User ID is also being specified using the setUserID
method.
Specifying the website User ID is sufficient to enable full article security to be implemented. However, for
performance reasons the list of group IDs should be also specified if it is already known.
strGroupList
- comma-separated list of the IDs of the website user groups to which the specified user belongs.public java.lang.String getGroupList()
This list is built up by the get
method only if a User ID is specified using the
setUserID
method.
public void setOverrideSecurity(boolean bOverrideSecurity)
If this flag is set, article security checks are still performed but the article details (with the exception of the article text) are retrieved even if the checks fail.
bOverrideSecurity
- true if articles should be retrieved regardless of the outcome of the article security checks.public boolean getOverrideSecurity()
If this flag is set, article security checks are still performed but the article details (with the exception of the article text) are retrieved even if the checks fail.
public void setTolerateNotFound(boolean bTolerateNotFound)
If this flag is set, any articles not found will be included in the list of returned articles, but with 'nulled' content.
bTolerateNotFound
- The flag indicating if not found articles should be included in the return list of articles.public boolean getTolerateNotFound()
If this flag is set, any articles not found will be included in the list of returned articles, but with 'nulled' content.
public void setExcludeFailedItems(boolean bExcludeFailedItems)
The setTolerateNotFound
and setOverrideSecurity
properties make it possible to make requests for items which are not
found (possibly due to display criteria) or inaccessible due to security without an exception being thrown. If these flags are set then any inaccessible
items will be included in the results list with their Status set to DOES_NOT_EXIST or SECURE_ACCESS_DENIED.
If the ExcludeFailedItems flag is also set then any inaccessible items will not be included in the results list.
Note that it will still be necessary to set setTolerateNotFound
and/or setOverrideSecurity
as required.
bExcludeFailedItems
- The flag which indicates whether or not articles which could not not be retrieved should be included in the results.public boolean getExcludeFailedItems()
The setTolerateNotFound
and setOverrideSecurity
properties make it possible to make requests for items which are not
found (possibly due to display criteria) or inaccessible due to security without an exception being thrown. If these flags are set then any inaccessible
items will be included in the results list with their Status set to DOES_NOT_EXIST or SECURE_ACCESS_DENIED.
If the ExcludeFailedItems flag is also set then any inaccessible items will not be included in the results list.
Note that it will still be necessary to set setTolerateNotFound
and/or setOverrideSecurity
as required.
public void setExtensionDataReqd(boolean bExtensionDataReqd)
If this flag is set, article extension data will be retrieved.
bExtensionDataReqd
- a flag indicating if article extension data should be retrieved.public boolean getExtensionDataReqd()
If this flag is set, article extension data will be retrieved.
public void setSortOrder(java.lang.String strSortOrderList) throws CSParameterException
This method should not be used if the setPathArticleID
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, "ArticleHeading DESC" would order in descending
order of article heading. The default sort order in this instance is 'ArticleDisplayDate ASC', except for Related
Articles where the default is the iCM order.
Available sort orders are :
ArticleID - order by article ID
ArticleHeading - order by article heading
ArticleIntroText - order by article intro text
ArticleDate - order by article creation date
ArticleDisplay - order by whether the display of the article is turned on or off
ArticleDisplayDate - order by article display start date
ArticleDisplayEDate - order by the article display end date
ArticleTemplateID - order by the article template ID
ArticleUserID - order by the unique identifier of the last iCM user to update the article
ArticleLastModifiedDate - order by date on which the article was last modified
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 supplied.public void setDetailLevel(int nDetailLevel) throws CSParameterException
get
method. Default is LEVEL_DETAIL.
Valid detail levels for an article are :
LEVEL_ID
Retrieves/updates ArticleID only.LEVEL_SUMMARY
Retrieves/updates ArticleID, ArticleHeading, ArticleIntroText, TemplateID and
ArticleDisplay. On version 7.0 and later databases, it also retrieves/updates ArticleLinkText and ArticleSummaryLEVEL_DETAIL
Retrieves/updates all article data, except for ArticleText, ArticleTextAdditional
and related content IDs.LEVEL_ALL
Retrieves all article data, except for related content IDs. On version
8.0.0 and later databases, it also retrieves ArticleTextAdditional.LEVEL_ALL_PLUS_RELATED
Retrieves all article data. On version 8.0.0 and later databases, it also
retrieves ArticleTextAdditional.setDetailLevel
in class CSDatabaseItem
nDetailLevel
- the detail level to be used.CSParameterException
- if an invalid detail level is specified.public void setLevelDepth(int nLevelDepth)
setLevelDepth
and setParentArticleID
followed by a call to
get
will return details of the child articles of the specified article, the child articles of the
child articles ... and so on for the specified number of generations.
For example, specifying a Level Depth of 2 would retrieve the child articles of the specified article and their children (the grandchildren of the specified article).
These articles will be stored in the ArrayList
of CSArticle
objects in parent-child order,
as shown in the following example :
Specified "root" article | Animal Kingdom |
1st child article | Mammals |
1st child of 1st child | Cats |
2nd child of 1st child | Dogs |
2nd child article | Reptiles |
1st child of 2nd child | Snakes |
2nd child of 2nd child | Crocodiles |
... etc... | ... etc... |
At each level, sibling articles will be stored according to the sort order specified using the
setSortOrder
method.
nLevelDepth
- the number of generations of child articles to be retrieved.public int getLevelDepth()
get
method.public void get() throws CSException
Use setArticleList
followed by get
to populate this
CSArticleMultiple
object with the details of the articles specified in the list. If a sort order
was specified using the setSortOrder
method then the retrieved articles will appear
within CSArticleMultiple
in that order, else they will be in the order that their IDs appear
within the supplied list. Key information set using setMaxRows
and
setStartRow
is not valid in this instance.
Use setParentArticleIDList
followed by get
to populate
this CSArticleMultiple
object with the details of the child articles of the specified articles. If
setPreview
is false then the list of parent
articles will be treated as a list of live articles, if setPreview
is true then the list of parent
articles will be treated as a list of preview articles. For iCM version 6.0.0.0 or later, if no SortOrder is
specified the ordering of these child articles is the iCM order.
Use setLevelDepth
and setParentArticleID
followed by get
to populate this CSArticleMultiple
object recursively with the details of the child articles of
the specified article, the child articles of the child articles ... and so on through the number of generations
specified by the setLevelDepth
method.
Use setRelatedArticleID
followed by get
to populate this
CSArticleMultiple
object with the details of the related articles of the specified article.
Use setTemplateList
followed by get
to populate this
CSArticleMultiple
object with the details of the articles which use the specified templates.
Use setExcludeTemplateList
followed by get
to populate
this CSArticleMultiple
object with the details of the articles which do not use the specified
templates.
Use setEventList
followed by get
to populate this
CSArticleMultiple
object with the details of the articles which have ALL of the specified events.
The setEventOptionalList
may similarly be used to retrieve articles that
have one or more of the listed events.
Use setPathArticleID
followed by get
to populate this
CSArticleMultiple
object with the details of the articles which are in the article path of the
specified article, starting with the specified article and working back to the top of the article tree/hierarchy.
Use setFilterColumn
, setFilterLogic
and
setFilterValue
methods followed by get
to populate this
CSArticleMultiple
object with the details of the articles that match the supplied filter.
Use setMetaDataIDs
followed by get
to populate this
CSArticleMultiple
object with the details of the articles that are related to ALL of the specified
metadata values.
Use setMetaDataOptionalIDs
followed by get
to populate
this CSArticleMultiple
object with the details of the articles that are related to one or more of
the specified metadata values.
Use setExcludeMetaDataIDs
followed by get
to populate this
CSArticleMultiple
object with the details of the articles that are NOT related to any of the
specified metadata values.
Use setChanged
and the associated methods, followed by get
to
retrieve all articles that have been modified within a specified time frame. This method may not be used in
conjunction with the setArticleList
method.
Each retrieved article is stored as a CSArticle
object within the item ArrayList
member of
CSArticleMultiple
- use getItems
or iterator
to
access/navigate through them. These articles will be stored in the ArrayList
in the order
specified using the setSortOrder
method, or the default sort order of
'ArticleDisplayDate ASC'). However, if a list of article IDs was specified but without specifying a sort order,
the articles are stored in the same order as in the specified list. Path articles are stored with the specified
article first, followed by its parent article, and so on working back to the top of the article hierarchy. See
the setLevelDepth
method for an explanation of the order of recursively retrieved child articles.
NOTE ON ARTICLE SECURITY :
If a list of article IDs is specified using the setArticleList
method, every article in the list
must pass security checks. A CSSecurityException
will be thrown if no User ID has been specified
using the setUserID
method, and one or more of the articles is a secured article, or a
User ID has been specified, but the specified user does not have access one or more of the articles.
For all other types of retrieval (for example, Related Articles), any articles which do not pass security checks are simply ignored.
For performance reasons, you should not specify a User ID if you are not interested in secure articles. It is
also more efficient to specify the user groups to which the user belongs, using the
setGroupList
method, if they are already known.
OVERRIDING ARTICLE SECURITY :
For all types of retrieval, use the setOverrideSecurity
method if you want
to retrieve limited article details even if no User ID has been specified, or the specified user fails the
article security checks described above.
The same security checks are performed, but the article details (with the exception of the article text), are retrieved regardless of the outcome of these checks.
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 articles 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
CSArticleMultiple
.
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 articles cannot be found on the database.CSException
- the base class for exceptions thrown by this method.public void delete() throws CSException
CSArticleMultiple
.
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 articles cannot be found on the database.CSException
- the base class for exceptions thrown by this method.public boolean exist() throws CSException
CSArticleMultiple
.
exist
in class CSItemMultiple
true
if all articles 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 java.lang.String toString()
CSArticleMultiple
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.