Migrating From DAM 1.x from DAM 2.x requires code changes and migration tasks are not provided. Many of the 1.x class names have been retained, but the meaning and behavior has changed.
The new DAM documents provide details of how the new DAM works. Please read them carefully before starting to modify your code:
This document highlights the major changes and potential code challenges you may face.
Main class equivalencies
AssetProviderRegistry replaces DamManager .
AssetProviderRegistrydoes not give direct access to the
DamManagerdid. It provides access to the
AssetProvider. See Architecture.
is now the main id used to request an
AssetProvider has the same name in 2.x and 1.x but behaviors are different.
- 2.x introduces support availability.
- 2.x only exposes methods that uses
ItemKeyas the input parameter.
- If your codes uses paths (mainly JCR related) the new DAM API provides PathAwareAssetProvider . The JcrAssetProvider implements this interface. See JCR API.
- If you have created your own
AssetProviderimplementation, do not forget to re-configure and re-register your components once you have migrated your code. See Asset providers and renderers in the DAM Core module documentation.
Here are a few code examples that you can adapt to suit your needs.
has the same name in 2.x and 1.x, but the behaviors are different. To retain minimal templating compatibility, certain 1.0 templating methods are still exposed in
DamTemplatingFunctions 2.x, but are marked as deprecated. See DAM templating for a list:
- New methods.
- Deprecated methods and corresponding new methods
- 1.x methods that can be implemented 2.x.
- 1.x methods that cannot be implemented 2.x.
in 1.x was removed and replaced in 2.x with a normal
Map. Once you get the new map using (
DamTemplatingFunctions.getAssetMapForAssetId(String assetKey)), the syntax on the template side remains the same. See Main methods in 2.x for code examples.
DAM app migration tasks
- UpdateDamAssetFileNamePropertiesTask modifies certain DAM JCR Asset properties, for example the file name that now contains the name of the file and the file extension.