Sabrina
Sabrina

Reputation: 267

how to show metadata associate with a custom document

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 enter image description here

Upvotes: 2

Views: 3974

Answers (1)

Pavlo Butenko
Pavlo Butenko

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.DLFileE‌​ntryLocalService")) 
#set ($groupId = $getterUtil.getLong($groupId)) 
#set($fileEntry = $dlFileEntryUtil.getFileEntryByUuidAndGroupId($uuid,$longGroupId))    
#set($metadataUtil=$serviceLocator.findService("com.liferay.portlet.documentlibrary.service.DLFileE‌​ntryMetadataLocalService")) 

You can use getFileEntryMetadata(ddmStructureId, fileVersionId) from $metadataUtil

More detailed code you can check this.

BR, Paul Butenko

Upvotes: 1

Related Questions