Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Praveen P
fetching images to another portlet
April 26, 2012 6:28 AM
Answer

Praveen P

Rank: Regular Member

Posts: 100

Join Date: February 20, 2012

Recent Posts

Is it possible to fetch images to separate portlet which are uploaded in image gallery? by particular folder?
if yes, how to achieve it?

Thanks in advance
Anil T
RE: fetching images to another portlet
May 4, 2012 10:36 AM
Answer

Anil T

Rank: Regular Member

Posts: 219

Join Date: January 14, 2012

Recent Posts

Hi,

I think we can get with the image gallery api.
Can you try this >> List<IGImage> images=IGImageLocalServiceUtil . getIGImages(-1,-1); It shows all images from all folders.
You can also get images by folder id.
List<IGImage> images = IGImageLocalServiceUtil .getImages(long folderId, -1,-1);
or
List<IGImage> images = IGImageLocalServiceUtil .getImages(long folderId);
Hiral Ramavat
RE: fetching images to another portlet
May 4, 2012 12:12 PM
Answer

Hiral Ramavat

Rank: Junior Member

Posts: 98

Join Date: February 13, 2012

Recent Posts

Hi,

if you have the folder ID then you can directly pass it to the API method,
List<IGImage> images = IGImageLocalServiceUtil .getImages(long folderId);

if you do not have the folderId then first get the list of folders and then use above method :
List<IGFolder> folders = IGFolderLocalServiceUtil.getFolders(long groupId);

Thanks,
Hiral
Hitoshi Ozawa
RE: fetching images to another portlet
May 4, 2012 7:03 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7954

Join Date: March 23, 2010

Recent Posts

Be sure the user using the other portlet has the privilege to access the image.
Praveen P
RE: fetching images to another portlet
May 4, 2012 9:55 PM
Answer

Praveen P

Rank: Regular Member

Posts: 100

Join Date: February 20, 2012

Recent Posts

Thanks for the replay i got solution emoticon