ArticleService Class
This class is deprecated.
Retrieves articles and pages
Constructor
ArticleService
-
siteUid
-
onlyThisSite
Parameters:
-
siteUid
String -
onlyThisSite
Boolean
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:
-
contentSettings
ObjectThe settings object retrieved from the content service
-
content
ObjectThe page or article that should or should not have associated comments.
Returns:
find
-
where
-
[options]
-
cb
Finds articles and pages matching criteria
Parameters:
-
where
ObjectDefines 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
-
-
cb
FunctionCallback 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:
-
articleId
StringThe article's object Id
-
cb
FunctionCallback function
findBySection
-
sectionId
-
cb
Finds articles by section
Parameters:
-
sectionId
StringThe section's object Id
-
cb
FunctionCallback function
findByTopic
-
topicId
-
cb
Finds articles and pages by topic
Parameters:
-
topicId
typeThe topic's object Id
-
cb
FunctionCallback function
getArticleAuthors
-
articles
-
cb
Retrieves the authors of an array of articles
Parameters:
-
articles
ArrayArray of article objects
-
cb
FunctionCallback function
getCommenters
-
comments
-
contentSettings
-
cb
Retrieves the commenters for an array of comments
Parameters:
-
comments
ArrayArray of comment objects
-
contentSettings
ObjectContent settings to use for processing
-
cb
FunctionCallback function
getContentType
()
String
Retrieves the content type
Returns:
Content type
getMetaInfo
-
article
-
cb
Retrieves the SEO metadata for the specified content.
Parameters:
-
article
ObjectThe article to retrieve information for
-
cb
FunctionA 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:
-
article
ObjectAn article or page object
-
cb
FunctionCallback function
getTemplates
-
[opts]
-
cb
Retrieves the article and byline templates
Parameters:
-
[opts]
Object optional -
cb
FunctionCallback function
processArticleForDisplay
-
article
-
articleCount
-
authors
-
contentSettings
-
[options]
-
cb
Retrieves data necessary for displaying an articles and appends it to the article object
Parameters:
-
article
ObjectThe artice to process
-
articleCount
NumberThe total number of articles
-
authors
ArrayAvailable authors retrieved from the database
-
contentSettings
ObjectContent settings to use for processing
-
[options]
Object optional -
cb
FunctionCallback function
setContentType
-
type
Sets the content type (article, page)
Parameters:
-
type
StringThe content type
update
-
articleId
-
fields
-
options
-
cb
Updates articles
Parameters:
-
articleId
Stringid of article
-
fields
Objectfields to update
-
options
Object -
cb
FunctionCallback function