Toggle menu

CSArticleMultiple

The CSArticleMultiple class includes methods for the retrieval of several articles' details.

Note that it is not possible to use CSArticleMultiple to create, update or delete an article. This functionality is provided by making direct iCM requests using the ColdFusion API's iCM_obj_articleUpdate

Unlike CSArticle, where an article or template ID must be provided, setting no properties will return all articles in the database. Setting almost any of the properties below will only return articles that have those properties. Many of the properties can be used in combination with each other to build up a filter.

Typically, only those articles that are in date and currently turned "on" will be retrieved. However, if IgnoreVisibility is set to true, any articles that have been turned "off" and/or that are not in date will also be included.

Each retrieved article is stored as a CSArticle instance within this CSArticleMultiple instance - ie as a CSArticle object in an array.

Methods

Parameters must use the get-set structure described in the introduction - Java API (CSObjects).

  • get a string (comma separated) that lists the properties whose values should be returned, an asterisk to indicate that all properties should be returned, or an empty string to return nothing
  • set the properties which should be set before the specified method is performed

CSArticleMultiple_get

Retrieves an array of CSArticles as objects.

Request Parameters

NameTypeDescription
getStringA comma separated list of properties to return
setObjectAn object containing any of the properties listed below

In this request we want to know the article headings of all of the articles beneath article 16, up to a depth of 3 (ie child articles, their child articles and their child articles)

this.callWorkerMethod("icmapi", "CSArticleMultiple_get", {
    "get": "ArticleHeading",
    "set": {
        "ParentArticleIDList":"16",
        "LevelDepth":3,
    }
});

Response

NameTypeDescription
data.multipleItemDataArray of ObjectsEach object in the array represents one article. Each contains the properties in the get request

We can see the article headings of the three levels are articles requested.

{
    "result": [{
        "_ItemClass": "CSArticle",
        "ArticleHeading": "An Event"
    }, {
        "_ItemClass": "CSArticle",
        "ArticleHeading": "A Child Event"
    }, {
        "_ItemClass": "CSArticle",
        "ArticleHeading": "A location"
    }]
}

Properties

PropertyTypeDescription
ArticleListStringA list of  IDs of the articles to be retrieved. If ArticleList is provided, other key properties, such as Changed, ExcludeMetadataIDs and ExcludeTemplateList will be ignored
ChangedBooleanDefaults to false. If true, used in conjunction with ChangedAction, ChangedEndDate, ChangedSignificantly and ChangedStartDate. Changedsignificantly must be provided. May be used as a filter in conjunction with other key properties
ChangedActionInteger1 - returns articles that have been created
2 - returns articles that have been updated
1|2 returns both. Defaults to both
ChangedEndDateDateTimeArticles changed/updated before this date (inclusive) will be retrieved, for example "2018-01-12T10:29:59Z". Defaults to today
ChangedSignificantlyBoolean, Required if Changed: truetrue - only articles that have been flagged as "significant" on create/update will be returned. false - all articles will be returned
ChangedStartDateDateTimeArticles changed/updated after this date (inclusive) will be retrieved, for example "2018-01-12T10:29:59Z". Defaults to seven days prior to today
DetailLevelIntegerThe level of detail returned. One of:
1 - LEVEL_ID: ArticleID only
2 - LEVEL_SUMMARY: ArticleID, ArticleHeading, ArticleIntroText, TemplateID, ArticleDisplay, ArticleLinkText and ArticleSummary
3 - LEVEL_DETAIL: All article data, except for ArticleText, ArticleTextAdditional and related content IDs
4 - LEVEL_ALL: All article data, except for related content IDs
5 - LEVEL_ALL_PLUS_RELATED: All article data
The default level is 4
EventListStringA comma separated list of event IDs. Use EventList to retrieve a list of articles that have ALL of the events in the list related to them (the articles returned may have additional events not in the list related to them). May be used as a filter in conjunction with other key properties
EventOptionalListStringA comma separated list of event IDs. Use EventOptionalList to retrieve a list of articles that have ANY of the events in the list related to them. May be used as a filter in conjunction with other key properties
ExcludeFailedItemsBooleanThe TolerateNotFound and OverrideSecurity 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 set then any inaccessible items will not be included in the results list. Note that it will still be necessary to set TolerateNotFound and/or OverrideSecurity as required. 
ExcludeMetaDataIDsStringA comma separated list of metadata IDs. Returns details of all the articles that do NOT have any of the specified metadata values as related content. May be used as a filter in conjunction with other key properties
ExcludeTemplateListStringA comma separated list of template IDs. Returns details of all the articles that do NOT use the specified templates. May be used as a filter in conjunction with other key properties
ExtensionDataReqdBooleanIf true the article's extension data, the "article extras", will be returned in the ObjExtensionData property
FilterColumnStringIf provided will filter the returned articles. Can be used on its own or as a filter in conjunction with other key properties. FilterLogic and FilterValue must be provided. See below for possible values
FilterLogicString, Required if FilterColumn: trueCompares the FilterColumn and FilterValue. Must be one of "=", "<", "<=", ">", ">=", "LIKE" or "BETWEEN". See below
FilterValueString or DateTime, Required if FilterColumn: trueThe single value, or lower value of a range in a filter
FilterValue2String or DateTimeThe upper value of the filter range. Only used if FilterLogic is "BETWEEN"
FriendlyURLStringReturns the details of articles with this friendly URL. There may be more than one of the friendly URL is used on multiple subsites
GroupListStringA comma separated list of website user groups IDs. Set in conjunction with UserID (otherwise serves no purpose)
IgnoreVisibilityBoolean

