Can I get the value selected in standard tags in metadata schema? | Community
Skip to main content
Anmol_Bhardwaj
Community Advisor
Community Advisor
July 13, 2021
Solved

Can I get the value selected in standard tags in metadata schema?

  • July 13, 2021
  • 2 replies
  • 1965 views

I want to get the value/values selected by an author when they select a standard tag in metadata schema.

 

Example: In the custom metadata schema for an asset, I have a tag field, where I have selected /content/cq:tags/test/1

 

I want to get this value "/content/cq:tags/test/1".

I have to apply this to the metadata field only, as I want to get this value for all the assets, not for a single one.

 

 

Here is my use-case:

 

  1. Created a metadata schema.
  2. Have added a standard tag field in the form of that schema.
  3. Have applied that schema to a folder in my DAM.

Requirement:

  • When the user uploads an asset inside that schema, they will have to fill the metadata created.( which includes the standard tag as well ).
  • What I want is to get the value/path of the tag which the user will select in that metadata.

 

AEM Version: 6.5

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by shelly-goel

@anmol_bhardwaj  If you're programmatically looking to fetch this metadata, you can use below API and getAssetMetadata() method.

https://javadoc.io/doc/com.adobe.aem/aem-sdk-api/latest/com/adobe/granite/asset/api/Asset.html

 

The metadata is stored on node /jcr:content/metadata of the asset which you can verify in crxde

2 replies

Dipti_Chauhan
Community Advisor
Community Advisor
July 13, 2021

Hi @anmol_bhardwaj 

Can please you elaborate your question a bit more? What exactly your requirement? 

  • This tag field will be visible for all assets?
  • If its updated on one assets , it will get added on all assets by default?

this is what you are looking for?

Anmol_Bhardwaj
Community Advisor
Community Advisor
July 13, 2021

Hi @dipti_chauhan,

 

Here is my use-case:

 

  1. Created a metadata schema.
  2. Have added a standard tag field in the form of that schema.
  3. Have applied that schema to a folder in my DAM.

Requirement:

  • When the user uploads an asset inside that schema, they will have to fill the metadata created.( which includes the standard tag as well ).
  • What I want is to get the value/path of the tag which the user will select in that metadata.
shelly-goel
Adobe Employee
shelly-goelAdobe EmployeeAccepted solution
Adobe Employee
July 13, 2021

@anmol_bhardwaj  If you're programmatically looking to fetch this metadata, you can use below API and getAssetMetadata() method.

https://javadoc.io/doc/com.adobe.aem/aem-sdk-api/latest/com/adobe/granite/asset/api/Asset.html

 

The metadata is stored on node /jcr:content/metadata of the asset which you can verify in crxde

Anmol_Bhardwaj
Community Advisor
Community Advisor
July 13, 2021

@shelly-goelThis will only give me the metadata of a single asset right?

As I would be putting the path to a single asset.And need to write a new code or traverse through a lot of (child)nodes to get value for all of them. Which is not feasible in my case.

I need to fetch the value automatically for every asset that the user uploads. Sort of like a listener on the metadata field to get me the value every time.