Newer Version Available
CMSConnectSource
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
CMSConnectSource components are available in API version 43.0 and later.
Special Access Rules
The CMS Connect org permission must be enabled.
Fields
| Field Name | Field Type | Description |
|---|---|---|
| cmsConnectAsset | CMSConnectAsset[] | Represents CSS or JavaScript defined for the connection.
|
| cmsConnectLanguage | CMSConnectLanguage[] | 0 to more. Represents language mappings defined for the connection. |
| cmsConnectPersonalization | CMSConnectPersonalization[] | 0 or 1. Represents personalization defined for the connection. Only for use when type is AEM. |
| cmsConnectResourceType | CMSConnectResourceType[] | 0–5. Represents JSON definitions defined for the connection. |
| connectionType | CMSSourceConnectionType(enumeration of type string) | Required. Type of authentication being used with outside system. Valid values are:
|
| cssScope | string | The class name used to prefix and scope the CSS rules. |
| developerName | string | Required. API name of the CMSConnectSource entity. |
| languageEnabled | string | Required. Valid values are:
|
| masterLabel | string | Required. Connection name |
| namedCredential | string | Required when the connectionType is Authenticated. API name of namedCredential. Before deploying namedCredential, it must exist on the destination org. |
| personalizationEnabled | string | Required. Valid values are:
|
| rootPath | string | Required. Root path. |
| sortOrder | int | Required. Defines the load order of the connection when multiple connections defined on page. The load order begins with 1. |
| status | CMSConnectionStatus(enumeration of type string) | Required. Status of connection. Valid values are:
|
| type | CMSConnectionSourceType(enumeration of type string) | Required. The identification of the source connection system. Valid values are:
|
| websiteUrl | string | Required if connectionType is Public |
CMSConnectAsset
CMSConnectAsset defines the location, types, and order of assets necessary to support the incoming content, such as JavaScript and CSS files.
| Field Name | Field Type | Description |
|---|---|---|
| assetPath | string | Relative path of the asset. |
| assetType | string |
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
|
| sortOrder | int | Loading sequence on the page. |
CMSConnectLanguage
CMSConnectLanguage components determine the presented language of the content.
| Field Name | Field Type | Description |
|---|---|---|
| cmsLanguage | string | When a language placeholder is in the URL path, this value is used to replace it. |
| language | string | Salesforce supported language.
For information see https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_translations.htm |
CMSConnectPersonalization
CMSConnectPersonalization is used only with Adobe Experience Manager (AEM).
| Field Name | Field Type | Description |
|---|---|---|
| connectorPage | string | The path to the JSP file that you created and installed in AEM. |
| connectorPageAsset | string | The path to your Javascript file. Providing this path allows you to run scripts dynamically. |
CMSConnectResourceType
CMSConnectResourceType is for use only to define JSON connections.
| Field Name | Field Type | Description |
|---|---|---|
| cmsConnectResourceDefinition | cmsConnectResourceDefinition[] | 0–10 allowed per CMSConnectResourceType. |
| developerName | string | API name of CMSConnectResourceType. |
| masterLabel | string | Content type name. |
| resourceType | string | The only allowed value is JSON. |
CMSConnectResourceDefinition
cmsConnectResourceDefinition is used to define JSON connections.
| Field Name | Field Type | Description |
|---|---|---|
| developerName | string | Required. API name of CMSConnectResourceDefinition. |
| masterLabel | string | Required. developerName of Content Item or Content List. |
| options | int | 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 | string | Required. The only valid value is JSON. |
| resourceIdPath | string | Relative path to ID. Required for Content Item. |
| resourceNamePath | string | Relative path to resource name. Required for Content Item. |
| resourcePath | string | Required. JSON resource path. |
| rootNodePath | string | Only for Content List and collection. Defines the initial starting path for a collection or list. |
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}&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
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
- The validation on a new connection totals only the elements in the incoming package.
- 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:
| Type | Description |
|---|---|
| CMSConnectSource |
|
| CMSConnectAsset |
|
| CMSConnectPersonalization | 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. |
| CMSConnectResourceType | If you find the developer name in the destination, then update the existing record with all details from the source. |
| CMSConnectResourceDefinition |
|
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.