Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Get Image from Image Gallery in a portlet plugin Mario Muñoz August 20, 2008 5:00 AM
Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a port Ray Augé August 20, 2008 8:56 PM
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in ai Mario Muñoz August 20, 2008 11:08 PM
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a Mario Muñoz August 21, 2008 2:17 AM
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a Ketan J Patel September 10, 2008 1:33 AM
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a wencheng ma April 7, 2011 6:55 PM
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a Melvin Rodriguez Rojas April 7, 2011 8:26 PM
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a wencheng ma April 7, 2011 8:49 PM
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a Secret Developer August 25, 2009 8:18 AM
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a Brett Swaim August 25, 2009 3:36 PM
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a Mónica Parejo Bellido November 4, 2009 4:45 AM
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a Mónica Parejo Bellido November 5, 2009 12:48 AM
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a Ram Prasad September 2, 2010 7:46 AM
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a Melvin Rodriguez Rojas April 7, 2011 4:01 PM
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a Melvin Rodriguez Rojas April 16, 2011 7:18 PM
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a Praveen P April 26, 2012 1:56 AM
RE: Get Image from Image Gallery in a portlet plugin Jitendra Rajput April 26, 2012 10:36 PM
RE: Get Image from Image Gallery in a portlet plugin Praveen P April 26, 2012 11:48 PM
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a Neil Francese September 14, 2012 4:25 PM
Mario Muñoz
Get Image from Image Gallery in a portlet plugin
August 20, 2008 5:00 AM
Answer

Mario Muñoz

Rank: Junior Member

Posts: 43

Join Date: August 27, 2007

Recent Posts

Hi,

I'd like to show an image saved within the image gallery portlet in my custom portlet application. I've been searching the API, but it seems too confusing. Can anybody provide an example of accesing images from image gallery?

Thanks.

Mario.
Ray Augé
Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a port
August 20, 2008 8:56 PM
Answer

Ray Augé

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1195

Join Date: February 7, 2005

Recent Posts

Iterating over and displaying images in an IGFolder:


 1    <%
 2         long folderId = ...
 3
 4    IGFolder folder = IGFolderServiceUtil.getFolder(folderId);
 5
 6    List images = IGImageLocalServiceUtil.getImages(folder.getFolderId());
 7
 8    for    (int i = 0; i < images.size(); i++) {
 9        IGImage image = (IGImage)images.get(i);
10    %>
11
12        <img src="<%= themeDisplay.getPathImage() %>/image_gallery?img_id=<%=
13image.getLargeImageId() %>&t=<%=
14ImageServletTokenUtil.getToken(image.getLargeImageId()) %>" />
15
16    <%
17    }
18         %>


Getting a single image and displaying it:

 1 <%
 2         long imageId = ...
 3
 4         IGImage image = IGImageLocalServiceUtil.getIGImage(imageId);
 5         %>
 6
 7         <img src="<%= themeDisplay.getPathImage() %
 8>/image_gallery?img_id=<%= image.getLargeImageId() %>&t=<%=
 9ImageServletTokenUtil.getToken(image.getLargeImageId()) %>" />
10


HTH!
Mario Muñoz
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in ai
August 20, 2008 11:08 PM
Answer

Mario Muñoz

Rank: Junior Member

Posts: 43

Join Date: August 27, 2007

Recent Posts

Hi Ray,

I really appreciate your help, it is very useful to me. Now I have one more question: how can I get the imageId? from my portlet application I only have access to the image file name.

Thanks for your reply,

Mario.
Mario Muñoz
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a
August 21, 2008 2:17 AM
Answer

Mario Muñoz

Rank: Junior Member

Posts: 43

Join Date: August 27, 2007

Recent Posts

Hi again,

I'll answer my own question. I have been able to get the images from Image Gallery using the file name with the IGFolderLocalServiceUti.search(...) method. I have used the file name obtained from my data model to fill the keywords field in the method.

It seems it works pretty well.

Thanks!

Mario.
Ketan J Patel
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a
September 10, 2008 1:33 AM
Answer

