Configure the DAM JCR submodule
The magnolia-dam-jcr submodule leverages the Java Content Repository (JCR) to store and manage digital assets.
DAM data is stored in the dam JCR workspace.
The submodule provides and configures info.magnolia.dam.jcr.JcrAssetProvider.
The magnolia-dam-imaging submodule is the link between magnolia-dam-jcr and the imaging module.
It provides and configures info.magnolia.dam.imaging.ImagingBasedAssetRenderer, which is info.magnolia.dam.api.AssetRenderer based on magnolia-dam-jcr.
For installation information, see DAM module.
Configuration
As mentioned above, the configuration for info.magnolia.dam.jcr.JcrAssetProvider and info.magnolia.dam.imaging.ImagingBasedAssetRenderer is set by their modules. The configuration looks like this:
| Node name | Value |
|---|---|
📁 dam |
|
📁 config |
|
⸬ contentDisposition |
|
⸬ providers |
|
⸬ jcrProvider |
|
⬩ class |
info.magnolia.dam.jcr.JcrAssetProvider |
⬩ identifier |
jcr |
📁 renderers |
|
⸬ imaging |
|
⬩ class |
info.magnolia.dam.imaging.ImagingBasedAssetRenderer |
⸬ renderers |
|
⸬ noOp |
|
⬩ class |
info.magnolia.dam.core.NoOpAssetRenderer |
NoOpAssetRenderer is configured by the Configure the DAM core submodule.
|
Configuring asset download
Decorate the dam.subApps.yaml file to customize certain properties of the asset download action like the ZIP file name and the maximum size limit when downloading multiple items.
Authors may download assets, folders, or a selection of both folders and assets from the Assets app.
actions:
download:
icon: icon-download
class: info.magnolia.dam.app.action.JcrAssetDownloadActionDefinition
availability: *notDeletedAvailability
downloadMultiple:
icon: icon-download
class: info.magnolia.dam.app.action.download.multiple.JcrMultipleAssetsDownloadActionDefinition
zipName: custom_file_name (1)
maxSizeInBytes: 1024 (2)
availability:
multiple: true
rules:
notDeleted: *notDeleted
| 1 | zipName is an optional property where you assign a default name to the ZIP file.
If unset, the batch of assets is downloaded as assets.zip. |
| 2 | maxSizeInBytes is an optional property.
You can set the maximum size limit of the downloaded ZIP file if needed to improve performance.
If this property isn’t added, there’s a 1GB default limit. |
Configuring a maximum size limit for uploads
You can change the default maximum size limit for uploading assets by decorating the dam.subApps.yaml in the Resource Files app.
actions:
uploadMultiple:
icon: icon-import
class: info.magnolia.dam.app.action.upload.bulk.JcrMultipleAssetsUploadActionDefinition
maxSizeInBytes: 104857600 (1)
availability: *notDeletedWritableRootAvailability
| 1 | Value maxSizeInBytes to suit your requirements. |
Restricting upload files by MIME type
You can restrict the MIME types of files allowed for upload using the allowedMimeTypePattern property.
| Property | Description |
|---|---|
|
optional, default is all types Comma-separated list of allowed MIME types. Examples include |
Since there are several locations where files may be uploaded by users, the configuration is also set in different files. We recommend you use the same restrictions.
-
Bulk upload dialog:
/dam-app-jcr/decorations/dam-assets-app/apps/dam.subApps.yamlactions: uploadMultiple: icon: icon-import class: info.magnolia.dam.app.action.upload.bulk.JcrMultipleAssetsUploadActionDefinition maxSizeInBytes: 104857600 allowedMimeTypePattern: image/jpg (1) availability: *notDeletedWritableRootAvailability1 In this example, only .jpg files are allowed when uploading. -
Single upload field in edit dialogs:
/dam-app-jcr/dialogs/uploadAndEdit.yamlform: properties: upload: factoryClass: info.magnolia.dam.app.field.factory.DamUploadFieldFactory class: info.magnolia.ui.editor.UploadViewDefinition field: class: info.magnolia.dam.app.field.DamUploadFieldDefinition maxUploadSize: 104857600 allowedMimeTypePattern: "image/*,application/pdf" (1)1 In this example, all image files and .pdf files are allowed when uploading.
Controlling ZIP creation thread pool
You can control how many background threads Magnolia uses to generate ZIP files when downloading multiple assets. Adjusting this setting can help improve performance or limit resource usage on busy systems.
Add the following property to your magnolia.properties file:
magnolia.dam.zip.pool-size=2
If this property isn’t set, Magnolia uses a default value based on available CPU cores.
The default is half the number of cores, with a minimum of 1.
| This setting applies globally to all asset ZIP operations, not per user or download. |