Forums de discussion

Insert a liferay portlet into Primeface dialog

Rounak Dasgupta, modifié il y a 10 années.

Insert a liferay portlet into Primeface dialog

New Member Publications: 4 Date d'inscription: 13/05/13 Publications récentes
Hi all,

I'm using liferay 6.1, jsf 2 and primeface 4.0. I've two different project running on a liferay tomcat. I want to insert a portlet of "Project 1" into primefaces dialog of "project 2".

I tried by using ui:insert, but it takes the source path of current project. Can anyone give a suggestion how to proceed in this scenario?

Thanks in advance.
thumbnail
Neil Griffin, modifié il y a 10 années.

Moved to Liferay Faces - English sub-category.

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
Moved to Liferay Faces - English sub-category.
thumbnail
Neil Griffin, modifié il y a 10 années.

RE: Insert a liferay portlet into Primeface dialog

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
If you are using JSF 2.1, then I think you would need to develop a monolithic WAR project that contains two portlets, rather than two separate WAR projects each containing a single portlet.

If you are using JSF 2.2, then you might be able to utilize the Resource Library Contracts feature.
Rounak Dasgupta, modifié il y a 10 années.

RE: Insert a liferay portlet into Primeface dialog

New Member Publications: 4 Date d'inscription: 13/05/13 Publications récentes
Hi Neil,

I'm using jsf2.1. Actually both project having 12-15 portlet. And I want to reuse only one portlet in another project. So creating a different war, I think will not be a good idea in my scenario.
thumbnail
Neil Griffin, modifié il y a 10 années.

RE: Insert a liferay portlet into Primeface dialog

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
There is a liferay-portlet:runtime JSP tag that comes with Liferay Portal. However, we don't have a Facelets equivalent of this tag at this time in Liferay Faces.

If you look at the Liferay Portal 6.2 source code for RuntimeTag.java, it ends up calling the following utility method:

PortletContainerUtil.render(request, response, portlet);

(Prior to Liferay 6.2, I think this was called RuntimePortletUtil)

I don't know if this will work, but you might be able to call this method using the request/response that come from PortalUtil.getHttpServletRequest(PortletRequest) and PortalUtil.getHttpServletResponse(PortletResponse) in order to get the other portlet to render.
thumbnail
Marco Endres, modifié il y a 9 années.

RE: Insert a liferay portlet into Primeface dialog

Regular Member Publications: 112 Date d'inscription: 22/08/12 Publications récentes
How do you call the Portlet from the JSF? Which tag?

Thanks
thumbnail
Neil Griffin, modifié il y a 9 années.

RE: Insert a liferay portlet into Primeface dialog

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
At this time, there is no Facelet component tag for doing this. I suppose that you could develop a new Java-based custom component, then inside the custom Java-based Renderer, you can try calling PortletContainerUtil.render(request, response, portlet).
thumbnail
Juan Gonzalez, modifié il y a 9 années.

RE: Insert a liferay portlet into Primeface dialog

Liferay Legend Publications: 3089 Date d'inscription: 28/10/08 Publications récentes
Hi,

very good news! New portal:runtime is implemented as part of this ticket:

https://issues.liferay.com/browse/FACES-2044

You can check it out in the Liferay Faces SNAPSHOT repository:

https://oss.sonatype.org/content/repositories/snapshots/com/liferay/faces/

for 3.2.x and 4.2.x versions.

If you have any problem, please let us now.