Ketan J Patel

Rank: New Member

Posts: 1

Join Date: September 5, 2008

Recent Posts

Hi all,

I m new to liferay.
My question is how can I get the particular folderid? I have only folder name, with use of that folder name should I get folderid?
And second question is where should generate folderid and how?

Please guide me, I will appricate your help.
Secret Developer
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a
August 25, 2009 8:18 AM
Answer

Secret Developer

Rank: Expert

Posts: 278

Join Date: June 23, 2009

Recent Posts

Hello Ray,

Is it possible to give the image id the value of a custom attribute?

Baris
Brett Swaim
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a
August 25, 2009 3:36 PM
Answer

Brett Swaim

LIFERAY STAFF

Rank: Regular Member

Posts: 112

Join Date: April 13, 2006

Recent Posts

Do you mean to manually specify an image id? If so, then no. It's automatically generated.
Mónica Parejo Bellido
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a
November 4, 2009 4:45 AM
Answer

Mónica Parejo Bellido

Rank: New Member

Posts: 4

Join Date: October 30, 2009

Recent Posts

I'm new in liferay, and i need to make a Zip file with images from de Image Gallery, so i think i need the path of the images to make a File with the image and to aggregate the images to my zip. How can i get the paths of the images?

IGImage image = IGImageLocalServiceUtil.getIGImage(noticia.getImagenId());

i need to construct a File with the image, i dont know how.
Thanks a lot
Mónica
Mónica Parejo Bellido
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a
November 5, 2009 12:48 AM
Answer

Mónica Parejo Bellido

Rank: New Member

Posts: 4

Join Date: October 30, 2009

Recent Posts

i've found a solution for my problem: to make a zip with some of the images from the image gallery.

//Image are saved in data base

IGImage im = IGImageLocalServiceUtil.getIGImage(idImagen);
Image image = ImageLocalServiceUtil.getImage(im.getLargeImageId());
byte[] imagen = image.getTextObj();

File ficheroImagen = File.createTempFile(Long.toString(im.getImageId()), im.getImageType());
FileOutputStream fos= new FileOutputStream(ficheroImagen);
fos.write(imagen);
fos.close();
Ram Prasad
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a
September 2, 2010 7:46 AM
Answer

Ram Prasad

Rank: New Member

Posts: 2

Join Date: April 18, 2010

Recent Posts

Can any one give an idea where the Image folders are created
Melvin Rodriguez Rojas
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a
April 7, 2011 4:01 PM
Answer

Melvin Rodriguez Rojas

Rank: Junior Member

Posts: 50

Join Date: February 4, 2011

Recent Posts

If I want ImageLocalServiceUtil to save a read images from the table Image
How i can do it?

Thanks!!
wencheng ma
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a
April 7, 2011 6:55 PM
Answer

wencheng ma

Rank: New Member

Posts: 23

Join Date: March 14, 2011

Recent Posts

you can use image gallery to create a folder to save images ,then in igfolder table you can find the folderid , use IGFolderLocalServiceUtil.getFolders(...) or IGImageLocalServiceUtil.getImages(...) . Final you must get the image id ,the rest can be easily handled.
Melvin Rodriguez Rojas
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a
April 7, 2011 8:26 PM
Answer

Melvin Rodriguez Rojas

Rank: Junior Member

Posts: 50

Join Date: February 4, 2011

Recent Posts

wencheng ma:
you can use image gallery to create a folder to save images ,then in igfolder table you can find the folderid , use IGFolderLocalServiceUtil.getFolders(...) or IGImageLocalServiceUtil.getImages(...) . Final you must get the image id ,the rest can be easily handled.


ITs's necessary to create a folder.. a don't need it..
only need save photos on the table image. and the idImage will be associate on other that I'll create..

how i can do it?'

thanks
wencheng ma
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a
April 7, 2011 8:49 PM
Answer

wencheng ma

Rank: New Member

Posts: 23

Join Date: March 14, 2011

Recent Posts

To facilitate the management to create the folder.