Set to true if the articles are to be retrieved by the get method regardless of display dates and display flag. If false an article will only be retrieved if its display start and end dates are current and its display flag is set to 'on'. Default false

LevelDepthIntegerUsed with ParentArticleIDList to set the depth of the child articles returned. Setting 1 would only retrieve the child articles, 2 the child and grandchild articles etc. Default 1
MetaDataIDsStringA coma separated list of metadata IDs. Use MetadataIDs to retrieve a list of articles that have ALL of the metadata values in the list related to them (the articles returned may have additional values not in the list related to them). May be used as a filter in conjunction with other key properties
MetaDataOptionalIDsStringA comma separated list of metadata IDs. Use MetaDataOptionalList to retrieve a list of articles that have ANY of the metadata values in the list related to them. May be used as a filter in conjunction with other key properties
OverrideSecurityBooleanIf set true, article details (minus the article text) will be returned even if security checks fail. Default false
ParentArticleIDListStringA comma separated list of article IDs. Returns all of the child articles of all of the articles in the list. Use with LevelDepth to set the depth of the article tree returned
PathArticleIDIntegerReturns the details of the specified article, plus the details of all parent/grandparent articles in order, back to (and including) the site homepage. Will include articles with ArticleDisplay:false
RelatedArticleIDIntegerReturns the details of all articles related to the article ID provided. Articles will be ordered as they are in iCM, but may be sorted. May be used as a filter in conjunction with other key properties
RootArticleIDListStringA comma separated list of root article IDs. If set, the get request will only be performed on articles beneath the specified articles
SortOrderStringSorts the returned articles. Use ASC or DESC to indicate the direction of ordering for a particular sort order, for example "ArticleHeading ASC".

If not set, articles are returned in the order they are positioned in iCM. Sorting options include: ArticleID, ArticleHeading, ArticleIntroText, ArticleDate, ArticleDisplayDate, ArticleDisplayEDate, ArticleTemplateID, ArticleUserID, LastModifiedDate
SuggestedArticleIDIntegerReturns suggested articles for the provided article ID. Serves no purpose if the suggester is not being used
TemplateListStringA comma separated list of template IDs. Return details of all articles using the specified templates
TolerateNotFoundBoolean

By default, if a requested article is not found a CSNotFoundException will be raised. Set the TolerateNotFound property to true to prevent these exceptions from being generated. If this flag is set, any articles not found will be included in the list of populated articles with a Status of DOES_NOT_EXIST. The associated article content will be undefined

UserIDIntegerSpecifying UserID in combination with other key properties will will only return the requested article details if the user passes any security set on the article. If the article is not secure, this has no effect. If the article is secure and the UserID does not have access, a security exception is thrown

Filters

A FilterValue can be tested against the FilterColumn property using the defined FilterLogic.

The available FilterColumn properties are:

NameDescription
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
LastModifiedDate Filter by date on which the article was last modified

The logic operators are:

OperatorDescription
=Equals. An exact match between the contents of the FilterColumn and FilterValue
<Less than. Will find a match if the contents of the FilterColumn property is deemed to be less than the value of the FilterValue property
<=Less than or equal. Will find a match if the contents of the FilterColumn property is deemed to be less than or equal to the value of the FilterValue property
>Greater than. Will find a match if the contents of the FilterColumn property is deemed to be greater than the value of the FilterValue property
>=Greater than or equal. Will find a match if the contents of the FilterColumn property is deemed to be greater than or equal to the value of the FilterValue property
LIKECompares the contents of the FilterColumn property to the value of the FilterValue property. Wildcards can be inserted using %
BETWEENWill find a match of all items between the FilterValue and FilterValue2

Filter Example

In this example, all articles with the letter sequence "test" anywhere in their heading will be returned.

"set": {
    "FilterColumn":"ArticleHeading",
    "FilterValue":"%test%",
    "FilterLogic":"LIKE"
}

Last modified on February 01, 2024

Share this page

Facebook icon Twitter icon email icon

Print

print icon