Ad Code

Tuesday, February 21, 2017

Override/Overlay Dam Asset Metadata in AEM 6.2

Use Case: Recently I have gone through a scenario. In which i want to change the dam asset properties and want to add a new widget as well.

This image depicts the default touch ui dialog available for dam asset properties. Now I want to change/add a rootPath for tags so that i can select tags from specific hierarchy only.

This Default dialog comes from “/libs/dam/content/schemaeditors/forms/default”. But According  to the AEM Best Practice we never do any change in /libs hierarchy.

sample.JPG
Fig: DAM Asset Property Dialog

Now I thought about below concepts:
  • I have tried to do that using Resource Merger, but it didn’t work.
  • After that I have tried same using Overlay the complete hierarchy in /apps but it also didn’t work.

Solution:
In AEM 6.2 the correct way to do this is through  "metadata schema".To add/change the properties for a dam asset properties, use a custom metadata schema form or modify an existing form. So I decided to go for modifying an existing form.

Below Steps we need to follow:
Step 1: Go to Projects.html  .
Step 2: Click on Adobe Experience Manager
Step 3: Go to Tools and click on Assets.
Step 4: Click on Metadata Schema
Step 5:  Select Default and go to edit.
Step 6: In this Edit Form, you can see all the fields available in metadata dialog.

overlay.PNG

Fig: Modifying Existing Form
Step 7: In the url query parameter , you can see "formpath=/conf/global/settings/dam/adminui-extension/metadataschema"

Now just change some title in dialog suppose test title and check it in the same path.

crx.PNG
Fig: Add/Change Properties inConf Hierarchy in CRX

Now i just add the property rootPath in my tags node and when i go for any image /asset metadata.
I am able to see the title to Test Title.

dialog.PNG
Fig: Updated Dialog After Modification

And when i  click on tags ,I can find tags  available under /etc/tags/forum.

Capture.PNG
Fig: Updated the root path for Tag widget

So This was the solution of above problem.

If you have any query or suggestion then kindly comment or mail us at sgaem.blog02@gmail.com.

Hope it will help you guys !!👍
Thanks and Happy Learning 😊

.

21 comments:

  1. Really appreciating. Keep it up guys. Best of luck.

    ReplyDelete
  2. pls let me know the code or tips for fetch the multicompositefield value in jsp page.

    ReplyDelete
  3. One update here is you are still changing in "default" which will change for all assets, instead you can create your own company folder parallel to default and make changes there.

    ReplyDelete
    Replies
    1. Hi Raja,

      It is just a demo for explaining the concept. You can customize as per your need.

      Thanks

      Delete
  4. It’ll be great if you’d start with creating a custom namespace for sensitive metadata that we dont want to persist in the file as a best practice.
    - Roger Yumnam

    ReplyDelete
  5. Thanks, do we know how to limit the size of image upload. That was a known bug in aem before.

    ReplyDelete
  6. How can i do it in AEM 6.3 as I can't find anything under settings in my CRX console.

    ReplyDelete
  7. Thank you for the article.I have below questions, Could you please check once.

    1. Is the best practice we need to copy default meta data schema and add our own properties to the custom schema ?

    2. If yes, Is there any way we can extend default schema instead of copying and adding our own properties so that in future we don't have to copy the new changes from the future releases?

    3. Also i can see large set of nodes are added under /conf/global/settings/dam/adminui-extension/metadataschema folder if we do customization. I know we need to add this /conf/global/settings/dam/adminui-extension/metadataschema folder path to our project to deploy in each environment. Is there any best practice around it ?

    ReplyDelete
  8. I have only /conf/global/settings/workflow, nothing else inside settings. Also its picking it from /libs/dam/content/schemaeditors/forms/default/items/tabs/items/tab1/items/col1/items/title.
    I want to change this title field name in AEM 6.4.
    In 6.1 its working fine.

    ReplyDelete
    Replies
    1. Hi Abhishek,

      First you go in this console http://localhost:4502/mnt/overlay/dam/gui/content/metadataschemaeditor/schemadetails.html/default?formPath=/conf/global/settings/dam/adminui-extension/metadataschema&pickable=

      and change something here.Then your hierarchy will get created and you can change there.

      Delete
  9. Hi

    The references tab is getting removed after editing default metadata schema or through custom meta data schema

    ReplyDelete
  10. Hi,

    How is this metadata editor form implemented in AEM 6.5 as I am unable to locate the form fields under /conf.

    Thanks in advance

    ReplyDelete
    Replies
    1. First change in the metadata schema. then you will be able to see the hierarchy under /conf.

      Delete
  11. Hi,
    I have two requirements-
    1. I want to apply metadata schema based on custom mimetypes like abc/xyz, def/tuv etc...
    2. The metadata schema form should be placed outside default folder.
    I am able to achieve my first requirement if I keep it inside default folder. But I need to keep the form outside default folder so that it does not inherit default form fields.

    Thanks in advance.

    ReplyDelete
    Replies
    1. Hi you can use sling:hideChildren and hide the inherit default fields.

      You cant make it out of default so try to hide existing field which you don't want.

      You can check here how to use this property:
      http://www.sgaemsolutions.com/2017/09/sling-resource-merger-in-aem-63.html

      Delete
  12. Hi,
    I wanted to add a section in column 1 of tab 2 so I created a section from metadata schema editor ui. Using crx, I changed sling:resourceType= /apps/dam/gui/components/admin/myfield to my overlaying jsp which works fine. But I am observing that if anyone makes any change, even if its not in my section, in the metadata schema, it is reverting to original sling:resourceType value which is dam/gui/components/admin/schemafield
    Can you tell me ho to overlay metadata schema node as xml such that this doesnt happen?

    ReplyDelete