DAM core module
The DAM core module is a Magnolia Maven module.
Maven is the easiest way to install the module. Add the following to your bundle:
<dependency> <groupId>info.magnolia.dam</groupId> <artifactId>magnolia-dam-core</artifactId> <version>3.0.5</version> </dependency>
In order to have a working DAM you must have configured at least:
To enable DAM at least one AssetProvider must be configured as subnode
A class which must implement AssetProvider.
The identifier of the asset provider. Must be unique within all asset providers.
AssetRenderer objects can be configured:
or per AssetProvider.
When an asset rendition is requested,
AssetProviderRegistry#getRendererFor(Asset asset, MediaType to) first
is looking for a provider specific renderer but will fallback to the
globally defined renderer if no specific can be found.
The example configuration above has 2 renderers defined:
renderers/imagingconfigures a renderer for images specifically for the asset provider
renderers/noOpis a global fallback if a provider lacks a renderer for the requested media type.
NoOpAssetRenderer which can be
used to define global AssetRenderer. Per default, NoOpAssetRenderer does
only wrap the original Asset.
NoOpAssetRenderer is registered by
magnolia-dam-core is not taking care about the used AssetProvider implementation.
Specific asset provider and renderer should rather be configured from a module which contains a specific implementation but not from magnolia-dam-core itself.
Please read Magnolia dam JCR implementation configuration to get a complete example of a specific configuration.
Assetis found, an error is sent to the response.
Assetis found, the response header is set and the asset binary is put in the response.
The servlet is backwards compatible and maps static UUIDs to the new DAM format.
DamDownloadServlet is registered in the
Content-disposition is a
If the Content-disposition field is set in a HTTP response header, the
browser opens the
save file as dialog instead of rendering the
Per default, DamDownloadServlet serves assets with set
Content-Disposition header. However, it is possible to define
exceptions to omit the content disposition header.
DAM standard configuration already defines 2 exceptions based on mime type:
To disable the Content-Disposition header for other content types, add
their MIME types to
Nodes and properties:
contentDisposition: Defines content disposition header exceptions.
contentType: Arbitrary node name
rejected: Content map of MIME types for which content disposition headers are not served.
class: ResponseContentTypeVoter is a voter that checks the content type set on the response object against a list of allowed and/or rejected content types. It is typed to Object, as it can vote on both a passed
HttpServletRequest, or the current
MgnlContext.webContext, if any.
class: VoterSet supports a set of voters. The voting can be set, as well the returned level. If the level is not set (0) the votings result is returned.
To disable serving
Content-Disposition headers based on path:
Create a new node
Under the new content node, create three property nodes:
classand set the value to
notand set the value to
patternand set the value to
contentDispositionnode add an
opproperty and set the value to
and. This acts as an operator between voters and is only necessary if there you have more than one voter in the set.
This will configure all files in folder
inline to be sent without
content disposition headers. The new content node should look like this: