Portlet Data sharing using liferay and icefaces
I am using liferay 1.8.2 and liferay 5.2. I have many portlets in different war files and I tried the examples in the liferay docs as to how to share data between differenet portlets across multiple wars with no success.
- With sesssion sharing , I was not able to get the data from the first portlet to the second portlet, even thou the data was in the portletsession application scope.
- When I use the even based mechanism, I get an error when I use the
<portlet:defineObjects /> and <portlet:actionURL />
tags
Caused by: javax.faces.FacesException: Failed to execute JSP lifecycle.
at com.icesoft.faces.webapp.parser.Parser.parse(Parser.java:181) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:439) ... 189 more Caused by: javax.servlet.jsp.JspException: java.lang.reflect.InvocationTargetException at com.liferay.taglib.portlet.ActionURLTag.doEndTag(ActionURLTag.java:212) at com.icesoft.faces.webapp.parser.Parser.executeJspLifecycle(Parser.java:246) at com.icesoft.faces.webapp.parser.Parser.executeJspLifecycle(Parser.java:229) at com.icesoft.faces.webapp.parser.Parser.executeJspLifecycle(Parser.java:229) at com.icesoft.faces.webapp.parser.Parser.executeJspLifecycle(Parser.java:229) at com.icesoft.faces.webapp.parser.Parser.executeJspLifecycle(Parser.java:229) at com.icesoft.faces.webapp.parser.Parser.executeJspLifecycle(Parser.java:229) at com.icesoft.faces.webapp.parser.Parser.executeJspLifecycle(Parser.java:229) at com.icesoft.faces.webapp.parser.Parser.executeJspLifecycle(Parser.java:229) at com.icesoft.faces.webapp.parser.Parser.parse(Parser.java:162) ... 190 more Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.liferay.portal.kernel.util.MethodInvoker.invoke(MethodInvoker.java:180) at com.liferay.portal.kernel.util.MethodInvoker.invoke(MethodInvoker.java:49) at com.liferay.taglib.portlet.ActionURLTag.doTag(ActionURLTag.java:179) at com.liferay.taglib.portlet.ActionURLTag.doEndTag(ActionURLTag.java:200) ... 199 more Caused by: javax.servlet.jsp.JspException:开发者_如何学Go java.lang.UnsupportedOperationException at com.liferay.portal.servlet.taglib.portlet.ActionURLTagUtil.doEndTag(ActionURLTagUtil.java:174) ... 207 more Caused by: java.lang.UnsupportedOperationException at com.icesoft.faces.webapp.parser.StubHttpServletRequest.getAttribute(StubHttpServletRequest.java:116) at com.liferay.portal.servlet.taglib.portlet.TagUtil.getPortletName(TagUtil.java:100) at com.liferay.portal.servlet.taglib.portlet.ActionURLTagUtil.doEndTag(ActionURLTagUtil.java:68)
Can anybody suggest with detailed explaination and sample code, how I can achieve IPC between portlets residing across different WAR
Inter Portlet Commuication (IPC) is not possible across different WARs using IceFaces 1.8.x.
It will be possible when IceFaces 2.0 is out, an Alpha is already available.
However, it is possible to do some sort of IPC using IceFaces 1.8.x. The "Advanced Topics" chapter of the Icefaces Develpers Guide covers this topic:
The use of Ajax Push allows portlets to be updated based on server-side events that change the state of the current view. This can be a powerful feature that can also be leveraged to do a form of interportlet communication (IPC) in certain configurations.
IPC is only mentioned in the Portlet 1.0 spec (JSR 168) but is formally defined in the Portlet 2.0 specification (JSR 286).
It is architected as an Event/Listener model. However, it is possible to use the ICEfaces Ajax Push mechanism to update portlets based on changes to the underlying model. The way to do this currently with ICEfaces is to:
- Deploy the portlets that need to communicate in the same archive (.war file).
- Use application-scoped beans to manage shared state between the
portlets.- Use the ICEfaces Ajax Push feature to trigger client updates
when the shared state changes.- For an example of how to do this, review the sample ICEfaces Chat portlet.
精彩评论