External DAM module

Connector Pack DAM Connector Pack

License

MLA

Issues

EXTDAM

Maven site

external-dam

Latest

1.0.4

Latest

1.0.4

Module structure

artifactID Description

magnolia-external-dam-parent

Parent reactor.

magnolia-external-dam

Provides the foundation for integrating with S3 and Bynder and a sample component for using assets in the Pages app.

magnolia-external-dam-bynder

Provides a default implementation to connect to Bynder.

magnolia-external-dam-s3

Provides a default implementation to connect to Amazon S3.

Installing with Maven

Maven is the easiest way to install the module. Add the following to your bundle:

<dependency>
  <groupId>info.magnolia.external.dam</groupId>
  <artifactId>magnolia-external-dam</artifactId>
  <version>1.0.4</version>
</dependency>
<dependency>
  <groupId>info.magnolia.external.dam</groupId>
  <artifactId>magnolia-external-dam-bynder</artifactId>
  <version>1.0.4</version>
</dependency>
<dependency>
  <groupId>info.magnolia.external.dam</groupId>
  <artifactId>magnolia-external-dam-s3</artifactId>
  <version>1.0.4</version>
</dependency>

Connection configuration

This section explains how to configure the connection between the External DAM module and your external asset management solution. Essentially, you:

  • Provide connection credentials for your external solution.

  • Configure the cache if necessary.

You can create or edit the configuration in the JCR or the File System (YAML) under <module-name>/external-dams/<definition-name>.

Before you configure the connection, make sure you know:

  • Which solution you want to connect to. Default implementations are provided for:

    • AWS S3

    • Bynder

  • Connection credentials for your solution.

If you want to connect to another third-party tool, extend the Magnolia DAM API and create your own asset provider.

AWS S3 connection configuration

To use AWS S3 assets in Magnolia, you must have a working AWS account.

Credentials

You need AWS S3 credentials to connect your S3 buckets and display their content in Magnolia. Credentials consist of two parts:

  • AWS access key ID

  • AWS secret access key

Add these credentials to your Magnolia instance in the Password manager app. For example:

aws-credentials

image aws_access_key_id

image aws_secret_access_key

The magnolia-aws-foundation module handles all Amazon connections from Magnolia. This module is installed automatically by Maven when you install the External DAM module.

Configuring an AWS S3 bucket whitelist

By default, all the buckets in the S3 account you connect to are displayed. If you do not want to display all your buckets, you can configure a whitelist under /dam-s3/config.yaml using regex.

For example:

whitelistedBuckets:
- "^a.*"
- a-particular-bucket

Bynder connection configuration

To use Bynder assets in Magnolia, you must have a working Bynder account.

API token

You need a permanent OAuth 2.0 API token from Bynder to access the assets.

To generate a token, see this Bynder documentation: https://help.bynder.com/system/oauth2-permanent-tokens.htm.

You can use the token value directly in the yaml configuration or add the permanent token to your Magnolia instance in the Password manager app and reference the path in the configuration. For example:

bynder-credentials

image bynder_permanent_token

Connecting

Add your connection configuration under /dam-bynder/config.yaml.

bynderPortalURL: https://magnoliaintegration.getbynder.com
permanentToken: <client_secret_or_path_to_password_manager>
Connection properties
Property Description

bynderPortalURL

required

URL to your Bynder service.

permanentToken

required

A permanent OAuth 2.0 API token from Bynder or the path to the Passwords app where the token is stored.

Configuring the cache

This connector pack uses Caffeine, a high-performance Java cache library, to manage caching for external assets via a Magnolia helper module called magnolia-addon-commons-cache.

For Bynder and S3 caching, you can specify the behavior of the caches. Essentially, you can configure all the parameters available in CaffeineSpec. For example:

  • Set a maximum cache size.

  • Define how often the cache expires.

Additionally, you can:

  • Enable or disable the cache.

You configure caching through decoration under /<dam-connector>/decorations/addon-commons-cache/config.yaml.

Bynder default configuration

/dam-bynder/decorations/addon-commons-cache/config.yaml
cacheConfigurations:
  bynder:
    caches:
      bynder-media: maximumSize=500, expireAfterAccess=10m
      bynder-all: expireAfterAccess=60m
      bynder-size: expireAfterAccess=60m
    enabled: true

S3 default configuration

/dam-s3/decorations/addon-commons-cache/config.yaml

cacheConfigurations:
  s3:
    caches:
      s3-objects: maximumSize=500, expireAfterAccess=10m
      s3-buckets: expireAfterAccess=60m
    s3-count: maximumSize=500, expireAfterAccess=10m
    s3-pages: maximumSize=500, expireAfterAccess=10m

Cache configuration properties

Property Description

caches

required

Use CaffeineSpec properties to specify the cache behavior such as the maximum size of the cache and when cache entries expire for each cache.

<cacheName-2>: expireAfterAccess=60m

enabled

required, true by default

Set to false to disable caching.

Bynder loading times

