Hybrid Assets module
Edition |
Incubator (services) |
||
Issues |
|||
Git |
|||
Latest |
2.1.2
|
The Hybrid Assets module lets you store your asset metadata in the Configure the DAM JCR submodule, but store the actual asset content outside of Magnolia in an external content store.
Hybrid assets are suited to:
-
Very large assets, such as video or large images, that may not be easily stored in the JCR DAM
-
Storing asset content outside of Magnolia in a repository that may not fully support asset metadata, such as the Amazon S3 Connector module
-
External storage that cannot support the full DAM API
-
Acting as a federated DAM with all asset entities and their metadata stored in one place while asset content is spread over storage locations and sources, including the Magnolia JCR DAM itself
The Hybrid Assets module can transfer asset content between several external storage locations and the Magnolia JCR DAM and import assets from external storage into the JCR DAM.
|
Installing with Maven
Maven is the easiest way to install the module. Add the following to your bundle:
<dependency>
<groupId>info.magnolia.assets</groupId>
<artifactId>magnolia-hybrid-assets-app</artifactId>
<version>2.1.2</version>
</dependency>
Basic functions:
-
create
-
edit
-
delete
<dependency>
<groupId>info.magnolia.assets</groupId>
<artifactId>magnolia-hybrid-assets-advanced</artifactId>
<version>2.1.2</version>
</dependency>
Advanced functions:
Function | Description |
---|---|
Link external content |
You can navigate external content via a chooser dialog. When selecting an asset, the system creates a hybrid asset and includes a reference link to the external content. |
Unlink external content |
The asset from the external content storage is completely deleted. The content is stored back into the Magnolia JCR DAM. The asset is no longer classified as a hybrid asset. |
Export content |
Transfer content from an existing asset in Magnolia JCR DAM to a specified location in an external content store. |
Refresh external content |
Updates hybrid asset to force any stored images (like thumbnails) to be updated. This is particularly useful when the linked external content has been updated. |
<dependency>
<groupId>info.magnolia.assets</groupId>
<artifactId>magnolia-hybrid-assets-img-recognition</artifactId>
<version>2.1.2</version>
</dependency>
This module is deprecated if using the core image-recognition module 1.2.6 +.
|
<dependency>
<groupId>info.magnolia.assets</groupId>
<artifactId>magnolia-hybrid-assets</artifactId>
<version>1.0</version>
</dependency>
Usage
Extensions to the Assets app
The Hybrid Asset module adds workbench actions to the Assets app:
Function | Description |
---|---|
Link external content |
You can navigate external content via a chooser dialog. When selecting an asset, the system creates a hybrid asset and includes a reference link to the external content. |
Unlink external content |
The asset from the external content storage is completely deleted. The content is stored back into the Magnolia JCR DAM. The asset is no longer classified as a hybrid asset. |
Export content |
Transfer content from an existing asset in Magnolia JCR DAM to a specified location in an external content store. |
Refresh external content |
Updates hybrid asset to force any stored images (like thumbnails) to be updated. This is particularly useful when the linked external content has been updated. |
Linking to external content
The Hybrid Assets module can do more than just exporting asset content outside of Magnolia. It can also browse to storage outside of Magnolia and create hybrid assets from external content. We currently support to link content from Extended S3 connector and External Azure storage.
Hybrid assets under the hood
Storing asset content outside of Magnolia with hybrid assets is controlled by two configurable components: the reference factory and one or more external content stores. The reference factory determines where the content for an asset will be stored and the content stores handle the storing and retrieving of content outside of Magnolia.
Reference factory
The hybrid asset reference factory determines where the content of a hybrid asset will be stored. The reference factory can choose different locations for the content of an asset based on:
-
the JCR workspace of the asset
-
the path of the asset
-
the value of an asset property
-
the mime type of an asset
You can define multiple "mappings" in the reference factory. Each mapping defines a template for the destination of the asset content and voters that will determine if the mapping will be used to generate the destination of the content for a given asset
See External reference factory for more on configuring the reference factory and mappings. |
External content stores
External content stores simply store asset content outside of Magnolia and allows hybrid assets to read and write their content. You define external content stores as part of your Hybrid Asset module configuration.
An external content must be configured with:
-
access credentials for the external store
-
specify what content the content store will read and write
See External content stores for more on configuring the content stores. |
Image recognition
AWS has a size limitation for the image recognition service, in order to send big files to this service, the image recognition for hybrid assets provides a default configurable variation to resize the images over 5MB before sending them to the service. This value can be overridden decorating the module configuration with a new value, resizeWidth: 1024
.
You can disable image recognition by setting in the configuration enabled: false
and set a max size value to prevent the procesing of big images maxSize: 5000000
.
damLinkField
with Hybrid assets
To properly display asset information on the form when using damLinkField with a Hybrid asset, the class info.magnolia.dam.hybrid.field.HybridItemPreviewComponent
should be included in the YAML configuration.
form:
properties:
image:
$type: damLinkField
preview:
class: info.magnolia.ui.editor.ItemPreviewDefinition
implementationClass: info.magnolia.dam.hybrid.field.HybridItemPreviewComponent
Versioning with S3 asset
Hybrid assets let you effectively manage assets with versioning in Amazon S3. To enable versioning, you must configure the specific S3 bucket where your assets are stored. This allows you to keep track of all versions of your assets, enabling easy retrieval and management of previous versions.
Versioning with Azure asset
Hybrid assets let you effectively manage assets with versioning in Azure Blob Storage. You first need to enable versioning in the specific Azure container where your assets are stored.
External Domain
This configuration allows to stream data directly form the external store. This is a preview feature that depends on the fastly-proxy module.
-
useExternalLinks
: false -
useExternalLinksInAuthor
: false -
externalDomain
: https://domain.com
PDF and Video preview
In order to view the PDF/Video preview on the action bar, set the value to true in your hybrid-assets/config.yaml
file:
-
displayPdfAndVideoPreview
: true
Upload assets
You can upload assets individually or in bulk.
-
Select a parent folder to upload the asset. If no folder is selected, the asset uploads at the root level.
-
Click Upload assets.
-
Select files to upload.
The upload size limit is 100MB, regardless of the number of assets you want to upload. To change the limit, see Configuring asset upload. |