## list document
#set($fileEntryLocalService = $serviceLocator.findService("com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService"))
#set ($scopeGroupId = $getterUtil.getLong($request.theme-display.scope-group-id))
#set ($textFormatter = $portal.getClass().forName('com.liferay.portal.kernel.util.TextFormatter').newInstance())
#set ($count = 0)
#if (!$attachments.getSiblings().isEmpty())
#foreach ($cur_attachments in $attachments.getSiblings())
#set ($count = $count +1)
#if( $count > 3 )
#break
#end
## Get the group ID of the document library you are referring to
#set ($gid = $getterUtil.getLong($cur_attachments.getData().split("/").get(2)))
## Get the folder ID of the DL
#set ($fid = $getterUtil.getLong($cur_attachments.getData().split("/").get(3)))
## Get the file title
#set ($fileTitle = $cur_attachments.getData().split("/").get(4))
## Since the file title is URL encoded, we need to decode it first
## (I assume you are using UTF-8 as charset)
#set ($tmp = {})
#set ($decoder = $tmp.class.forName("java.net.URLDecoder").newInstance())
#set ($fileTitle = $decoder.decode($fileTitle, "UTF-8"))
#set ($uuid = $cur_attachments.getData().split("/").get(5))
#set ($fileEntry = $fileEntryLocalService.getDLFileEntryByUuidAndGroupId($uuid, $gid))
- $fileTitle ( $textFormatter.formatStorageSize($fileEntry.getSize(), $locale) )
#end
#end