[MGNLDAM-418] Improve handling of supported metadata in DamTemplatingFunctions Created: 10/Mar/14  Updated: 30/Jun/15  Resolved: 29/Jun/15

Status: Closed
Project: Magnolia DAM Module
Component/s: DAM API
Affects Version/s: 2.0
Fix Version/s: 2.1

Type: Task Priority: Major
Reporter: Eric Hechinger Assignee: Robert Šiška
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to MGNLDAM-411 Support custom metadata Closed
Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Date of First Response:
Epic Link: DAM / CMIS

 Description   

In the current implementation, the AssetProvider defines the supported metadata (AssetProvider#supports(Class<? extends AssetMetadata> metaData))

We should also have a way to retrieve the list of supported metadatas.

In addition, we should also have this on Asset. An AssetProvider may support 2 or 3 metadata Type, but a given Asset may only support one Type (a document and video Asset may not support the same metadata Type).



 Comments   
Comment by Richard Unger [ 24/Feb/15 ]

+1

It is very annoying that the DamTemplatingFunctions has hard-coded references to Dublin and Mgnl Metadata types, and does not allow adding your own, nor does it use the assetprovider to get this information.

This means that at the moment (5.3.7) we are stuck and can't extend the metadata in a compatible way.

Comment by Philip Mundt [ 29/Jun/15 ]

Please add deprecated, old constructor in info.magnolia.dam.templating.functions.DamTemplatingFunctions.

Comment by Philip Mundt [ 29/Jun/15 ]
  • Please use @Inject only once, and use component provider to get AssetMetadataRegistry:
        /**
         * @deprecated since 2.1 - use {@link #DamTemplatingFunctions(AssetProviderRegistry, AssetMetadataRegistry)} instead.
         */
        @Deprecated
        public DamTemplatingFunctions(AssetProviderRegistry providerRegistry) {
            this(providerRegistry, Components.getComponent(AssetMetadataRegistry.class));
        }
    
  • Remove null-check, component should always be instantiated
Comment by Philip Mundt [ 29/Jun/15 ]

If integrated, this will require updates at least in STK, maybe more modules...

  • info.magnolia.module.templatingkit.test.STKTestUtil makes use of info.magnolia.dam.templating.functions.DamTemplatingFunctions
Comment by Robert Šiška [ 29/Jun/15 ]

How about not introducing the new cons. and get it through Components anyway?

Comment by Philip Mundt [ 29/Jun/15 ]

Adjustments will have to be made anyways (Component has to be set, and we should use injection where possible)
I think it's okay, I have double-checked templating-essentials & demo-projects and they only use mocks. The STK adjustment is also ready.

Generated at Mon Feb 12 04:59:38 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.