ArticleService Class
This class is deprecated.
Retrieves articles and pages
Constructor
ArticleService
-
siteUid -
onlyThisSite
Parameters:
-
siteUidString -
onlyThisSiteBoolean
Methods
allowComments
-
contentSettings -
content
Provided the content descriptor and the content settings object the function indicates if comments should be allowed within the given context of the content.
Parameters:
-
contentSettingsObjectThe settings object retrieved from the content service
-
contentObjectThe page or article that should or should not have associated comments.
Returns:
find
-
where -
[options] -
cb
Finds articles and pages matching criteria
Parameters:
-
whereObjectDefines the where clause for the article search
-
[options]Object optionalThe options object that can provide query control parameters
-
[order]Array optionalThe order that the results will be returned in. The default is publish date descending and created descending
-
[select]Object optionalThe fields that will be returned for each article that matches the criteria
-
[limit]Integer optionalThe number of results to return
-
[offset]Integer optionalThe number of articles to skip before returning results
-
-
cbFunctionCallback function that takes two parameters: the first is an error, if occurred. The second is an array of articles or possibly null if an error occurs.
findById
-
articleId -
cb
Finds an article or page by Id
Parameters:
-
articleIdStringThe article's object Id
-
cbFunctionCallback function
findBySection
-
sectionId -
cb
Finds articles by section
Parameters:
-
sectionIdStringThe section's object Id
-
cbFunctionCallback function
findByTopic
-
topicId -
cb
Finds articles and pages by topic
Parameters:
-
topicIdtypeThe topic's object Id
-
cbFunctionCallback function
getArticleAuthors
-
articles -
cb
Retrieves the authors of an array of articles
Parameters:
-
articlesArrayArray of article objects
-
cbFunctionCallback function
getCommenters
-
comments -
contentSettings -
cb
Retrieves the commenters for an array of comments
Parameters:
-
commentsArrayArray of comment objects
-
contentSettingsObjectContent settings to use for processing
-
cbFunctionCallback function
getContentType
()
String
Retrieves the content type
Returns:
Content type
getMetaInfo
-
article -
cb
Retrieves the SEO metadata for the specified content.
Parameters:
-
articleObjectThe article to retrieve information for
-
cbFunctionA callback that takes two parameters. The first is an Error, if occurred. The second is an object that contains 4 properties: title - the SEO title, description - the SEO description, keywords - an array of SEO keywords that describe the content, thumbnail - a URI path to the thumbnail image
getMetaInfo
-
article -
cb
Retrieves the meta info for an article or page
Parameters:
-
articleObjectAn article or page object
-
cbFunctionCallback function
getTemplates
-
[opts] -
cb
Retrieves the article and byline templates
Parameters:
-
[opts]Object optional -
cbFunctionCallback function
processArticleForDisplay
-
article -
articleCount -
authors -
contentSettings -
[options] -
cb
Retrieves data necessary for displaying an articles and appends it to the article object
Parameters:
-
articleObjectThe artice to process
-
articleCountNumberThe total number of articles
-
authorsArrayAvailable authors retrieved from the database
-
contentSettingsObjectContent settings to use for processing
-
[options]Object optional -
cbFunctionCallback function
setContentType
-
type
Sets the content type (article, page)
Parameters:
-
typeStringThe content type
update
-
articleId -
fields -
options -
cb
Updates articles
Parameters:
-
articleIdStringid of article
-
fieldsObjectfields to update
-
optionsObject -
cbFunctionCallback function
