掲示板

How to imped portlet inside jsf portlet ?

11年前 に Hebatu Allah Fahmy によって更新されました。

How to imped portlet inside jsf portlet ?

Junior Member 投稿: 41 参加年月日: 12/08/06 最新の投稿
Please , How can we imped portlet (e.g web content ) inside JSF portlet ?

Any help will be appreciated

Thanks in Advance
thumbnail
11年前 に Dominik domih によって更新されました。

RE: How to imped portlet inside jsf portlet ?

Junior Member 投稿: 57 参加年月日: 08/11/10 最新の投稿
A possible solution could be to add a portlet widget to your portlet. This lets you show a portlet without the portal around it. See the iframe portlet code for details...
thumbnail
11年前 に Neil Griffin によって更新されました。

RE: How to imped portlet inside jsf portlet ?

Liferay Legend 投稿: 2655 参加年月日: 05/07/27 最新の投稿
Another solution would be to use the Liferay Service Layer API in order to retrieve the web content article, and then use a JSF view to display the results. For more information, see related forum post.
11年前 に Hebatu Allah Fahmy によって更新されました。

RE: How to imped portlet inside jsf portlet ?

Junior Member 投稿: 41 参加年月日: 12/08/06 最新の投稿
Many Thanks Neil

Actually I don't want the content , I want to embed the portlet it self (asset Publisher ) to make use of its configuration that liferay provides instead of re-programmatic it from the beginning .
e.g I want to to get contents belongs to certain category or more than category , I want to change its template easy in any time
By getting the content only in my plugin portlet I am forced to re-write code to achieve that and of course it will not provide the dynamic in configuration like asset publisher provides .

so I was thinking and asking if there is a way to include the instance portlet of asset publisher itself in my portlet ?


I have write the following and when user clicks on link it renders on asset publisher portlet , but I don't know how to make the asset publisher appears without user click

<%
ThemeDisplay themeDisplay1 = (ThemeDisplay)request.getAttribute(com.liferay.portal.kernel.util.WebKeys.THEME_DISPLAY);
Layout layout1 = themeDisplay1.getLayout();
long plid1 = layout1.getPlid() ;
/*PortletURL ipcURL = new PortletURLImpl(request, "101", plid1, PortletRequest.ACTION_PHASE);*/

PortletURL ipcURL = PortletURLFactoryUtil.create(request, "101", plid1, "ACTION_PHASE");


ipcURL.setWindowState(WindowState.MAXIMIZED);
%>
<br/>
<a href="<%=ipcURL.toString()%>">Page Template Portlet</a>


any help will be appreciated

Thanks in advance
thumbnail
11年前 に Neil Griffin によって更新されました。

RE: How to imped portlet inside jsf portlet ?

Liferay Legend 投稿: 2655 参加年月日: 05/07/27 最新の投稿
Along the lines of what Dominik suggested, you could try using the following in a simple JSP portlet:

<liferay-portlet:runtime portletName="<%= portletId %>" />


There is no Facelets equivalent yet, but the tag *might* work in a JSF2 portlet that uses JSP as the view declaration language, rather than Facelets.
11年前 に Hebatu Allah Fahmy によって更新されました。

RE: How to imped portlet inside jsf portlet ?

Junior Member 投稿: 41 参加年月日: 12/08/06 最新の投稿
I have tried it

with portlet Id
portlet_101_INSTANCE_XaF30gFyQsyD

or portletId
101


both of them gives the following exception
An error occurred while accessing the requested resource.

http://localhost:8080/web/guest/home?p_p_id=58&p_p_lifecycle=0&p_p_state=normal&p_p_state_rcv=1&_58_struts_action=%2Flogin%2Flogin

is there is a way get portlet Id ?
thumbnail
11年前 に Neil Griffin によって更新されました。

RE: How to imped portlet inside jsf portlet ?

Liferay Legend 投稿: 2655 参加年月日: 05/07/27 最新の投稿
OK I just tried it in a few different ways:

1) Liferay 6.0.6 - Result - DOESN'T WORK emoticon

Here is the error I get:

Caused by: java.lang.ClassNotFoundException: com.liferay.portlet.layoutconfiguration.util.RuntimePortletUtil
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
	at com.liferay.taglib.portletext.RuntimeTag.doTag(RuntimeTag.java:108)
	at com.liferay.taglib.portletext.RuntimeTag.doEndTag(RuntimeTag.java:135)


This indicates that the liferay-portlet:runtime JSP tag can only be used in the ROOT context where Liferay's out-of-the-box portlets live, and not in a different context, such as a hot deployable portlet WAR.

2) Liferay 6.1.1 - Result: IT DOES INDEED WORK! emoticon

I started with the jsf2-jsp-portlet demo and replaced the contents of the src/main/webapp/views/portletViewMode.xhtml JSP view with the following:

<!--?xml version="1.0" encoding="UTF-8"?-->
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:liferay-portlet="http://liferay.com/tld/portlet" version="2.1">
    <jsp:directive.page contentType="text/html" pageEncoding="UTF-8" />
    <liferay-portlet:runtime portletName="101" />
</jsp:root>
10年前 に Robert Kornmesser によって更新されました。

RE: How to imped portlet inside jsf portlet ?

Junior Member 投稿: 39 参加年月日: 11/11/03 最新の投稿
Any news on how to solve this problem with facelets?

I would like to inclode social office portlet (notifications counter and message box) in my facelet.
thumbnail
9年前 に Juan Gonzalez によって更新されました。

RE: How to imped portlet inside jsf portlet ?

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Hebatu Allah Fahmy:
Please , How can we imped portlet (e.g web content ) inside JSF portlet ?

Any help will be appreciated

Thanks in Advance


Hi Hebatu,

Hi,

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.

You can check the showcase (here: https://github.com/liferay/liferay-faces/blob/master/demos/showcase/showcase-portlet/src/main/webapp/component/portal/runtime/multiple-instances/runtime.xhtml and here: https://github.com/liferay/liferay-faces/blob/master/demos/showcase/showcase-portlet/src/main/java/com/liferay/faces/demos/bean/RuntimeBacking.java) to know how to render web contents within a JSF portlet.

If you have any problem, please let us now.

Enjoy!