Resources

Integration: Drupal 7

This page describes the Acquia DAM connector for Drupal version 7.

The Media: Acquia DAM Drupal module provides bi-directional syncing of media between your Drupal 7-based website and Acquia DAM Classic.

This page covers the following topics:

Installing the connector module

To install the Acquia DAM connector, complete the following steps:

  1. Download the 7.x version of the Media: Acquia DAM. module.

  2. Install Media: Acquia DAM and Media: Acquia DAM Browser. For more information, see Install the module on your Drupal website.

  3. Sign in to Acquia DAM Classic.

  4. Create a dedicated background user and group for the routine syncing of metadata and to allow anonymous users to view assets in the asset viewer. Ensure that the dedicated group that you assign to your background user includes permissions for viewing and downloading the assets you plan to use with your Drupal website.

  5. Edit your Drupal settings.php file, and replace [username] and [password] with the username and password of the background user you created in the previous step:

    $conf['media_acquiadam_background_user'] = '[username]';
    $conf['media_acquiadam_background_pass'] = '[password]';
    

Important

Acquia recommends that you store your background user credentials in a file outside of a web accessible path. For more information, see Storing sensitive information outside of your codebase.

Configuring the connector module

  1. Sign in to your Drupal website as a user with Administrator permissions.

  2. In the top menu, click Configuration.

  3. In the Media section, click Media: Acquia DAM settings.

  4. In the Authentication tab, enter values for the following fields:

    • Client ID – Acquia DAM Classic client ID

    • Client Secret – Acquia DAM Classic client secret

    • Client mode – Select Mixed or Background only
      When set to Mixed, a user authenticates with Acquia DAM Classic when selecting and viewing assets in the asset viewer. When set to Background only, only assets accessible to the background user in Acquia DAM Classic will be available for viewing and downloading by Drupal users.

      Note

      If you do not have your Client ID or Client secret, contact your account manager.

  5. Click the Caching tab, and then enter values for the following fields:

    • Used lifetime – Duration, in minutes, to cache asset information in Drupal. Some asset information stores locally for performance reasons. Acquia recommends setting the timeout as high as allowable. A value of 0 disables caching.

    • Unused lifetime – Duration, in minutes, to cache asset information loaded while using the asset browser to improve performance. Acquia recommends a short timeout (five to 30 minutes) to avoid displaying outdated information to a user. A value of 0 will disable caching for unused assets.

  6. Click the Media tab, and then enter values for the following fields:

    • Mimetype adjustment – Override the handling of a file type with that of a different file type. For example, you may want Drupal to handle an eps file like a png file.

  7. Click the Media browser tab, and then enter values for the following fields:

    • Results per page – Number of assets, not including folders, displayed per page of results in the asset browser.

  8. Scroll to the bottom of the page, and then click Save configuration.

  9. Ensure you create cron jobs to periodically refresh data.

You can also configure the fields described previously using Drush:

Option

Value

Drush command

Client ID

Acquia DAM Classic client ID

drush vset media_acquiadam_client_id [CLIENT_ID]

Client Secret

Acquia DAM Classic client secret

drush vset media_acquiadam_client_secret [CLIENT_SECRET]

Client mode

Must be either mixed or background. Defaults to mixed.

drush vset media_acquiadam_client_mode [MODE]

Used lifetime

Defaults to 1440.

drush vset media_acquiadam_cache_expiration [MINUTES]

Unused lifetime

Defaults to 30.

drush vset media_acquiadam_unused_expiration [MINUTES]

Mimetype adjustment

Defaults to 25.

drush vset media_acquiadam_browser_per_page [NUMBER]

Results per page

Defaults to eps png.

drush vset media_acquiadam_extension_overrides [OVERRIDE]

Adding a Content type field

Complete the following steps to add a content type field for your chosen content type:

  1. Sign in to your Drupal website as a user with Administrator permissions.

  2. In the top menu, select Structure.

  3. Select Content types.

  4. From your content type row, select Manage fields from the Operations menu.

  5. For Add a new field, enter a label, such as DAM asset.

  6. Select Field type as File.

  7. Select Widget as Media browser.

  8. Select Save and then select Save field settings.

  9. Scroll to the Enabled browser plugins section and select Acquia DAM Asset at the bottom of the page.

  10. Add Allowed file extensions for uploaded files and enter the desired file extensions separated by spaces. For example, jpg gif png svg pdf.

  11. Select Save settings.

Assets

The Acquia DAM connector affects assets in the following circumstances and methods.

Asset thumbnails

The connector creates asset thumbnails in Drupal from Acquia DAM Classic. The maximum width or height is 1280 pixels. If the asset is a smaller dimension, a small thumbnail may be used. Deleting an asset in Acquia DAM Classic also deletes its thumbnail in Drupal.

Asset caching

For performance reasons, asset information (including name, thumbnail URLs, and expiration dates) are cached locally in Drupal. The asset cache is periodically refreshed by a cron job.

Note

The cache for the Acquia DAM connector is separate from the Drupal cache.

To clear the asset cache, complete the following steps:

  1. Sign in to your Drupal website as a user with Administrator permissions.

  2. In the top menu, click Configuration.

  3. In the Media section, click Media: Acquia DAM settings.

  4. In the Caching section, click Clear.

You can refresh the cache for an individual asset by viewing its entity page, and then clicking the Force refresh from Acquia DAM link.

Asset expiration

In Acquia DAM Classic, you can configure an expiration date for an asset. Upon expiration, the asset will no longer be usable in your Drupal website. There may be a delay between an asset expiring in Acquia DAM Classic and the Acquia DAM connector syncing that information with your Drupal website.

If an asset has expired in Acquia DAM Classic, but is still available in Drupal, you can force an update for the asset by viewing its entity page, and then clicking the Force refresh from Acquia DAM link.

Acquia recommends using an asset only in fields and embedded media items to ensure a consistent user experience when an asset expires.

Assets with unknown file types

If Drupal does not have a mimetype configured for an asset, it will display as an unknown type. To avoid unknown types, ensure that you configure your Drupal website with mimetypes for the assets that you intend to use.

Permissions

The Acquia DAM connector includes several permissions for managing what a user can do, including the following permissions:

Permission

Description

Administer Media: Acquia DAM

Allows the role to administer Acquia DAM Classic settings by using the configuration page. Only Drupal administrators should have this permission.

View Acquia DAM assets

Allows the role to view Acquia DAM Classic assets. For most websites, all roles should have this permission.

View expired Acquia DAM assets

Allows the role to access and edit expired assets in Drupal. This permission should be given to trusted roles only. The role will not be able to view the actual asset since that is controlled by Acquia DAM Classic.

View Acquia DAM links

Allows the role to view links that go to the asset in Acquia DAM Classic.

Access Media: Acquia DAM Browser

Allows the role access to the Media: Acquia DAM Classic asset browser. If the browser is configured to use Mixed mode, the user must still authenticate against Acquia DAM Classic.

Search behavior

The Acquia DAM connector uses Acquia DAM Classic for executing search queries. A query is affected by the permissions assigned to the user in Acquia DAM Classic running the search. When searching a folder, results in child folders are also returned.

Note

Search results differ based on the Client mode setting. If set to Background only, only fields to which the background user has permissions for in Acquia DAM Classic can be searched. If set to Mixed, only fields for which the user has permissions in Acquia DAM Classic can be searched.

When making changes to an asset’s metadata in Acquia DAM Classic, there may be a delay before a search query reflects the change.

Acquia Help

Filter by product:

Common questions

If you can't find what you're looking for, try refining your search or contact our Support teamfor further assistance.