CMSConnectSource

Represents the connection information for external content management systems that feed content to Experience Builder sites.

Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

Important

For use with Change Sets, CMSConnectSource is a dependent of Network and Community.

Note

Parent Type 

This type extends Metadata and inherits its fields.

File Suffix and Directory Location 

CMSConnectSource components have the suffix .cmsConnectSource and are stored in the cmsConnectSource folder. In that folder, separate files exist for each network (for example, networkname.sourcedevelopername.cmsConnectSource). Each file represents a CMS connection.

Version 

Introduced in API version 43.0.

Special Access Rules 

The CMS Connect org permission must be enabled.

Fields 

cmsConnectAsset 

  • Type: CMSConnectAsset[]

  • Required: No

  • Description: Represents CSS or JavaScript defined for the connection.

    • 0–10 for CSS
    • 0–10 for JavaScript

cmsConnectLanguage 

  • Type: CMSConnectLanguage[]
  • Required: No
  • Description: 0 to more. Represents language mappings defined for the connection.

cmsConnectPersonalization 

  • Type: CMSConnectPersonalization
  • Required: No
  • Description: 0 or 1. Represents personalization defined for the connection. Only for use when type is AEM.

cmsConnectResourceType 

  • Type: CMSConnectResourceType[]
  • Required: No
  • Description: 0–5. Represents JSON definitions defined for the connection.

connectionType 

  • Type: CMSSourceConnectionType (enumeration of type string)
  • Required: Yes
  • Description: Required. Type of authentication being used with outside system.
  • Possible values:
    • Public
    • Authenticated

cssScope 

  • Type: string
  • Required: No
  • Description: The class name used to prefix and scope the CSS rules.

developerName 

  • Type: string
  • Required: Yes
  • Description: Required. API name of the CMSConnectSource entity.

languageEnabled 

  • Type: string (enumeration of type string)
  • Required: No
  • Description: Required.
  • Possible values:
    • Y — to enable language mapping for connection.
    • N — if no language mapping is needed.

masterLabel 

  • Type: string
  • Required: Yes
  • Description: Required. Connection name

namedCredential 

  • Type: string
  • Required: No
  • Description: Required when the connectionType is Authenticated. API name of namedCredential. Before deploying namedCredential, it must exist on the destination org.

personalizationEnabled 

  • Type: string

  • Required: No

  • Description: Required. Valid values are:

    • Y to enable personalization mapping for connection.
    • Otherwise N.

rootPath 

  • Type: string
  • Required: No
  • Description: Required. Root path.

sortOrder 

  • Type: int
  • Required: Yes
  • Description: Required. Defines the load order of the connection when multiple connections defined on page. The load order begins with 1.

status 

  • Type: CMSConnectionStatus (enumeration of type string)
  • Required: Yes
  • Description: Required. Status of connection.
  • Possible values:
    • ACTIVE
    • INACTIVE

type 

  • Type: CMSConnectionSourceType (enumeration of type string)
  • Required: Yes
  • Description: Required. The identification of the source connection system.
  • Possible values:
    • AEM
    • Drupal
    • WordPress
    • SDL
    • Sitecore
    • Other

websiteUrl 

  • Type: string
  • Required: No
  • Description: Required if connectionType is Public

CMSConnectAsset Type 

CMSConnectAsset defines the location, types, and order of assets necessary to support the incoming content, such as JavaScript and CSS files.

Because there can be existing connections when a package comes in, there’s some INSERT or UPDATE logic to consider:

  • If assetPath exists in the destination, then update the existing record, else the new assetPath is inserted.
  • Always keep the sortOrder from the source and adjust the destination accordingly.

Note

Because there can be existing connections when a package comes in, there’s some INSERT or UPDATE logic to consider: If assetPath exists in the destination, then update the existing record, else the new assetPath is inserted. Always keep the sortOrder from the source and adjust the destination accordingly.

Note

Fields 

assetPath 

  • Type: string
  • Required: Yes
  • Description: Relative path of the asset.

assetType 

  • Type: string (enumeration of type string)

  • Required: Yes

  • Description: When used in Apex, this value can be sent as an enum, otherwise, this field has a type of string.

    Allowed values as string

    Allowed values as enum

  • Possible values:

    • CSS
    • Javascript

sortOrder 

  • Type: int
  • Required: Yes
  • Description: Loading sequence on the page.

CMSConnectLanguage Type 

CMSConnectLanguage components determine the presented language of the content.

Fields 

cmsLanguage 

  • Type: string
  • Required: Yes
  • Description: When a language placeholder is in the URL path, this value is used to replace it.

