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

Getting metadata doesn't work for a custom property

Avatar

Level 2

I'm trying to get the metadata for an asset in the DAM. However, it seems that the metadata comes back as empty for properties that don't have "dc:" in front of them. 

For example:

Resource rs = getResourceResolver().getResource(fileReference); Asset asset = rs.adaptTo(Asset.class); //this works title = asset.getMetadataValue("dc:title").toString(); //this does not work. I have ensured that mine.title is a property and has string value assigned to it. customTitle = asset.getMetadataValue("mine.title").toString(): //this does not work either customTitle = asset.getMetadata("mine.title").toString():

Is there a way to get the value from a custom metadata property?

1 Accepted Solution

Avatar

Correct answer by
Level 2

You cannot store properties with other prefixes like "mine" on the metadata node.  You may want to recheck your DAM node structure and check whether your custom properties like "mine:title" are on some other node like jcr:content.

The metadata node is specifically used to store the metadata extracted from the binary assets. There are set of metadata standards which AEM implements. Here for example in "dc:title" the "dc" means "Dublin Core" which is a metadata standard. There are other metadata standards too like XMP and Exif which AEM implements. Therefore the metadata node allows only those predefined prefixes. 

Also, if you want to set any of your application related custom properties then I would advise you NOT to store it on the metadata node because any changes to the metadata of an asset are written back to the original binary by CQ-metadata writeback workflow. 

For more information on metadata, please check the following documentation link : https://docs.adobe.com/docs/en/aem/6-1/administer/content/assets/metadata.html

View solution in original post

3 Replies

Avatar

Correct answer by
Level 2

You cannot store properties with other prefixes like "mine" on the metadata node.  You may want to recheck your DAM node structure and check whether your custom properties like "mine:title" are on some other node like jcr:content.

The metadata node is specifically used to store the metadata extracted from the binary assets. There are set of metadata standards which AEM implements. Here for example in "dc:title" the "dc" means "Dublin Core" which is a metadata standard. There are other metadata standards too like XMP and Exif which AEM implements. Therefore the metadata node allows only those predefined prefixes. 

Also, if you want to set any of your application related custom properties then I would advise you NOT to store it on the metadata node because any changes to the metadata of an asset are written back to the original binary by CQ-metadata writeback workflow. 

For more information on metadata, please check the following documentation link : https://docs.adobe.com/docs/en/aem/6-1/administer/content/assets/metadata.html

Avatar

Level 2

the "mine.title" is stored in the following structure. Is this ok? If not, where do you suggest that I store these items and how can I fetch them?

 

[img]http://help-forums.adobe.com/content/usergenerated/content/adobeforums/en/experience-manager-forum/a...

Avatar

Employee

You need to register your namespace in AEM in order for metadata to sync from the metadata node to the XMP record in the asset binary.

http://blogs.adobe.com/contentmanagement/tag/namespace/

Once you register the namespace, then you can add metadata with your registered prefix onto the metadata node. You can also build form fields in a metadata schema page that can read and write data to metadata, using the prefix:property nomenclature.