Home Reference Source
public class | source

ContentService

Extends:

BaseService → ContentService

Interact with content API service

Method Summary

Public Methods
public

checkinAndFetch(contentId: string, lockId: string): *

Attempt to release a content lock, then update content store

public

Attempt to obtain a content lock, then update the content store

public

create(data: object, callback: Function): *

Create new content item

public

fetch(opts: object): *

Fetch paginated content items

public

fetchOne(id: string, opts: object, forceUpdate: Boolean): *

Fetch single content update

public

remove(id: string): *

Remove (delete) content item

public

search(opts: object): *

Run a query on the search endpoint.

public

update(id: string, data: object, callback: Function): *

Update existing content item

public

updateContent(content: *): *

public

updateContents(content: *): *

public

updatePagination(pagination: *): *

public

upload(data: *, callback: *): *

Inherited Summary

From class BaseService
public

Preform a DELETE action

public

get(url: string, params: object): object

Preform a GET action

public

post(url: string, data: object, params: object): object

Preform a POST action

public

postUpload(url: string, data: object, params: object): object

Preform a POST action

public

put(url: string, data: object): object

Preform a PUT action

Public Methods

public checkinAndFetch(contentId: string, lockId: string): * source

Attempt to release a content lock, then update content store

Params:

NameTypeAttributeDescription
contentId string

Content UUID

lockId string

Lock UUID

Return:

*

public checkoutAndFetch(srn: string): * source

Attempt to obtain a content lock, then update the content store

Params:

NameTypeAttributeDescription
srn string

valid SRN

Return:

*

public create(data: object, callback: Function): * source

Create new content item

Params:

NameTypeAttributeDescription
data object

Hash of content data

callback Function

Return:

*

public fetch(opts: object): * source

Fetch paginated content items

Params:

NameTypeAttributeDescription
opts object

Hash of query options

Return:

*

public fetchOne(id: string, opts: object, forceUpdate: Boolean): * source

Fetch single content update

Params:

NameTypeAttributeDescription
id string

UUID

opts object

Hash of query options

forceUpdate Boolean

If true (default) force update to content store, otherwise, don't

Return:

*

public remove(id: string): * source

Remove (delete) content item

Params:

NameTypeAttributeDescription
id string

Return:

*

Run a query on the search endpoint. See search docs for query info

Params:

NameTypeAttributeDescription
opts object

Query has

Return:

*

public update(id: string, data: object, callback: Function): * source

Update existing content item

Params:

NameTypeAttributeDescription
id string

UUID

data object

Hash of content data

callback Function

Return:

*

public updateContent(content: *): * source

Params:

NameTypeAttributeDescription
content *

Return:

*

public updateContents(content: *): * source

Params:

NameTypeAttributeDescription
content *

Return:

*

public updatePagination(pagination: *): * source

Params:

NameTypeAttributeDescription
pagination *

Return:

*

public upload(data: *, callback: *): * source

Params:

NameTypeAttributeDescription
data *
callback *

Return:

*