language 

  • Type: string

  • Required: Yes

  • Description: Salesforce supported language.

    For information see Meta translations

CMSConnectPersonalization Type 

CMSConnectPersonalization is used only with Adobe Experience Manager (AEM).

Because there can be existing connections when a package comes in, there’s some INSERT or UPDATE logic to consider. If personalization isn’t enabled in the source system, but is enabled in the destination, the destination is disabled. The record for the connection is deleted from the table.

Note

Because there can be existing connections when a package comes in, there’s some INSERT or UPDATE logic to consider. If personalization isn’t enabled in the source system, but is enabled in the destination, the destination is disabled. The record for the connection is deleted from the table.

Note

Fields 

connectorPage 

  • Type: string
  • Required: Yes
  • Description: The path to the JSP file that you created and installed in AEM.

connectorPageAsset 

  • Type: string
  • Required: Yes
  • Description: The path to your Javascript file. Providing this path allows you to run scripts dynamically.

CMSConnectResourceDefinition Type 

cmsConnectResourceDefinition is used to define JSON connections.

Because there can be existing connections when a package comes in, there’s some INSERT or UPDATE logic to consider:

  • If you find developerName in the destination, then the existing record is updated with all details from the new source, else the new value is inserted.
  • If the current source is DETAIL and the destination has DETAIL with a different name, then the destination is updated to LIST and the source is inserted as DETAIL.

Note

Because there can be existing connections when a package comes in, there’s some INSERT or UPDATE logic to consider: If you find developerName in the destination, then the existing record is updated with all details from the new source, else the new value is inserted. If the current source is DETAIL and the destination has DETAIL with a different name, then the destination is updated to LIST and the source is inserted as DETAIL.

Note

Fields 

developerName 

  • Type: string
  • Required: Yes
  • Description: Required. API name of CMSConnectResourceDefinition.

masterLabel 

  • Type: string
  • Required: Yes
  • Description: Required. developerName of Content Item or Content List.

options 

  • Type: int

  • Required: Yes

  • Description: Required. Identifies whether the content from the external source is a single item or a list.

    0 for Content List

    1 for Content Item

payloadType 

  • Type: string
  • Required: Yes
  • Description: Required. The only valid value is JSON.

resourceIdPath 

  • Type: string
  • Required: No
  • Description: Relative path to ID. Required for Content Item.

resourceNamePath 

  • Type: string
  • Required: No
  • Description: Relative path to resource name. Required for Content Item.

resourcePath 

  • Type: string
  • Required: Yes
  • Description: Required. JSON resource path.

rootNodePath 

  • Type: string
  • Required: No
  • Description: Only for Content List and collection. Defines the initial starting path for a collection or list.

CMSConnectResourceType Type 

CMSConnectResourceType is for use only to define JSON connections.

Because there can be existing connections when a package comes in, there’s some INSERT or UPDATE logic to consider. If you find the developer name in the destination, then update the existing record with all details from the source.

Note

Because there can be existing connections when a package comes in, there’s some INSERT or UPDATE logic to consider. If you find the developer name in the destination, then update the existing record with all details from the source.

Note

Fields 

cmsConnectResourceDefinition 

developerName 

  • Type: string
  • Required: Yes
  • Description: API name of CMSConnectResourceType.

masterLabel 

  • Type: string
  • Required: Yes
  • Description: Content type name.

resourceType 

  • Type: string
  • Required: Yes
  • Description: The only allowed value is JSON.

Declarative Metadata Sample Definition 

The following is an example of a CMSConnectSource definition.

