PageService Class
Provides functions to interact with pages
Constructor
PageService
-
context
Parameters:
-
context
Object-
[contentSettings]
Object optional -
site
String -
onlyThisSite
Boolean
-
Item Index
Methods
- _emit
- _get
- _retrieveOnUpdateAndMerge
- add
- count
- deleteById
- deleteSingle
- format static
- gatherDataForRender
- get
- getAll
- getAllWithCount
- getContext
- getDrafts
- getIdWhere
- getMetaInfo
- getPublished
- getRenderer
- getRenderOptions
- getSingle
- getTopicsForContent
- getType
- merge static
- 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
format
-
context
-
cb
Parameters:
-
context
Object-
service
PageServiceAn instance of the service that triggered the event that called this handler
-
data
Object
-
-
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.
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
Retrieves the SEO metadata for the specified content.
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
-
isMultiple
Provides the options for rendering
Parameters:
-
options
Object -
isMultiple
Boolean
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:
merge
-
context
-
cb
Parameters:
-
context
Object-
service
PageServiceAn instance of the service that triggered the event that called this handler
-
data
Object
-
-
cb
FunctionA callback that takes a single parameter: an error if occurred
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
-
sectionId
Parameters:
-
where
Object -
sectionId
String
setTopicClause
-
where
-
topicId
Parameters:
-
where
Object -
topicId
String
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
-
page_topics
Array
-
-
service
PageServiceAn instance of the service that triggered the event that called this handler
-
-
cb
FunctionA callback that takes a single parameter: an error if occurred
validateHeadline
-
context
-
cb
Validates that a headline is provided and is unique
Parameters:
-
context
Object-
data
Object -
validationErrors
Array
-
-
cb
Function(Error)