External content stores

Hybrid assets store their content outside of Magnolia in external content stores. External content stores take care reading asset content when needed and writing asset content when a hybrid asset is created or updated.

External asset content stores don’t decide where the content of asset will be stored, the reference factory decides where the asset content will be stored when it generates the content storage URL for an asset.

You can create multiple extern content stores. You can configure your content stores to store some asset content and reject other asset content. This is done with the content storage URL; an external content store is allowed to decide if can store the asset content for a given content storage URL.

An external content store will have:

  • a name and description

  • credentials configuration -operational configuration

The configuration of an external asset content store is described below.

Selecting an external content store

Since you can define more than one external content stores, the Hybrid Assets module must choose one external content store to store the hybrid asset content.

Each content store has a check to if it can handle a storage URL:

boolean accepts(final String reference);

When the content of a hybrid asset needs to be read or written, the Hybrid Asset finds the first external content store that accepts the content storage URL and uses that content store to read or write the hybrid asset content.

Be careful when defining more than one content store that can handle the same storage URLs: changing the order of content store definitions could inadvertently make hybrid asset unavailable.

Configuring external content stores

External content stores are configured as part of the Hybrid Assets module. Content stores are configured at Configuration > /modules/hybrid-assets/config/stores.

S3 external content store

The Hybrid Assets module includes an S3 external content store, which also works with S3 compatible storage: info.magnolia.dam.hybrid.store.S3AssetStore.

Here are the configurable properties of a S3 external content store:

Property Description

class

required

Must be info.magnolia.dam.hybrid.store.S3AssetStore.

name

required

The name of the external content store.

description

optional

A brief description of the external content store.

referencePattern

required

A Java regular expression, the external content stores whose referencePattern match the storage URL of a hybrid asset may be used to content.

buffering

optional

The buffering policy when reading or writing content to S3. Valid values:

  • inMemory - content is buffered in memory (the default)

  • inTempFile - content is buffered in a temporary file

bufferSize

optional

The maximum buffer size in bytes. The default is 1048576 (1 megabyte).

refreshClient

optional

If true, create a new connection to S3 or compatible storage each time hybrid asset is read or written.

If false (the default), connections will be cached.

Setting refreshClient = true will slow down reading and writing of hybrid asset content.

clientTTLMillis

optional

The maximum time in milliseconds a cached S3 will be kept. Connections older than clientTTLMillis will be closed and a new connection will be created as needed.

The default value is 86400000 (24 hours).

Feedback

Incubators

×

Location

This widget lets you know where you are on the docs site.

You are currently perusing through the Hybrid Assets module docs.

Main doc sections

DX Core Headless PaaS Legacy Cloud Incubator modules