API Docs for: 0.8.0
Show:

ArticleService Class

This class is deprecated.

Retrieves articles and pages

Constructor

ArticleService

(
  • siteUid
  • onlyThisSite
)
deprecated

Parameters:

  • siteUid String
  • onlyThisSite Boolean

Methods

allowComments

(
  • contentSettings
  • content
)
Boolean

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 Object

    The settings object retrieved from the content service

  • content Object

    The page or article that should or should not have associated comments.

Returns:

Boolean:

find

(
  • where
  • [options]
  • cb
)

Finds articles and pages matching criteria

Parameters:

  • where Object

    Defines the where clause for the article search

  • [options] Object optional

    The options object that can provide query control parameters

    • [order] Array optional

      The order that the results will be returned in. The default is publish date descending and created descending

    • [select] Object optional

      The fields that will be returned for each article that matches the criteria

    • [limit] Integer optional

      The number of results to return

    • [offset] Integer optional

      The number of articles to skip before returning results

  • cb Function

    Callback 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 String

    The article's object Id

  • cb Function

    Callback function

findBySection

(
  • sectionId
  • cb
)

Finds articles by section

Parameters:

  • sectionId String

    The section's object Id

  • cb Function

    Callback function

findByTopic

(
  • topicId
  • cb
)

Finds articles and pages by topic

Parameters:

  • topicId type

    The topic's object Id

  • cb Function

    Callback function

getArticleAuthors

(
  • articles
  • cb
)

Retrieves the authors of an array of articles

Parameters:

  • articles Array

    Array of article objects

  • cb Function

    Callback function

getCommenters

(
  • comments
  • contentSettings
  • cb
)

Retrieves the commenters for an array of comments

Parameters:

  • comments Array

    Array of comment objects

  • contentSettings Object

    Content settings to use for processing

  • cb Function

    Callback function

getContentType

() String

Retrieves the content type

Returns:

String:

Content type

getMetaInfo

(
  • article
  • cb
)

Retrieves the SEO metadata for the specified content.

Parameters:

  • article Object

    The article to retrieve information for

  • cb Function

    A 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
)
deprecated

Defined in include/service/entities/article_service.js:491

Deprecated: Since 0.4.1

Retrieves the meta info for an article or page

Parameters:

  • article Object

    An article or page object

  • cb Function

    Callback function

getTemplates

(
  • [opts]
  • cb
)

Retrieves the article and byline templates

Parameters:

  • [opts] Object optional
  • cb Function

    Callback function

processArticleForDisplay

(
  • article
  • articleCount
  • authors
  • contentSettings
  • [options]
  • cb
)

Retrieves data necessary for displaying an articles and appends it to the article object

Parameters:

  • article Object

    The artice to process

  • articleCount Number

    The total number of articles

  • authors Array

    Available authors retrieved from the database

  • contentSettings Object

    Content settings to use for processing

  • [options] Object optional
  • cb Function

    Callback function

setContentType

(
  • type
)

Sets the content type (article, page)

Parameters:

  • type String

    The content type

update

(
  • articleId
  • fields
  • options
  • cb
)

Updates articles

Parameters:

  • articleId String

    id of article

  • fields Object

    fields to update

  • options Object
  • cb Function

    Callback function

Properties

ARTICLE_TYPE

String private static

PAGE_TYPE

String private static