> For the complete documentation index, see [llms.txt](https://motivlabs.gitbook.io/impulse-user-manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://motivlabs.gitbook.io/impulse-user-manual/connectors/destination-connectors/dotcms.md).

# dotCMS

The destination dotCMS connector allows content to transformed from motation and be synced to dotCMS versions 5.2.7 to 5.3.3&#x20;

## Specifics

The destination 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`

### Additional Plugins

#### Cache Buster

With the way that the dotCMS cache and reindexer works, occasionally when updating a piece of content, the reindexer is unable to complete its job because the cache is not up to date. The solution is to clear the appropriate caches so that the reindexer is able to index the content. The cache buster plugin works in tandem with the destination dotCMS connector to clear the identifier and contentlet caches.

The destination dotCMS connector creates files in the dotCMS assets folder at the paths

```
motiv-adapter/buster/identifiercache and motiv-adapter/buster/contentletcache
```

The cache buster scans for those files along those paths and removes the content from the appropriate cache. This allows the reindex process to finish and reindex the updated content.

### Unsupported

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

Permission will not sync.&#x20;

If a structure is being synced and saved to a host that does not exist prior to the sync transaction the structure will not be synced. This can be solved by manually creating the site/host record in the identifier with the problematic ID. In addition setting the `defaultHostStructure` property should help avoid this situation.&#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></p><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>true</td></tr><tr><td>defaultCountryCode</td><td>The default country code to use when no country code is found. </td><td>true</td></tr><tr><td>defaultHostStructure</td><td>The id of the default host content type to sync content to when the host does not exist.</td><td>true</td></tr></tbody></table>

## Job Options

<table><thead><tr><th>Name</th><th>Description</th><th>Data Type</th><th>Required</th><th>Default Value</th><th data-hidden></th></tr></thead><tbody><tr><td>path</td><td></td><td>Array</td><td>No</td><td>No Default Value</td><td></td></tr><tr><td>contentType</td><td></td><td>Array</td><td>No</td><td>No Default Value</td><td></td></tr><tr><td>location.site</td><td>Overwrite the site to save files to.</td><td>Text</td><td>No</td><td>No Default Value</td><td></td></tr><tr><td>location.path</td><td>Overwrite the path to save files to. </td><td>Text</td><td>No</td><td>No Default Value</td><td></td></tr></tbody></table>

### *path* and *contentType* Job Options

The *path* and *contentType* Job Options are used to search for contents that match the options criteria, the returned contents are used to compare against the source endpoint contents to define what needs to be synced to this destination connector.

#### **Requesting specific contentlets:**

Example1: Specifying the host name

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2FLMxhmZHBpxYA9uUYFeRo%2Fimage.png?alt=media\&token=31066729-19c6-4e9c-a982-2d8128063fa5)

Example2: Without a host name

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2FyStsfrTosrugoPxUoYCa%2Fimage.png?alt=media\&token=8c1ce155-237a-4566-a89e-0c2e08b38d97)

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).

#### **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%2FRl514xtUGhvKbIYuKnrM%2Fimage.png?alt=media\&token=0b9490a2-e960-428d-a98e-40893cc548f2)

Example2: Without a host name

![](https://651785290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLYwCtfZtrK4s43AVzb4%2Fuploads%2FzfrPzyRlfIMCwFbHgIAi%2Fimage.png?alt=media\&token=e5c0e5df-9f52-4435-9fab-7d08986306b6)

#### **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%2F2y2UnTXxf7bNj8V5fX6x%2Fimage.png?alt=media\&token=7e106d5a-2b03-4af5-8774-71dfee58e751)

### **Locations:**

The Adapter Write supports the concept of locations, locations allow you to override the location of the synced content and support two properties: location.site and location.path, both properties are optional.

Examples:\
**`"endpoints": [ { "id": "2e96da36-60a6-4937-9457-7b682aa546dc", "type": "destination", "detail": "location.site:demo.dotcms.com,location.path:/new/path/" } ]`**

{% hint style="info" %}
**The location properties will only work on the destination instance.**
{% endhint %}

### **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 from a **source dotCMS endpoint**.

![](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;

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

## Troubleshooting
