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.

enabled

required

Set to true.

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

Azure external content store

The Hybrid Assets module also supports to work with external Azure content storage: info.magnolia.dam.hybrid.store.AzureAssetStore.

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

Property Description

class

required

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

enabled

required

Set to true.

description

optional

A brief description of the external content store.

baseURL

required

Base URL to build connection string to REST API.

endpointSuffix

required

The endpoint suffix to Azure storage.

accountName

required

Azure account name.

container

required

Azure container name.

pageSize

required

Max results per request, default is 10.

plusHours

required

Expiration time for token when getting blob url, default value is 1 hour.

signedProtocol

required

The SAS can only be used over HTTPS, default value is 'https'.

serviceVersion

required

Specifies the version of the service.

signedPermissions

required

Grants read, write, delete, list, add, create, update, and process permissions.

signedStartTime

required

Signed start time.

signedExpiryTime

required

Signed expiry time.

signedResource

optional

Grants access to service, container, and object.

signedResourceTypes

optional

Grants access to service, container, and object.

signedServices

optional

Grants access to the Blob service.

requestParams

optional

More parameters that are optional and can be put in a dynamic requestParams configuration.

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