# dotCMS

The source dotCMS connector allows content to be picked up from dotcms versions 5.2.7 to 5.3.3 to be picked up and transformed into motation.&#x20;

## Configuration walkthrough

{% embed url="<https://drive.google.com/file/d/1z5irC8B9G9EV4Lq_CYLG2jbmMq22W0K8/view?usp=sharing>" %}

## Specifics

The source dotCMS connector is able to sync both content and files.&#x20;

### Endpoint Config

When saving an endpoint for a dotCMS repository via REST instead of the UI you must use the following key:value pairs in the payload.&#x20;

* `contentRepo:dotcms`
* `contentRepoVersion:5.2.7`

### Unsupported

ONLY Content and Files are currently implemented. No other types are implemented yet.&#x20;

Permission will not sync.&#x20;

### Database support

Postgres and MS-SQL

## Adapter Properties

<table><thead><tr><th>Property</th><th width="454.3333333333333">Purpose</th><th>Required</th></tr></thead><tbody><tr><td>dbUser</td><td>The username used to connect to the dotCMS database</td><td>true</td></tr><tr><td>dbPassword</td><td>The password used to connect to the dotCMS database.</td><td>true</td></tr><tr><td>dbConnectionURL</td><td><p>The URL to connect to the dotCMS database.<br><br>The URL must complain the following format:<br><br>Postgres example: </p><pre><code>postgres://source-dotcms-db:5432/dotcms
</code></pre><p> MS-SQL example:</p><pre><code>sqlserver://source-dotcms-db:1433/dotcms
</code></pre></td><td>true</td></tr><tr><td>assetsPath</td><td>The full assets path to the assets folder in dotCMS</td><td>true</td></tr><tr><td>defaultLanguageCode</td><td>The default language code to use when no language code is found. </td><td>false</td></tr><tr><td>defaultCountryCode</td><td>The default country code to use when no country code is found. </td><td>false</td></tr><tr><td>defaultHostStructure</td><td>The default host structure to use when no host is found. </td><td>false</td></tr></tbody></table>

## Job Options

<table><thead><tr><th>Name</th><th>Data Type</th><th>Required</th><th>Default Value</th><th data-hidden></th></tr></thead><tbody><tr><td>path</td><td>Array</td><td>No</td><td>No Default Value</td><td></td></tr><tr><td>contentType</td><td>Array</td><td>No</td><td>No Default Value</td><td></td></tr><tr><td>dependenciesDepth</td><td>Integer</td><td>No</td><td>1</td><td></td></tr><tr><td>systemObjects</td><td>Boolean</td><td>No</td><td>false</td><td></td></tr><tr><td>contentDependencies</td><td>Boolean</td><td>No</td><td>false</td><td></td></tr></tbody></table>

### **Sending specific contentlets:**

Example1: Specifying the host name

\
Example2: Without a host name

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2FHgbDxPEDmfaA5G8Zc6WG%2Fimage.png?alt=media\&token=1ac10bae-b2fe-467c-bd52-4d7b5ba47e35)

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2F1a4OKAWzRTZDi1E9ryEA%2Fimage.png?alt=media\&token=331d9f63-1c38-4515-94db-5f038070de0c)

Where `content.ef67af58-c36b-4127-afb6-03928ad41673` is the asset name of the contentlet to sync in the identifier table and it lives in the root folder (parent path == /)

* If no **hostname** is provided the adapter will use the default host.
* The provided **hostname** needs to exist otherwise the adapter will fail (we need to fix this).\ <br>

### **Syncing File Assets to Destination**

Currently syncing file assets will sync to your destination but the set up can be different if your syncing just file assets from a folder to your destination for example,\
\
If no file assets are attached to a content type or you want to sync a file asset alone to your destination you can specify the path for impulse to pick it up and sync over, what is different is where you change the destination job properites. If you are syncing to Strapi Connector its simply the path to the media assets in strapi, this is the case for each connector. Please refer to each connector page for additonal info to set the correct config for the destination file assets sync

### **Using a folder to sync files under it**

Example1: Specifying the host name

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2FOUCnFWrkO719xd5PU71O%2Fimage.png?alt=media\&token=c1a19b04-b826-47ee-8828-23abca04d5eb)

Example2: Without a host name

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2F4PCLrPrWvqUBQZk8tswZ%2Fimage.png?alt=media\&token=80e8629e-63f6-45b4-a8ae-4187951ac6a6)

### **Using a content type to sync contentlets of the given Content Type type**

Note: only one content type is supported for syncing per job.&#x20;

Example: webPageContent

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2FOZFKP1zYC48CKIcmfDcJ%2Fimage.png?alt=media\&token=09665d2d-a7b8-41b4-9cb4-cf0a66707cc2)

### **Getting dependencies**

Dependencies in dotCMS are:

* Host related to the contents to sync
* Contents related by relationship fields
* When content is a dotCMS page: Contents related to the page
* When content is a dotCMS page and if the page templates uses Containers as files: The Container files
* When content is a dotCMS page: Theme files associated to the template of the page
* Images related to the contents to sync by Image fields
* Files related to the contents to sync by binary files

To sync the data of these contents and/or fields you will need to set the dependency depth to the appropriate level.&#x20;

Example: get dependencies 1 level deep<br>

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2F8yAHSQe9ftx0IDmZJ0AZ%2Fimage.png?alt=media\&token=74065190-57aa-45d7-8439-60b316087e7c)

This will get any related contents for a content to sync that is directly related to the content. Any content that has a relationship to the related content will not be picked up.

### **Presentation Layer**

The **Presentation Layer** objects are specific to the dotCMS system. They represent elements that are unique to the dotCMS system and cannot be synced to a different type of system. For example, it will work from dotCMS to dotCMS, does not make sense to try to sync **Presentation Layer** objects from dotCMS to Strapi as those elements are unique in dotCMS.

Elements deliver when the Presentation Layer is active in dotCMS are:

* Languages
* Containers
* Templates

To sync the data of these type of elements you will need to enable the **systemObjects** job option.

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2Fn8cOgucvcSMP9OOpEJ1v%2Fimage.png?alt=media\&token=2916efa2-f46e-43d2-a5af-8363139ce921)

{% hint style="info" %}
Note: It is recommended to use the **systemObjects** option always together with the **dependenciesDepth** option as most of the time, Presentation Layer elements depend on other contents, for example, a Template related to a dotCMS Page (that is sent when the Presentation Layer is active) needs of the Theme files associated to that Template, and those theme files will be sent as part of the content Dependencies. It is the same for the Containers, Containers are sent when the Presentation Layer is active but when sending Containers related to a dotCMS Page you will also like to have the Contents associated to that page using that Container.
{% endhint %}

## Motation Object Support

| Object       | Supported |
| ------------ | --------- |
| Category     | Yes       |
| Definition   | Yes       |
| Domain       | Yes       |
| Folder       | Yes       |
| Language     | Yes       |
| Relationship | Yes       |
| Tag          | Yes       |

## Content Mapper

Below are details on how to find the appropriate values to use in the content mapper.&#x20;

* `origin.uniqueId`&#x20;
  * Content type's velocity variable name
* `fields.origin.uniqueId`&#x20;
  * Field velocity variable name

## Troubleshooting
