0

I am using liferay 6.1.20. Structure variable demo_image : type Document and Media

here is my template code. It is not fetching uuid or groupId from url !

#set ($dlLocalService = $serviceLocator.findService("com.liferay.portlet.documentlibrary.service.DLAppLocalService"))
#set ($url = $getterUtil.getString($demo_image.getData()))
#set ($uuid = $getterUtil.getString($httpUtil.getParameter($url, "uuid", false)))
#set ($groupId = $getterUtil.getLong($httpUtil.getParameter($url, "groupId", false)))
#set ($imageObj = $dlLocalService.getFileEntryByUuidAndGroupId($uuid,$groupId))
#set ($imageSmallid = $imageObj.getSmallImageId())
#set ($imageLargeid = $imageObj.getLargeImageId())
#set ($imageTitle = $imageObj.getTitle())
#set ($imageDescription = $imageObj.getDescription())
#set ($urlLargeImage = "/documents/imageLargeid")
#set ($urlSmallImage = "/documents/imageSmallid")

$imageTitle
<a href="$urlLargeImage"><img src="$urlSmallImage" rel="$imageTitle" alt="$imageTitle" /></a>
Hiral
  • 195
  • 1
  • 13

1 Answers1

1

Check value of $url for your image, does this URL contain uuid & groupId if yes you should get the values. else if url contains imageId try using different method from service util.

Also try using DLFileE‌​ntryLocalService instead of DLAppLocalService

Hope this helps you find your solution !

Ankit P
  • 534
  • 4
  • 12