[MGNLDAM-790] Using assets in different workspaces: AssetCompositeIdKeyTranslator denies flexible usage Created: 27/May/19 Updated: 12/Mar/21 Resolved: 12/Mar/21 |
|
| Status: | Closed |
| Project: | Magnolia DAM Module |
| Component/s: | DAM API |
| Affects Version/s: | 2.4.1, 2.5 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Christian Ringele | Assignee: | Unassigned |
| Resolution: | Obsolete | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Template: |
|
| Acceptance criteria: |
Empty
|
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
| Date of First Response: |
| Description |
|
Use case:
Situation / Problem:
But there is one flaw that forces you to override/implement classes:
ItemKey itemKey = new ItemKey(DamConstants.DEFAULT_JCR_PROVIDER_ID, session.getNode(path).getIdentifier());
That means "jcr" is always stored as assetProvider id -> the second registered assetProvider will never be used. Asset createAsset(final Node assetNode) { if (AssetNodeTypes.isAsset(assetNode)) { log.debug("Created asset linked to the following node '{}'", NodeUtil.getPathIfPossible(assetNode)); return new JcrAsset(this, new I18nNodeWrapper(assetNode)); } throw new IllegalArgumentException("Node '" + NodeUtil.getPathIfPossible(assetNode) + "' is not defining an asset but another item type"); } Solution: |
| Comments |
| Comment by Roman Kovařík [ 12/Mar/21 ] |
|
AssetCompositeIdKeyTranslator is deprecated in favour of https://git.magnolia-cms.com/projects/MODULES/repos/dam/browse/magnolia-dam-app/src/main/java/info/magnolia/dam/app/data/AssetConverter.java#68 |