you can try it , query the table , You can understand their relationship
Melvin Rodriguez Rojas
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a
April 16, 2011 7:18 PM
Answer

Melvin Rodriguez Rojas

Rank: Junior Member

Posts: 50

Join Date: February 4, 2011

Recent Posts

Ray Augé:
Iterating over and displaying images in an IGFolder:


 1    <%
 2         long folderId = ...
 3
 4    IGFolder folder = IGFolderServiceUtil.getFolder(folderId);
 5
 6    List images = IGImageLocalServiceUtil.getImages(folder.getFolderId());
 7
 8    for    (int i = 0; i < images.size(); i++) {
 9        IGImage image = (IGImage)images.get(i);
10    %>
11
12        <img src="<%= themeDisplay.getPathImage() %>/image_gallery?img_id=<%=
13image.getLargeImageId() %>&t=<%=
14ImageServletTokenUtil.getToken(image.getLargeImageId()) %>" />
15
16    <%
17    }
18         %>


Getting a single image and displaying it:

 1 <%
 2         long imageId = ...
 3
 4         IGImage image = IGImageLocalServiceUtil.getIGImage(imageId);
 5         %>
 6
 7         <img src="<%= themeDisplay.getPathImage() %
 8>/image_gallery?img_id=<%= image.getLargeImageId() %>&t=<%=
 9ImageServletTokenUtil.getToken(image.getLargeImageId()) %>" />
10


HTH!




With this code I can read a single image all folder image.. great emoticon


Now I need help creating this folders and inserting the images??

How i can create a folder and then insert images on it..???

Thanks
Praveen P
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a
April 26, 2012 1:56 AM
Answer

Praveen P

Rank: Regular Member

Posts: 100

Join Date: February 20, 2012

Recent Posts

Ray Augé:
Iterating over and displaying images in an IGFolder:


 1    <%
 2         long folderId = ...
 3
 4    IGFolder folder = IGFolderServiceUtil.getFolder(folderId);
 5
 6    List images = IGImageLocalServiceUtil.getImages(folder.getFolderId());
 7
 8    for    (int i = 0; i < images.size(); i++) {
 9        IGImage image = (IGImage)images.get(i);
10    %>
11
12        <img src="<%= themeDisplay.getPathImage() %>/image_gallery?img_id=<%=
13image.getLargeImageId() %>&t=<%=
14ImageServletTokenUtil.getToken(image.getLargeImageId()) %>" />
15
16    <%
17    }
18         %>


Getting a single image and displaying it:

 1 <%
 2         long imageId = ...
 3
 4         IGImage image = IGImageLocalServiceUtil.getIGImage(imageId);
 5         %>
 6
 7         <img src="<%= themeDisplay.getPathImage() %
 8>/image_gallery?img_id=<%= image.getLargeImageId() %>&t=<%=
 9ImageServletTokenUtil.getToken(image.getLargeImageId()) %>" />
10


HTH!


Hello sir,
how to get folderId? i used the folder name as wish list, how to get the images from that folder to other portlet?

thanks in advance
Jitendra Rajput
RE: Get Image from Image Gallery in a portlet plugin
April 26, 2012 10:36 PM
Answer

Jitendra Rajput

Rank: Liferay Master

Posts: 858

Join Date: January 7, 2011

Recent Posts

Use

1IGFolderLocalServiceUtil.getFolder(groupId, 0, folderName);
Praveen P
RE: Get Image from Image Gallery in a portlet plugin
April 26, 2012 11:48 PM
Answer

Praveen P

Rank: Regular Member

Posts: 100

Join Date: February 20, 2012

Recent Posts

Thanks for your replay, i use the tag but still lot of errors in jsp, i think i am missing with some import statements,
Please can you explain in detail how to get images from image gallery by this code?


Thank you
Neil Francese
RE: Re: [Liferay Forums][3. Development] Get Image from Image Gallery in a
September 14, 2012 4:25 PM
Answer

Neil Francese

Rank: New Member

Posts: 1

Join Date: September 14, 2012

Recent Posts

How would you also show/change the star ratings related to an image in a custom portlet?