Deploying DAM

Developers perform this task.

The following steps are required to deploy the DAM plugin: installing third-party converters, installing the DAM plugin, and implementing the plugin in the data model.

Step 1: Installing Third-Party Converters

DAM supports the following third-party converters:

These converters provide output to a wide variety of formats. Install these plugins as required on your operating system.

Step 2: Installing Converters into DAM

This section explains how to install the third-party converters into DAM.

  1. In a text editor or IDE, open the file <root>/pom.xml.

  2. Under the <dependencies> element, add the <dependency> element for your converter:

    <!-- DocRaptor -->
    <!-- Pandoc -->
    <!-- TwelveMonkeys -->
  3. Rerun the Maven build.

Step 3: Implementing Download Capability for Data Model

This section explains how to implement the download capability for a specific data model.

  1. In a text editor or IDE, open the Java class representing the data model. (Following the Brightspot best practice, this file is in the directory <root>/src/main/java/content/<name>/.

  2. Add the plugin’s import statements and modify the class declaration as in the following example:

    import com.psddev.dam.DocumentDownloadable;
    import com.psddev.dam.DocumentDownloadOptions;
    //Other imports
    @ViewBinding(value = ArticleViewModel.class, types = DocumentDownloadOptions.VIEW_TYPE)
    public class Article extends Content implements DocumentDownloadable {
    // Code...
  3. Build the project.

In the previous snippet—

  • Lines 1–2 import the libraries containing the download functionality and the various file format options.
  • Line 5 specifies that the view model associated with the model includes the download options.
  • Line 6 implements the DocumentDownloadable interface with this model, thereby enabling the download functionality.

Users can now see the Download button a) when editing an asset of the indicated type or b) when editing collections containing assets of that type. For example, if you implemented the DocumentDownloadable interface on classes of type Article

  • When users edit articles, they can use the Download button to download the article in one of the available formats.
  • When users open a collection, and the collection contains articles, they can use the Download button to the download the articles in one of the available formats.