ArticleServiceV2 Class
Provides functions to interact with articles
Constructor
ArticleServiceV2
-
context
Parameters:
-
context
Object-
[contentSettings]
Object optional -
site
String -
onlyThisSite
Boolean
-
Item Index
Methods
- _emit
- _get
- _retrieveOnUpdateAndMerge
- add
- count
- deleteById
- deleteSingle
- static
- static
- gatherDataForRender
- get
- getAll
- getAllWithCount
- getBySection
- getContext
- getDrafts
- getIdWhere
- getMetaInfo
- getPublished
- getRenderer
- getRenderOptions
- getSingle
- getTopicsForContent
- getType
- render
- save
- setSectionClause static
- setTopicClause static
- update
- validate static
- validateHeadline
Properties
- contentSettings
- dao
- site
- topicService
- TYPE static
- type
Methods
_emit
-
event
-
data
-
cb
Parameters:
-
event
String -
data
Object -
cb
Function
_get
-
id
-
[options]
-
cb
Parameters:
-
id
String -
[options]
Object optional -
cb
Function
_retrieveOnUpdateAndMerge
-
dto
-
options
-
cb
Parameters:
-
dto
Object -
options
Object-
[isCreate]
Boolean optional
-
-
cb
Function
add
-
dto
-
[options]
-
cb
Parameters:
-
dto
Object -
[options]
Object optional -
cb
FunctionA callback that takes two parameters. The first is an error, if occurred. The second is the object that matches the specified query
count
-
[options]
-
cb
Parameters:
-
[options]
Object optional-
[where]
Object optional
-
-
cb
FunctionA callback that takes two parameters. The first is an error, if occurred. The second is the number of results that match the specified query
deleteById
-
id
-
options
-
cb
Parameters:
-
id
String -
options
Object -
cb
Function
deleteSingle
-
[options]
-
cb
Parameters:
-
[options]
Object optionalSee BaseObjectService#getSingle-
[where]
Object optional
-
-
cb
Function
-
context
-
service
-
cb
Parameters:
-
context
Object -
service
ArticleServiceV2An instance of the service that triggered the event that called this handler
-
cb
FunctionA callback that takes a single parameter: an error if occurred
-
context
-
cb
Parameters:
-
context
Object-
service
ArticleServiceV2An instance of the service that triggered the event that called this handler
-
-
cb
FunctionA callback that takes a single parameter: an error if occurred
gatherDataForRender
-
contentArray
-
cb
Parameters:
-
contentArray
Array -
cb
Function
get
-
id
-
options
-
cb
Parameters:
-
id
String -
options
Object-
[render=false]
Boolean optional -
[readMore=false]
Boolean optional
-
-
cb
Function
getAll
-
[options]
-
cb
Parameters:
-
[options]
Object optional-
[where]
Object optional -
[select]
Object optional -
[order]
Array optional -
[limit]
Integer optional -
[offset]
Integer optional -
[render=false]
Boolean optional -
[readMore=true]
Boolean optional
-
-
cb
Function
getAllWithCount
-
[options]
-
cb
Parameters:
-
[options]
Object optional-
[select]
Object optional -
[where]
Object optional -
[order]
Array optional -
[limit]
Integer optional -
[offset]
Integer optional
-
-
cb
FunctionA callback that takes two parameters. The first is an error, if occurred. The second is an object representing the results of the query.
getBySection
-
sectionId
-
[options]
-
cb
Retrieves articles based on the section
Parameters:
-
sectionId
String | Object -
[options]
Object optional -
cb
Function
getContext
-
[data]
Parameters:
-
[data]
String | Object | Number | Boolean optional
Returns:
getDrafts
-
[options]
-
cb
Parameters:
-
[options]
Object optional-
[where]
Object optional -
[select]
Object optional -
[order]
Array optional -
[limit]
Integer optional -
[offset]
Integer optional -
[render=false]
Boolean optional
-
-
cb
Function
getIdWhere
-
dto
Parameters:
-
dto
Object
Returns:
getMetaInfo
-
content
-
cb
Parameters:
-
content
ObjectThe content 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
getPublished
-
[options]
-
cb
Parameters:
-
[options]
Object optional-
[where]
Object optional -
[select]
Object optional -
[order]
Array optional -
[limit]
Integer optional -
[offset]
Integer optional -
[render]
Boolean optional
-
-
cb
Function
getRenderOptions
-
options
Provides the options for rendering
Parameters:
-
options
Object
Returns:
getSingle
-
[options]
-
cb
Parameters:
-
[options]
Object optional-
[select]
Object optional -
[where]
Object optional -
[order]
Array optional -
[offset]
Integer optional -
[readMore=false]
Boolean optional
-
-
cb
Function
getTopicsForContent
-
content
Extracts an array of Topic IDs from the content that the content is associated with.
Parameters:
-
content
Object
Returns:
An array of strings representing the Topic IDs
getType
()
String
Returns:
render
-
contentArray
-
[options]
-
cb
Parameters:
-
contentArray
Array -
[options]
Object optionalAn optional argument to provide rendering settings.-
[readMore]
Boolean optionalSpecifies if content body layout should be truncated, and read more links rendered.
-
-
cb
Function
save
-
dto
-
[options]
-
cb
Parameters:
-
dto
Object -
[options]
Object optional-
[isCreate]
Boolean optional
-
-
cb
FunctionA callback that takes two parameters. The first is an error, if occurred. The second is the object that matches the specified query
setSectionClause
-
where
Parameters:
-
where
Object
setTopicClause
-
where
Parameters:
-
where
Object
update
-
dto
-
[options]
-
cb
Parameters:
-
dto
Object -
[options]
Object optional -
cb
FunctionA callback that takes two parameters. The first is an error, if occurred. The second is the object that matches the specified query
validate
-
context
-
cb
Parameters:
-
context
Object-
data
ObjectThe DTO that was provided for persistence
-
validationErrors
Array -
service
ArticleServiceV2An instance of the service that triggered the event that called this handler
-
-
cb
Function(Error) A callback that takes a single parameter: an error if occurred
validateHeadline
-
context
-
cb
Parameters:
-
context
Object-
data
Object -
validationErrors
Array
-
-
cb
Function(Error)