Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Akira Akira
Get Image Token in Liferay 6.1
March 28, 2012 6:40 PM
Answer

Akira Akira

Rank: Junior Member

Posts: 68

Join Date: September 24, 2010

Recent Posts

In version other liferay. I get image token by
1assetImageURL = themeDisplay.getPathImage()+ "/journal/article?img_id=" + articleDisplay.getSmallImageId() + "&t=" +ImageServletTokenUtil.getToken(articleDisplay.getSmallImageId());


In version 6.1. I not found class ImageServletTokenUtil.

I copied 2 class: ImageServletToken and ImageServletTokenUtil in version 6.0 to version 6.1 with path
1com.liferay.portal.kernel.servlet.*


When run server appear error.

1ERROR [IncludeTag:154] java.lang.NullPointerException
2    at com.liferay.portal.kernel.servlet.ImageServletTokenUtil.getToken(ImageServletTokenUtil.java:38)
3    at org.apache.jsp.html.portlet.asset_005fpublisher.display.abstracts_jsp._jspService(abstracts_jsp.java:788)


Any help??

Thanks.
Hitoshi Ozawa
RE: Get Image Token in Liferay 6.1
April 1, 2012 6:49 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

before Liferay 6.1: href=""/image/image_gallery?uuid=xxxxxxx", where xxxxxxx is the image uuid.
Liferay 6.1 GA : href="/document/xxx/yyyy/image.jpg" where xxx is the group id and yyy is the folder id where the image

You don't need uuid anymore in 6.1. Just specify the file name.
Akira Akira
RE: Get Image Token in Liferay 6.1
April 13, 2012 1:16 AM
Answer

Akira Akira

Rank: Junior Member

Posts: 68

Join Date: September 24, 2010

Recent Posts

Thanks, very good.
Thomas Krauß
RE: Get Image Token in Liferay 6.1
August 14, 2012 6:24 AM
Answer

Thomas Krauß

Rank: New Member

Posts: 22

Join Date: August 18, 2011

Recent Posts

Hitoshi Ozawa:
before Liferay 6.1: href=""/image/image_gallery?uuid=xxxxxxx", where xxxxxxx is the image uuid.
Liferay 6.1 GA : href="/document/xxx/yyyy/image.jpg" where xxx is the group id and yyy is the folder id where the image

You don't need uuid anymore in 6.1. Just specify the file name.


Just a small correction: its href="/documents/xxx/yyyy/imageName"
or optional href="/documents/xxx/yyyy/imageName?imageThumbnail=1"