1<?xml version="1.0" encoding="UTF-8"?>
2<CMSConnectSource xmlns="http://soap.sforce.com/2006/04/metadata">
3    <cmsConnectAsset>
4        <assetPath>etc/designs/capricorn/app-prefixed.min.css</assetPath>
5        <assetType>CSS</assetType>
6        <sortOrder>1</sortOrder>
7    </cmsConnectAsset>
8    <cmsConnectAsset>
9        <assetPath>etc/designs/capricorn/w3data.js</assetPath>
10        <assetType>Javascript</assetType>
11        <sortOrder>1</sortOrder>
12    </cmsConnectAsset>
13    <cmsConnectLanguage>
14        <cmsLanguage>en</cmsLanguage>
15        <language>en_US</language>
16    </cmsConnectLanguage>
17    <cmsConnectLanguage>
18        <cmsLanguage>fr</cmsLanguage>
19        <language>fr</language>
20    </cmsConnectLanguage>
21    <cmsConnectPersonalization>
22        <connectorPage>content/salesforceConnector.js</connectorPage>
23        <connectorPageAsset>content/js/capricorn/assets.js</connectorPageAsset>
24    </cmsConnectPersonalization>
25    <cmsConnectResourceType>
26        <cmsConnectResourceDefinition>
27            <developerName>Details</developerName>
28            <masterLabel>Details</masterLabel>
29            <options>0</options>
30            <payloadType>JSON</payloadType>
31            <resourceIdPath>ID</resourceIdPath>
32            <resourceNamePath>title</resourceNamePath>
33            <resourcePath>rest/v1.1/sites/cmstry.wordpress.com/posts/{component}</resourcePath>
34        </cmsConnectResourceDefinition>
35        <cmsConnectResourceDefinition>
36            <developerName>List</developerName>
37            <masterLabel>List</masterLabel>
38            <options>1</options>
39            <payloadType>JSON</payloadType>
40            <resourcePath>rest/v1.1/sites/cmstry.blog.wordpress.com/posts?number={itemsPerPage}&amp;page={pageNumber}</resourcePath>
41        </cmsConnectResourceDefinition>
42        <developerName>Posts</developerName>
43        <masterLabel>Posts</masterLabel>
44        <resourceType>JSON</resourceType>
45    </cmsConnectResourceType>
46    <connectionType>Public</connectionType>
47    <cssScope>capricorn</cssScope>
48    <developerName>Capricorn</developerName>
49    <languageEnabled>Y</languageEnabled>
50    <masterLabel>Capricorn</masterLabel>
51    <personalizationEnabled>Y</personalizationEnabled>
52    <rootPath>content/capricorn/{language}</rootPath>
53    <sortOrder>11</sortOrder>
54    <status>ACTIVE</status>
55    <type>AEM</type>
56    <websiteUrl>https://public-api.wordpress.com</websiteUrl>
57</CMSConnectSource>

The following is an example package.xml.

1<Package xmlns="http://soap.sforce.com/2006/04/metadata">
2    <types>
3        <members>NetworkA.*</members>
4        <name>CMSConnectSource</name>
5    </types>
6    <version>43.0</version>
7</Package>

To retrieve a specific connection:

1<Package xmlns="http://soap.sforce.com/2006/04/metadata">
2    <types>
3        <members>NetworkA.DeveloperName</members>
4        <name>CMSConnectSource</name>
5    </types>
6    <version>43.0</version>
7</Package>

Usage 

The INSERT or UPDATE logic for the incoming information is always UPSERT. If data isn’t in the entity, then it’s inserted, otherwise the current data is updated.

Before doing upsert, the content from the package is validated against the maximum limits for the following:

  • CSS assets <= 10
  • JavaScript assets <= 10
  • Resource types < =5
  • Resource definitions for each type <=10

For example

  1. The validation on a new connection totals only the elements in the incoming package.
  2. Validation of existing connections totals the existing assets and new elements to assess validity. For example, if a connection on the destination org already has six CSS definitions, and the incoming package has defined seven CSS definitions (four new + three existing), the new total is the six current from the database. The total ignores the three repeated in the package and adds four new definitions from the incoming package. This totals 10 definitions, which number is at or below the 10 asset threshold, and it passes validation.

Refer to the following content for more details for how each entity how is handled while saving the details from package to destination org:

TypeDescription
CMSConnectSource
  • If you find developerName in the destination, then update the existing collection with all details form source.
  • namedCredential is handled through developerName. If you don’t find namedCredential with developerName, then an error is generated.
  • If the destination isn’t sortOrder from the source, then insert or update with the source sortOrder.
  • If sortOrder from the source is already in the destination, then increase the source sortOrder by 1 for connections such that the destination sortOrder > sortOrder from the source.
CMSConnectAsset
  • If assetPath exists in the destination, then update the existing record, else the new assetPath is inserted.
  • Always keep the sortOrder from the source and adjust the destination accordingly.
CMSConnectPersonalizationIf personalization isn’t enabled in the source system, but is enabled in the destination, the destination is disabled. The record for the connection is deleted from the table.
CMSConnectResourceTypeIf you find the developer name in the destination, then update the existing record with all details from the source.
CMSConnectResourceDefinition
  • If you find developerName in the destination, then the existing record is updated with all details from the new source, else the new value is inserted.
  • If the current source is DETAIL and the destination has DETAIL with a different name, then the destination is updated to LIST and the source is inserted as DETAIL.

Wildcard Support in the Manifest File 

This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.