cancel
Showing results for 
Search instead for 
Did you mean: 

How to get custom metadata from asset object

ganmaku
Champ on-the-rise
Champ on-the-rise
Hello Team,

I am customizing the Alfresco Share edit page and hence working on "/webapps/share/js/documentlibrary-actions.js" file.

As you know, asset object represents Alfresco content and we can get content's fileName, type etc thorugh it.

But I want to get the custom metadata information from an asset object.

Could anyone please provide me the code for the same?
3 REPLIES 3

mikeh
Star Contributor
Star Contributor
You need to override alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/item.lib.ftl within the Repository webapp (/alfresco) to return your custom metadata.

Thanks,
Mike

ganmaku
Champ on-the-rise
Champ on-the-rise
Thanks Mike.

I did the change in the file specfied as below but I got value as undefined.

"application":"${node.properties.application!""}",
And I have gotten error message when I was trying to include the URI path to the custom metadata.

Any help would be highly beneficial for me.

mikeh
Star Contributor
Star Contributor
Yes, that won't work as only a few properties are exposed as public getters in ScriptNode.class.

Try
node.properties["foo:bar"]

Remember to convert to string (if appropriate) and add null handling for Freemarker.

Thanks,
Mike