1
votes

Hello and thanks for taking the time to answer my question.

I have a custom portlet with a typical file upload html element. However, I was told that the user should be able to select already uploaded images and not upload new images. At the moment I am loading a web content display portlet on a random page, click on image icon in the rich text editor and copy the link in the javascript of my portlet, which opens the image gallery in a pop-up, in order to access the image gallery. However, this is not a plausible solution for production and I was wondering how I can load the image gallery from a custom portet. I need to be able to see the image gallery open in a pop-up with a user clicks Select an Image button.

Thanks in advance!

1
This isn't how this site works. We're about specific answers to specific questions. Try to solve the problem, then post your code. - Tony Ennis
how is this not a legit question? - user1170949
Your question is "do my work for me" versus "what is wrong with what I have done", is it not? You seem to know what you want to do, which is good, but there's no code. That being said, you seem to be doing something clever to find the link to the image gallery. Does the URL change arbitrarily? - Tony Ennis
In the asker's defense... Liferay code is often vacuously documented, and presented only with proof of concept style examples. - trognanders

1 Answers

1
votes

This code is enough to do this:

List<IGFolder> listIGFolders = null;        

if(selectedFolderId!=0){
    listIGFolders=IGFolderLocalServiceUtil.getFolders(groupId, selectedFolderId);
} else{
    listIGFolders = IGFolderLocalServiceUtil.getFolders(groupId);   
}

List<IGImage> igImages=IGImageLocalServiceUtil.getImages(groupId, selectedFolderId);