Reputation: 267
I would like to view the custom metadata that I associated with the my custom document, that I created with the document library, anyone know how to due with velocity variable?
Thanks in advance Sabrina
Upvotes: 2
Views: 3974
Reputation: 594
You can get some meta-data articles properties with
$reserved-article-id.data
$reserved-article-title.data
full list you can find here
Also you can check this post, it has example how to get journal's categories at velocity template.
UPD. For getting document metadata you can use smth like this:
#set($dlFileUtil = $serviceLocator.findService("com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService"))
#set ($groupId = $getterUtil.getLong($groupId))
#set($fileEntry = $dlFileEntryUtil.getFileEntryByUuidAndGroupId($uuid,$longGroupId))
#set($metadataUtil=$serviceLocator.findService("com.liferay.portlet.documentlibrary.service.DLFileEntryMetadataLocalService"))
You can use getFileEntryMetadata(ddmStructureId, fileVersionId) from $metadataUtil
More detailed code you can check this.
BR, Paul Butenko
Upvotes: 1