Note that the Bynder API may be very slow in some regions. For example, one image upload may take up to 20 seconds in EU regions. This may cause some actions to fail in the Magnolia UI and the cache to be invalidated. For more information, see https://github.com/Bynder/bynder-js-sdk/issues/43.

Manually flushing the cache

If you want to flush the cache, you can either set the cache expiry to a very short time (see above) or configure a script in the Groovy app to flush the cache manually. For example:

import info.magnolia.objectfactory.Components

cacheManager = Components.getComponent(info.magnolia.addon.commons.cache.CacheManager)
cacheManager.evictCache("s3-objects")

Configuring pagination to improve response times

Magnolia retrieves pages of objects from Amazon S3 and Bynder and then obtains the assets you require from those pages. The pages are cached.

You can configure the size of a page of objects using the property pageSize.

Bynder has an additional property you can use if you set the page size to more than 1000 objects.

dam-<s3/Bynder>/config.yaml
pageSize: 100
Property Description

pageSize

optional

The maximum number of objects per request retrieved from your external system.

  • S3 default: 1000

  • Bynder default: 100

For S3, the minimum value possible is 100. The maximum is 1000.

bynderMaxNumberPerRequest

optional, default is 1000 (Bynder only)

Maximum number of objects that Bynder returns if you specify a pageSize greater than 1000.

See the Bynder documentation: https://bynder.docs.apiary.io/#reference/oauth-1.0a/retrieve-assets, limit parameter.

Bynder-specific configuration

This section provides instructions specific to configuring the Bynder connector. (See below for S3.)

Configuring the proxy service to protect private asset URLS

To protect the URLs of private Bynder assets rendered in Magnolia, you must use the proxy service provided.

The proxy service enforces security by generating a Magnolia URL that hides the private Bynder URL.

If you do not use the proxy service, private Bynder URLS are exposed in published Magnolia pages for example.

When using the proxy, if you want to make a Bynder asset public, for example an image asset used in the Pages app, you must publish the image as well as the page in Magnolia.

You can enable or disable the proxy service using the proxyMode parameter. The functionality is provided via the BynderAssetRenderer.

WARNING

The proxy service is only available with Magnolia 6.2.6. If you use an earlier version of Magnolia Core, you must disable the proxy service.

dam-bynder/decorations/dam/dam.config.yaml
providers:
  bynderProvider:
    identifier: bynder
    class: info.magnolia.external.dam.bynder.BynderAssetProvider
    renderers:
      bynder:
        class: info.magnolia.external.dam.bynder.BynderAssetRenderer
        proxyMode: true
        mediaTypes:
          audio: 'audio/*'
          application: 'application/*'
          video: 'video/*'
          image: 'image/*'
Property Description

proxyMode

optional, default is true

Enables or disables the proxy service.

  • When set to true, the proxy mode is enabled. The Bynder asset generates a Magnolia URL to hide the Bynder URL and the asset is served through the Magnolia instance.

  • When set to false, the proxy mode is disabled. The Bynder asset generates a Bynder URL and the asset is served directly by Bynder. Private Bynder URLs may be exposed.

AWS S3-specific configuration

This section provides instructions specific to configuring the S3 connector.

Configuring the maximum search time for S3

You can configure the maximum time Magnolia Periscope spends searching for S3 assets to be displayed in the Magnolia interface when a user searches for an asset in the Find Bar.

dam-s3/config.yaml
maxSearchTimeInMilis: 10000
Property Description

maxSearchTimeInMilis

optional

The maximum time Magnolia Periscope spends searching for S3 assets. By default, the maximum search time is 10 seconds.

For example: maxSearchTimeInMilis: 10000

Configuring presigned URLs to enable previewing for S3 assets

When you upload assets via Magnolia to S3, they are set to private by default. If you want to keep the preview functionality available, you must use presigned urls.

dam-s3/config.yaml
presignedSignatureDurationInMinutes: 60
Property Description

presignedSignatureDurationInMinutes

optional

Determines how long a presigned URL is valid.

