Deployment Mappings

The following Deployment Handlers supports the deployment of resources from Cloud CMS to files or file system equivalents:

These Deployment Handlers all have the common function. They must work with content from Cloud CMS, consisting of Nodes, Associations, binary attachments and a potentially complex content graph of relationships. They must take that content and then map it down into a file system compatible representation consisting of files and folders.

Cloud CMS lets you use the f:deployment-config feature to precisely specify how your individual content instances and content of a given type will deploy through these handlers.
Using this feature, you can take advantage of templated file path calculations so that all of your content is handled in the same way.

Default Behaviors

If the f:deployment-config feature is not used, the aforementioned Deployment Handlers will deployment content with a default strategy.

For nodes -

  1. All nodes will be written to /{{_doc}}/node.json
  2. All node attachments will be written to /{{_doc}}/{{attachmentId}}.{{extension}}

For associations -

  1. All associations will be written to /{{_doc}}/association.json
  2. All association attachments will be written to /{{_doc}}/{{attachmentId}}.{{extension}}

Custom Behaviors

You can specify custom file system mappings using the f:deployment-config feature. These mappings are defined on the feature configuration itself.

Suppose you have a Node like this:

{
    "title": "The Adventures of Willy Beamish",
    "category": "software",
    "sku": "12345"
}

And you set up the following f:deployment-config feature on that node to look like this:

{
    "default": {
        "mappings": [{
            "type": "object-to-file",
            "config": {
                "filepath": "/{{object.category}}/{{object.sku}}/game.json"
            }
        }, {
           "type": "attachment-to-file",
           "config": {
               "attachmentId": "cover",
               "filepath": "/{{object.category}}/{{object.sku}}/cover.jpg"
           }
        }]
    }
}

When you deploy this content, the cover attachment (say, the cover art) for the node will be written to disk as:

/software/12345/cover.jpg
    

For more information on configuring this feature, please see read our documentation on the Deployment Configuration Feature.