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

Step 2: Installing converters into DAM

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

To install 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 -->
    <dependency>
       <groupId>com.psddev</groupId>
       <artifactId>dam-docraptor</artifactId>
       <version>1.1-SNAPSHOT</version>
    </dependency>
    
    <!-- Pandoc -->
    <dependency>
        <groupId>com.psddev</groupId>
        <artifactId>dam-pandoc</artifactId>
        <version>1.1-SNAPSHOT</version>
    </dependency>
    
    <!-- TwelveMonkeys -->
    <dependency>
       <groupId>com.psddev</groupId>
       <artifactId>dam-twelvemonkeys</artifactId>
       <version>1.1-SNAPSHOT</version>
    </dependency>
    
  3. Rerun the Maven build.

Step 3: Implementing download capability for a content type

To enable downloading for a content type:

  1. In a text editor or IDE, open the Java class representing the content type.

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

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    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.

Editors 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 editors 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.