掲示板

How to get files from a folder in document library using structure template

10年前 に Paramita Nandi によって更新されました。

How to get files from a folder in document library using structure template

New Member 投稿: 23 参加年月日: 12/03/05 最新の投稿
Following code is not working :

#set($service = $serviceLocator.findService("com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService"))
#set($gid = $getterUtil.getLong($request.get("theme-display").get("scope-group-id")))
#set($fid = $getterUtil.getLong($folderId.getData()))

#set($files = $service.getFileEntries($gid, $fid, -1, -1, null))

#foreach($doc in $files)
#set($uet = $httpUtil.encodeURL($htmlUtil.unescape($doc.getTitle())))
<a href="/documents/$gid/$fid/$uet">$doc.getTitle()</a><br />
#end

Please help!!
thumbnail
10年前 に sushil patidar によって更新されました。

RE: How to get files from a folder in document library using structure temp

Expert 投稿: 467 参加年月日: 11/10/31 最新の投稿
Hi,
Have you set following property in the portal-ext.properties to enable the service locator in the journal template?

journal.template.velocity.restricted.variables=


Add above property and check. I hope it will help you.
10年前 に Paramita Nandi によって更新されました。

RE: How to get files from a folder in document library using structure temp

New Member 投稿: 23 参加年月日: 12/03/05 最新の投稿
Thanks Sushil.