We recommend that the duration is at least equal to the expiration of the caches set for s3-objects`, s3-pages and s3-count. Otherwise the presigned URL may be not valid while it is still cached.

For example: presignedSignatureDurationInMinutes: 60

Usage

The magnolia-external-dam submodule provides a sample Text and external image page component so that editors and marketers can select and use external assets in the Pages app. See DAM Connector Pack for an example.

Release history

External DAM module 1.0.4

Released on January 28, 2021.

This release brings full compatibility with Magnolia 6.2.6 and a number of improvements and bug fixes.

Proxy service to protect private asset URLS (Bynder)

To protect the URLs of private Bynder assets rendered in Magnolia, you must use the proxy service provided.

When using the proxy, if you want to make a Bynder asset public, for example an image asset used in the Pages app, you must publish the image as well as the page in Magnolia.

You can enable or disable the proxy service using the proxyMode parameter.

The proxy service is only available with Magnolia Core 6.2.6. If you use an earlier version of Magnolia Core, you must disable the proxy service.

See EXTDAM-160.

Publish S3 assets from within Magnolia

You can now publish S3 assets via the Magnolia UI. By default, all S3 assets are private.

If you want to use S3 assets on a public page, you must publish them to make them public.

See EXTDAM-63.

Enable previewing for S3 assets

When you upload assets via Magnolia to S3, they are set to private by default. If you want to keep the preview functionality available, you must use presigned urls.

See EXTDAM-157.

Folder paths for AWS S3

Your location in the S3 folder hierarchy is now displayed in the bottom left-hand corner of the asset browser.

See EXTDAM-190.

Bug fix: User sessions overlap when browsing S3 assets

When you have two or more users trying to browse assets in S3 the sessions can overlap each other. Users may enter the app in a folder opened by another user in another session instead of the top level folder.

See EXTDAM-210.

External DAM module 1.0.3

Released on December 1, 2020.

This release brings a number of improvements and bug fixes.

Bynder SDK 2.2.1

The Bynder SDK version has been reverted from 2.2.4 to 2.2.1.

This resolves the issue discovered in version External DAM 1.0.3 that blocks users from uploading assets to Bynder via Magnolia.

See EXTDAM-189.

Configuring pagination

You can now configure pagination to improve response times.

See EXTDAM-169.

Publish Bynder assets from within Magnolia

You can now publish Bynder assets via the Magnolia UI.

By default, all Bynder assets are private. If you want to use Bynder assets on a public page, you must publish them to make them public.

Once Bynder assets are marked as published they cannot be unpublished or made private again in Magnolia.

See EXTDAM-62.

External DAM module 1.0.2

Released on November 18, 2020.

This release brings compatibility for Magnolia 6.2.4 and a number of improvements and bug fixes.

We have discovered an issue with Bynder SDK version 2.2.4 and External DAM 1.0.2 that blocks users from uploading assets to Bynder via Magnolia.

Do not use this release if you are a Bynder connector user. External DAM 1.0.3 corrects the issue and will be released soon.

Improved handling of large numbers of S3 assets

Magnolia has improved how large numbers (thousands) of assets in a given S3 folder are rendered.

Magnolia has a specialized method that counts the total number of assets in your S3 system instead of creating the corresponding internal objects. Since S3 only allows batches of 1000 assets to be retrieved in a given call, we iterate as many API calls as necessary to retrieve the assets stored in S3.

For example, Magnolia must make 100 API calls to retrieve 100 000 assets. Depending on your internet bandwidth, cache and other factors, this could take around 1 minute to complete. For better response times, we recommend that you store a maximum of 10 000 assets per S3 bucket.

Configure the maximum search time for S3

You can configure the maximum time Magnolia Periscope spends searching for S3 assets to be displayed in the Magnolia interface using a new parameter called maxSearchTimeInMilis under dam-s3/config.yaml.

By default, the maximum search time is 10 seconds (maxSearchTimeInMilis: 10000).

See EXTDAM-184.

Mime types

If you upload an asset that does not have a suffix, Magnolia now infers the mime type from the binary.

To avoid extra API calls to S3, we recommend you include the suffix whenever possible.

See EXTDAM-126.

Bug fixes

See EXTDAM-167.

External DAM module 1.0.1

Released on June 22nd, 2020.

This release brings compatibility for Magnolia 6.2.1 and a number of minor improvements and bug fixes:

  • [EXTDAM-105] - (Bynder) Allow upload another image when editing

  • [EXTDAM-106] - (Bynder) Set the asset’s name with the name of the upload file

  • [EXTDAM-121 ] - Cache is not applied when browsing through app-chooser

  • [EXTDAM-119] - Adjust to Periscope changes in 6.2.1

  • [EXTDAM-104] - Show notification to the user when an async action started

  • [EXTDAM-108] - (Bynder) Correct notify message with apostrophe

  • [EXTDAM-112] - (Bynder) Edit asset fails with exception

  • [EXTDAM-113] - (Bynder) Changing the image is not reflected in the tree unless the name is updated

  • [EXTDAM-114] - Periscope search is case sensitive

  • [EXTDAM-115] - (S3) Double click on bucket or folder opens the editor

  • [EXTDAM-116] - (S3) Strange behaviour deleting a folder

  • [EXTDAM-120] - (Bynder) The item deletion does not happen immediately

External DAM module 1.0

Released on April 6, 2020.

Initial release of the DAM Connector Pack for integrating with Bynder and Amazon S3, so that you can use your assets directly in Magnolia.

See DAM Connector Pack for an overview of the functionality provided.

DAM Connector Pack compatibility

Module version Magnolia CMS version

1.0.4

6.2.6

1.0.3

6.2.4

1.0.2

6.2.4

1.0.1

6.2.1

1.0

6.2

A note about connector compatibilty

The third-party versions listed below are the versions Magnolia has developed and tested against. If you don’t see a particular version listed, it simply means that we do not routinely test on it. If you are using another version of the third-party tool and run into compatibility issues, please contact our Support team.

Module version Bynder SDK

1.0.4

Tested against 2.2.1

1.0

Tested against 2.2.0

Module version AWS Java SDK

1.0.1

2.13.25

1.0

Tested against 2.9.7

Feedback