Class: ContentSDK

Class: ContentSDK

ContentSDK

new ContentSDK()

Methods

(static) contentSDK.createDeliveryClient(args) → {ContentDeliveryClient}

Create a client content SDK object to interact with content published in Oracle Content Management:
  • Read the published content items
  • Render published content using named content layouts
Parameters:
Name Type Description
args object A JavaScript object containing the parameters to create the content delivery client instance.
Properties
Name Type Attributes Default Description
contentServer string <optional>
'protocol://host:port' URL to the Oracle Content Management instance providing content. The default assumes the current 'protocol://host:port'.
contentVersion 'v1' | 'v1.1' <optional>
'v1.1' The version of the content delivery REST API to use.
channelToken string The Oracle Content Management instance token for accessing published content.
cacheBuster string <optional>
'' The URL parameter used to control whether or not content is fetched from the browser cache.
secureContent boolean <optional>
false Content is secured and requires sign-in to view.
authorization string <optional>
Authorization header to include in the request.
beforeSend function <optional>
Callback passing in the xhr (browser) or options (NodeJS) object before making the REST call.
timeout string <optional>
0 Timeout for the AJAX calls, defaults to no timeout.
logger object An object that implements the standard log functions: ['error', 'warn', 'info', 'debug', 'log'].
Returns:
Type
ContentDeliveryClient
Example
// create a ContentDeliveryClient and output logging 'info' messages to the console
var contentClient = contentSDK.createDeliveryClient({
    'contentServer': contentServer,
    'channelToken': channelToken,
    'logger': {
        info: function (message) {
            console.log(message);
        }
    }
});

(static) contentSDK.createPreviewClient(args) → {ContentPreviewClient}

Create a client content preview SDK object to interact with draft content in Oracle Content Management:
  • Authenticated connection to the Content Server.
  • Read content types.
  • Read draft content items.
  • Render draft content using named content layouts.
The content preview client SDK object uses the "/management/" Content REST API calls. This requires the user to be logged in to the system.
Parameters:
Name Type Description
args object A JavaScript object containing the parameters to create the content delivery client instance.
Properties
Name Type Attributes Default Description
contentServer string <optional>
'protocol://host:port' URL to the Oracle Content Management instance providing content. The default assumes the current 'protocol://host:port'.
contentVersion 'v1' | 'v1.1' <optional>
'v1.1' The version of the content delivery REST API to use.
channelToken string The Oracle Content Management instance token for accessing published content.
cacheBuster string <optional>
'' The URL parameter used to control whether or not content is fetched from the browser cache.
secureContent boolean <optional>
false Content is secured and requires sign-in to view.
authorization string <optional>
Authorization header to include in the request.
beforeSend function <optional>
Callback passing in the xhr (browser) or options (NodeJS) object before making the REST call.
timeout string <optional>
0 Timeout for the AJAX calls, defaults to no timeout.
logger object An object that implements the standard log functions: ['error', 'warn', 'info', 'debug', 'log'].
Returns:
Type
ContentPreviewClient
Example
// create a ContentPreviewClient and output logging 'info' messages to the console
var contentClient = contentSDK.createPreviewClient({
    'contentServer': contentServer,
    'channelToken': channelToken,
    'logger': {
        info: function (message) {
            console.log(message);
        }
    }
});