Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Restrict custom metadata for DAM assets

Avatar

Level 4

Hi

1. Can we show/hide the few metadata fields and few disable (graout) programmatically? Does anyone have any example or article url?

Thanks

~S

1 Accepted Solution

Avatar

Correct answer by
Level 10

Option 1: 

  • overlay /libs/dam/components/asseteditor/form/metadata component in your project and
  • set HTML form field to hidden or if you want to hide this in editor.
  • Similarly you can change the other behaviour by overlaying or overriding components available in /libs/dam/components/asseteditor based on your requirements.

Option 2: 

  • AEM DAM has the notion of meta schema editors. These editors are tied to asset file type, meaning - jpeg, png, etc. For an asset MIME type, you can define the meta data and its associated form.
  • AEM 6.0 provides choral UI interface to achieve this -- http://localhost:4502/libs/dam/gui/content/metadataschemaeditor/schemalist.html/dam/content/schemaed...
  • if you want to hide the metadata for a specific filetype, add that file type into your dam content hierarchy. Example - /content/dam/jpeg/test1, /content/dam/png/test1, etc. This way, you would get different metadata form layout for different folders of the dam.

Option 3:

View solution in original post

9 Replies

Avatar

Level 10

Can you share more details about: where do you want to show/hide the metadata? 

Avatar

Level 4

Hi Amit,

Basically our original requirement is to show/hide few metadata fields of DAM assets based on the users. There are no way to do this OTB in AEM that's why we are trying/looking to implement it pro-grammatically if it is possible.

We are able to disable it by setting the property "disabled=true" in classic UI view. But looking to hide the properties.

Thanks

~S

Avatar

Level 10

The only way I can think of is to treat these assets as nodes and properties and use the AEM JCR to modify properties. So you will need to build a custom AEM service that uses the JCR API to do this. 

Avatar

Correct answer by
Level 10

Option 1: 

  • overlay /libs/dam/components/asseteditor/form/metadata component in your project and
  • set HTML form field to hidden or if you want to hide this in editor.
  • Similarly you can change the other behaviour by overlaying or overriding components available in /libs/dam/components/asseteditor based on your requirements.

Option 2: 

  • AEM DAM has the notion of meta schema editors. These editors are tied to asset file type, meaning - jpeg, png, etc. For an asset MIME type, you can define the meta data and its associated form.
  • AEM 6.0 provides choral UI interface to achieve this -- http://localhost:4502/libs/dam/gui/content/metadataschemaeditor/schemalist.html/dam/content/schemaed...
  • if you want to hide the metadata for a specific filetype, add that file type into your dam content hierarchy. Example - /content/dam/jpeg/test1, /content/dam/png/test1, etc. This way, you would get different metadata form layout for different folders of the dam.

Option 3:

Avatar

Level 4

This help us.Thank you so much.

One thing, In Option 2, My understanding is that if for same assets few user want to see few metadata fields (like title, description, approved status etc) and few others users only want to see only the title and description not the approved status fields. Then in this case we need to maintain that assets in two separate folders in to the DAM, right?

Thanks

~S

Avatar

Level 10

yes,you are right.
I think if you set correct permissions then i am sure you need not to hide them Rest it depends on your business requirements. Moreover one though if you have a limited number of user group i.e author, approver then you can override the HTML code for this asset editor and write a servlet to get the user roles and based on the user roles you can render the html code for this again that will take some extra efforts and yeah If you got your solution then mark this as answered please.

Thanks,
Amit

Avatar

Level 10

This could be done with the help of listeners as well. Write a widget listener so that based on user group you have hidden = true/ hidden = false.

Avatar

Level 4

Hi All,

Thank you so much for valuable solution. These all help us.

Thanks

~S