JSR286 : Public Render Parameter feature (updated)
When the Java Portlet Specification(JSR 286) early draft was released last year, i had written a blog on Public Render Parameter feature. Recently the proposed final draft was released, it has some changes in public render parameter feature. In this blog i will explain the feature with an example.
In JSR 168, the render parameters set in processAction is only available in the render of the same portlet.
With the Public Render Parameters feature, the render parameters set in the processAction of one portlet will be available in render of other portlets also. Using public render parameters instead of events avoids the additional process event call.
In order to allow coordination of render parameters with other portlets, within the same portlet application or across portlet applications, the portlet can declare public render parameters in its deployment descriptor using the public-render-parameter element in the portlet application section. Public render parameters can be viewed and changed by other portlets or components.
In the portlet section each portlet can specify the public render parameters it would like to share via the supported-public-render-parameter element. The supported-public-render-parameter element must reference the identifier of a public render parameter defined in the portlet application section in a public-render-parameter element.
In the code, the portlets should use the defined public render parameter identifier to access the public render parameter(new addition in the proposed final draft).
To create portlets that use the public render parameters, follow these steps(snippets from WeatherMap sample application):
1. Declare the render parameters to be shared in the portlet.xml file by setting the public render parameters at the portlet application level.
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
id="myPortletApp" version="2.0">
<portlet>
. . .
</portlet>
<public-render-parameter>
<identifier>zip-id</identifier>
<qname xmlns:x="http://sun.com/params">x:zip</qname>
</public-render-parameter>
</portlet-app>
2. Specify the render parameter that the portlet would like to share in the portlet section.
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
id="myPortletApp" version="2.0">
<portlet>
<description>WeatherPortlet</description>
<portlet-name>WeatherPortlet</portlet-name>
<display-name>WeatherPortlet</display-name>
<portlet-class>com.sun.portal.portlet.WeatherPortlet</portlet-class>
......
<supported-public-render-parameter>zip-id</supported-public-
render-parameter>
</portlet>
<portlet>
<description>MapPortlet</description>
<portlet-name>MapPortlet</portlet-name>
<display-name>MapPortlet</display-name>
<portlet-class>com.sun.portal.portlet.MapPortlet</portlet-class>
. . .
<supported-public-render-parameter>zip-id</supported-public-
render-parameter>
</portlet>
. . .
</portlet-app>
3. Set the render parameter in the processAction() method:
public class WeatherPortlet extends GenericPortlet {
. . .
public void processAction(ActionRequest req, ActionResponse res)
throws IOException, PortletException {
. . .
res.setRenderParameter("zip-id", zip);
}
. . .
}
You can download the binary WeatherMap.war
file to deploy and run the sample application in OpenPortal Portlet Container 2.0 Beta2 (or latest). You can also get the source for the sample. If you are behind a firewall you need need to set the proxy in the webcontainer configuration.
The figure shows the Weather and Map portlets. The Weather portlet sets the zip-id which is declared as a Public Render Parameter. This parameter is supported by both Weather and Map portlets. Any change in the value of zip by Weather portlet is reflected during the render phase of both weather and map portlets.
asdadqargf
Posted by asd on September 08, 2008 at 12:51 PM IST #
Can Public Render Parameter support be used in JSF portlet?
Posted by Franky on October 06, 2008 at 03:04 PM IST #
Yes you can. But for that you need to set a config parameter in the portlet.xml(https://jsfportletbridge.dev.java.net/issues/show_bug.cgi?id=30). By doing so render parameters are available and if deployed in OpenPortal Portlet Container 2.0, other jsf portlets will also get the parameter. Let me know if you face any problems.
Posted by Deepak Gothe on October 06, 2008 at 03:49 PM IST #
Hi Deepak,
I'm using the public render parameters since a few days (in Liferay) and I came across a thing which I don't understand.
In which portlet app should the param be defined (the public-render-parameter element)? In the one which reads the param or the one which sets the param at the response?
I was pretty sure that I should do that on the portlet which sets the param but it only seems to work in Liferay when I define the param in the consuming portlet.
Posted by Rob Sonke on October 08, 2008 at 01:52 PM IST #
Hi Rob,
Unlike Eventing where there is specific element for processing and publishing, for Public Render Parameters, the same element is used for both set/get. Is your question related to two portlet apps... If one portlet app wants to set and other portlet app wants to receive then the definition should be in both.
Posted by Deepak Gothe on October 09, 2008 at 12:15 PM IST #
Ah that explains it. We're using two portletapps right, loaded as plugins with a different portlet.xml
Thanks for your answer.
Posted by Rob Sonke on October 09, 2008 at 12:19 PM IST #
Related to getting this working in JSF, can you please explain more what you mean by config parameter in portlet.xml ?
Drop a line or two of example. (Using Liferay + Tomcat)
Posted by Petar on October 16, 2008 at 05:04 AM IST #
I will try blog about it with an example sometime by the end of this week.
Meanwhile..
Suppose you want share the parameter "param1".
1. You need to add the following to your portlet.xml
<init-param>
<name>com.sun.faces.portlet.SAVE_REQUEST_SCOPE</name>
<value>true</value>
</init-param>
2. And you need to add public render parameter definition for param1 in the portlet.xml.
Posted by 192.18.192.21 on October 16, 2008 at 09:52 AM IST #
I have blogged about the support for public render parameter in jsf portlet. You can check the blog - http://blogs.sun.com/deepakg/entry/jsf_portlet_and_public_render
Posted by Deepak Gothe on October 19, 2008 at 11:56 PM IST #
I am investigating whether sun FacesPortlet class would allow this or I need to subclass. Any hints?
What are the chances that this mod enters specification?
I could show you my current work related, I would be gratefull if you contact me.
Posted by Amy on November 07, 2008 at 07:06 PM IST #
As mentioned in the blog ( http://blogs.sun.com/deepakg/entry/jsf_portlet_and_public_render ), the current jsf portlet bridge 1.2.3 does support public render parameter. You can send a mail about you work to dev@jsfportletbridge.dev.java.net . Thanks.
Posted by Deepak Gothe on November 08, 2008 at 12:59 AM IST #
I am trying to use the public render parameters as explained above, It does not work. Here is what i want I wanted to retrieve a parameter set in the url on page for all portlets during the doView() method. How can get the query params set in the url in the doView() method, so that I can use that in the portlets that wanted to use that param in a page. For eg: I want to get the info of a person using the id passed and wanted to use that in 5 portlets on a page although there are 10 portlets on that page.
As per your blog it should be possible. but it does not work.. Any thoughts
THanks
Posted by satya on January 14, 2009 at 06:31 AM IST #
What you want is access to query parameters..right? Looks like the issue https://portlet-container.dev.java.net/issues/show_bug.cgi?id=160 . This should be available in the next release of Portlet Container.
Posted by Deepak on January 19, 2009 at 02:53 PM IST #
Hi all, I'm using the public render parameters since a few days (in Liferay), but it does not work for me, the only one difference with the examples is that i use a class to do the doView, i'm not use jsp's, i have to do something else for use public render parameters????
Posted by Julián Poveda on January 25, 2009 at 03:33 AM IST #
Hi, using public render parameters in either doView or JSPs is the same. Does your application work on OpenPortal Portlet Container? In Liferay you need to add the following property to portal-ext.properties.Setting this property allows Liferay to use OpenPortal Portlet Container implementation.
portlet.container.impl=sun
Posted by Deepak on January 27, 2009 at 10:58 AM IST #
Hi Deepak,
Can I use this feature in Liferay (Version - 5.2.2). I have deployed these portlets. Simplified above portlets just to print the received zip-id. But the portlets are unable to access the parameter specified in the url (http://server:8080/web/guest/sample?zip-id=200). Or am I missing some thing?
Posted by Ganesh Gembali on March 30, 2009 at 05:31 PM IST #
Hi Ganesh,
You are trying to send the portal query parameter and expecting the portlet to read it. Portlet cannot access the portal query parameters. In your portlet if you access request.getParameter("zip-id"), it will return null. But this can be handled by adding the following in sun-portlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<portlet-app-extension xmlns="http://www.sun.com/software/xml/ns/portal_server"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:sunportal="http://www.sun.com/software/xml/ns/portal_server"
xsi:noNamespaceSchemaLocation="http://www.sun.com/software/xml/ns/portal_server"
version="2.0">
<portlet>
<portlet-name>your-portlet-name-same-as-in-portlet.xml</portlet-name>
<portal-query-parameters>
<name>zip-id</name>
</portal-query-parameters>
</portlet>
</portlet-app-extension>
In order to use OpenPortal Portlet Container implementation in Liferay, set the below property in portal-ext.properties and redeploy the portlet wars.
portlet.container.impl=sun
Posted by Deepak Gothe on March 30, 2009 at 06:13 PM IST #
I am using LR5.1.1 version.
I am trying to communicate between existing portlet and custom portlet using the example given by You.
communication between 2 custom portlets is working using <public-render-parameter>
But communication between exisitng portlet(Eg:Journal_Articles) and custom portlet using <public-render-parameter> is not working
Posted by Swarna on April 23, 2009 at 02:03 PM IST #
Most of the existing portlets do not support public render parameters OOTB. If you look at portlet-custom.xml in liferay portal webapp, you will see that they do not have supported-public-render-parameter tag. Hence its not working.
Posted by Deepak Gothe on April 24, 2009 at 11:37 AM IST #
Hi Deepak,
I read your blogs about IPC 286, and they are all well written. I am new to portal development and am having a situation where I have to redirect to a different portlet on button click and also carry the parameters in a session, say name and description from the first portlet to the second one. Both these portlets are in the same war file. I don't think Public render feature will be helpful in my case. Can you please tell me if I can find any tutorials for a similar situation?
Thanks
Posted by laxmi on May 01, 2009 at 11:45 PM IST #
Hi,
Can you clarify few things..when you say redirect from first portlet to second portlet are you saying that the second portlet should replace the first portlet after button click. Why do you want to carry the parameters in a session. If you want to carry name and description from first portlet to the second portlet you can use public render parameter. Why do you think public render parameter will not be helpful in your case?
Regards,
Deepak
Posted by Deepak Gothe on May 02, 2009 at 04:17 PM IST #
Hi Deepak,
Iam using the Liferay5.2 with netbeans and i want to use public render parameter.but iam getting the null values.I have written like this
<portlet>
<portlet-name>Publisher</portlet-name>
<portlet-class>
com.test.Sender
</portlet-class>
<portlet-info>
<title>Publisher
</title>
<short-title>Publisher
</short-title>
</portlet-info>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<supported-public-render-parameter>
myname
</supported-public-render-parameter>
<supported-locale>en</supported-locale>
</portlet>
<portlet>
<portlet-name>Receiver
</portlet-name>
<portlet-class>
com.test.Receiver
</portlet-class>
<portlet-info>
<title> Receiver
</title>
<short-title> Receiver
</short-title>
</portlet-info>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<supported-public-render-parameter>
myname
</supported-public-render-parameter>
<supported-locale>en</supported-locale>
</portlet>
<public-render-parameter>
<identifier>myname</identifier>
<qname xmlns:x="http://www.liferay.com/public-render-parameters">x:public-render-param</qname>
</public-render-parameter>
Sender.java
public class Sender extends GenericPortlet {
. . . . . .
public void processAction(ActionRequest actionRequest,
ActionResponse actionResponse) throws PortletException, IOException {
String myname = actionRequest.getParameter("myname");
actionResponse.setRenderParameter("myname", myname);
}
public void doview(RenderRequest renderRequest,
RenderResponse renderResponse) throws PortletException, IOException {
PortletRequestDispatcher portletRequestDispatcher = portletConfig
.getPortletContext().getRequestDispatcher(
"/WEB-INF/jsp/view.jsp");
portletRequestDispatcher.include(renderRequest, renderResponse);
}
. . . . .
}
Receiver.java
public class Receiver extends GenericPortlet {
. . . . .
public void doview(RenderRequest renderRequest,
RenderResponse renderResponse) throws PortletException, IOException {
PortletRequestDispatcher portletRequestDispatcher = portletConfig
.getPortletContext()
.getRequestDispatcher(
"/WEB-INF/jsp/showParameter.jsp");
portletRequestDispatcher.include(renderRequest, renderResponse);
}
view.jsp
<%@taglib prefix="portlet" uri="http://java.sun.com/portlet_2_0"%>
<portlet:defineObjects />
<form action="<portlet:actionURL/>" name="form" method="post">
<input type="text" name="myname"> <input type="submit" value="submit">
</form>
showParameter.jsp
<%@taglib prefix="portlet" uri="http://java.sun.com/portlet_2_0"%>
<portlet:defineObjects />
<%=renderRequest.getParameter("myname")%>
Iam using the netbeans please can u say me what is the wrong here
waitng for ur helppppppp
Posted by Srinivas on June 03, 2009 at 03:56 PM IST #
The code snippet looks ok. What is the webcontainer? Do you see any exceptions?
Can you try with Sun Portlet Container. You can do that by adding portal-ext.properties to WEB-INF/classes of liferay-portal webapp and setting the property portlet.container.impl=sun. You need to redeploy the webapp after restarting liferay.
Posted by Deepak on June 03, 2009 at 04:18 PM IST #
Hi Deepak,
iam using Liferay Portal Server 5.1.x/5.2.x with glassfishv2
and i didnot find the sun-portal.xml file also
and in web\WEB-INF
ihave only liferay-display.xml
liferay-plugin-package.properties
liferay-portlet.xml
portlet.xml
web.xml
and in the liferay-plugin-package.properties i have this code
#liferay-plugin-package.properties
#Tue Jun 02 18:37:21 CEST 2009
portal.dependency.jars=commons-logging.jar
tags=portlet
so i should add sun-portal.xml and port-ext.properties to it
please can you help for thissss
and when i tried this example in opencontainer it worked for me
Posted by Srinivas on June 03, 2009 at 05:00 PM IST #
Create a file called "portal-ext.properties" and add the following line in it.
portlet.container.impl=sun
Copy this file to domains/domain1/applications/j2ee-modules/liferay-portal/WEB-INF/classes. Then restart liferay. After this is done, you need to redeploy the the portlet.
Posted by Deepak on June 03, 2009 at 05:07 PM IST #
Hi Deepak,
C:\liferayportalGF522\glassfish\domains\domain1\applications\liferay-portal\WEB-INF\classes\portal-ext.properties
is already existed here so i copied this line
portlet.container.impl=sun
and restarted the server.But still iam geeting nullvalue only so i should add any more new thing to it.But i did not create sun-portal.xml file in my project
Eagrly waiting for ur reply
Posted by Srinivas on June 03, 2009 at 10:11 PM IST #
There is no need to add sun-portlet.xml . Did you redeploy the portlet war after restarting the server?
Posted by Deepak on June 03, 2009 at 10:29 PM IST #
Hi Deepak,
i just redployed the war file again.but in my container it is saying that the war file is undeployed .
So please can you say step by step to do this in liferay.
Posted by Srinivas on June 03, 2009 at 11:40 PM IST #
Can you send your NB project to users@portlet-container.dev.java.net? Thanks. I will quickly try and give you step by step info.
Posted by Deepak on June 04, 2009 at 10:21 AM IST #
Hi Deepak,
I have Posted the project to ur Email
Posted by Srinivas on June 04, 2009 at 02:21 PM IST #
Did you try the PortalSR.war on OpenPortletContainer 2.1? The portlet.xml is not according to the portlet 2.0 schema. When you deploy on OpenPortletContainer 2.1, it will immediately tell you that its not according to XSD. In case of Liferay, you need to check the server logs. You will see that there is an exception "Invalid content was found....". The <supported-public-render-parameter> should be after </portlet-info> tag in both PortalS and PortalR. Make this change and your portlet will start working.
Posted by Deepak on June 04, 2009 at 05:03 PM IST #
Hi Deepak,
Thanks For ur Help,I got the answer and iam very much pleased by ur replies.
can i contact u if i have any more doubts regarding liferay.
Posted by srinivas on June 04, 2009 at 05:44 PM IST #
Good to know that it worked for you. If you are facing problems using Webspace Server you can send a mail to users@webspace.dev.java.net , if you faces problems using Liferay you can pose queries in Liferay forums. Your queries and our responses will be help others in the community who face similar problems.
Posted by Deepak on June 04, 2009 at 05:59 PM IST #
Hi Deepak,
I have one more doubt regarding this .Now iam communicating the portlet form one to another .my simple doubt is that can i communicate means can i redirect form one portal page to another.with these communications i am staying only in one page.From my portlet publisher i want to redirect to portlet receiver can this possible using the renderparameter .if u have any please can u post
Posted by srinivas on June 09, 2009 at 09:46 PM IST #
From the portlet publisher if you want to invoke sendRedirect, this can happen in processAction , but it will be action parameters and not render parameters.
Posted by Deepak on June 10, 2009 at 01:13 PM IST #
Hi Deepak,
Can you give me an example for the sendRedirect
Posted by srinivas on June 10, 2009 at 05:30 PM IST #
Hi Deepak,
I have a query regarding the usage of Public Render Parameter, in one of the requirement,
Background:
I have a portal page which contains multiple portlets .
When Page loads ., all portlets tries to get the information from back-end. If any portlet encounters serious exception.,the other portlet has to be communicated ., so that second-portlet render the error message.!
Can we use public render parameter here..? or do we need to use diff mechanism ?
Please note that: This should happen on page load. , there is no explicit user-action involved.
Posted by Karnam on June 28, 2009 at 02:39 AM IST #
Hi Deepak,
I have a query regarding the usage of Public Render Parameter, in one of the requirement,
Background:
I have a portal page which contains multiple portlets .
When Page loads ., all portlets tries to get the information from back-end. If any portlet encounters serious exception.,the other portlet has to be communicated ., so that second-portlet render the error message.!
Can we use public render parameter here..? or do we need to use diff mechanism ?
Please note that: This should happen on page load. , there is no explicit user-action involved.
Posted by Karnam on June 28, 2009 at 02:52 AM IST #
When the portlet encounters serious exception how does it update the portlet? If a renderURL targetted to a portlet has a public render parameter, then all portlets interested in that will be updated.
Posted by Deepak on June 29, 2009 at 11:56 AM IST #
Hi Deepak, i now working on LR 5.2.2, i need to pass parameter from portlet A to portlet B in same page,
but portlet B seem renderRequest.getParameter('blah') is return null,
<portlet>
<portlet-name>category</portlet-name>
<display-name>Category</display-name>
<portlet-class>com.liferay.portlet.StrutsPortlet</portlet-class>
<init-param>
<name>view-action</name>
<value>/ext/category/view</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>edit</portlet-mode>
</supports>
<resource-bundle>com.liferay.portlet.StrutsResourceBundle</resource-bundle>
<supported-public-render-parameter>categoryId</supported-public-render-parameter>
</portlet>
<portlet>
<portlet-name>list</portlet-name>
<display-name>Listing</display-name>
<portlet-class>com.liferay.portlet.StrutsPortlet</portlet-class>
<init-param>
<name>view-action</name>
<value>/ext/listing/view</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>edit</portlet-mode>
</supports>
<resource-bundle>com.liferay.portlet.StrutsResourceBundle</resource-bundle>
<supported-public-render-parameter>categoryId</supported-public-render-parameter>
</portlet>
<public-render-parameter>
<identifier>categoryId</identifier>
<qname xmlns:x="http://www.liferay.com/public-render-parameters">x:categoryId</qname>
</public-render-parameter>
this is my portlet-ext.xml,
how to set the parameter so that portlet can get the value ?
i am using rendering
my class is extend com.liferay.portal.struts.PortletAction
thanks
Posted by chiochuan on July 13, 2009 at 12:08 PM IST #
You should set render parameter in processAction method. You need to override the processAction method of com.liferay.portal.struts.PortletAction
Posted by Deepak on July 13, 2009 at 12:27 PM IST #
Hi
i have override the processAction
sender java file
public class CategoryViewAction extends PortletAction {
public void processAction(
ActionMapping mapping, ActionForm form, PortletConfig portletConfig,
ActionRequest actionRequest, ActionResponse actionResponse)
throws Exception {
String categoryId = actionRequest.getParameter("categoryId");
actionResponse.setRenderParameter("categoryId", categoryId);
}
}
receiver java file
public class ListViewAction extends PortletAction {
public ActionForward render(
ActionMapping mapping, ActionForm form, PortletConfig portletConfig,
RenderRequest renderRequest, RenderResponse renderResponse)
throws Exception {
System.out.println("categoryId " +
renderRequest.getParameter("categoryId"));
return mapping.findForward("portlet.ext.listing.view");
}
}
but in receiver, it also return null ...
is there anywhere i miss out ?
Posted by chiochuan on July 13, 2009 at 12:38 PM IST #
Have you tried in normal portlets, not in StrutsPortlet?
Posted by Deepak on July 13, 2009 at 02:37 PM IST #
Hi Deepak,
after run on several testing, i found the the problem cause by
<portlet-url-class>com.liferay.portal.struts.StrutsActionPortletURL</portlet-url-class>
in liferay-portlet-ext.xml
but, when i delete this setting in xml, portlet not working properly ....
could it be StrutsActionPortletURL behavior ?
Thanks
Posted by chiochuan on July 14, 2009 at 03:13 PM IST #
Hi Deepak,
Now iam using the publishing Event and processing It Using the EventStoryBoard with the netbeans Here I dont have any problem with communicating the Two wars in liferay iam able to publish the variables in one war and receiving it another war.It Worked for me very fine .. with the glassfish because i added portal.container.impl=sun in the portal-ext.properties.....in liferayglassfish522
But the Problem is When iam using the Jsp portlets in the Liferay iam unable to pass the variables it always giving the null values.Here my jsp pages includes Html pages so is there any way to communicate between the Jsps which includes the Html pages..Using the Public renderParameter if not is there any other way to communicate these two wars...
Posted by srinivas on July 21, 2009 at 07:10 PM IST #
Deepak, Excellent post.
We are not using liferay but using WebSphere 6.1 which support jsr 286. We do not use local portlets but only remote portlets. I have deployed two separate WAR file on producer and consuming those two portlets on same page.
But not able to pass render parameter between two portlets. I know that by default the render param scope is global so it shld be able to pass.
Any thoughts ?
Mehul
Posted by Mehul Shah on July 24, 2009 at 10:27 PM IST #
If you want to pass render parameters between two portlets you need to use public render parameters. Render Parameters by default are not global, they are private to that portlet.
Posted by Deepak on July 27, 2009 at 02:09 PM IST #
I may have skipped over this somewhere, but is there a way to set a default value to public render parameters? I can get them to pass between portlets properly it's just that when first loading the portlets 'null' is in the fields. A default value of "" would make it appear nicer.
Posted by Daniel Wilberger on July 29, 2009 at 09:51 PM IST #
There is no default value for public render parameters.
Posted by Deepak on July 30, 2009 at 10:41 AM IST #
Is there any way to create one so that 'null' doesn't go into the text fields the first time the page is loaded?
Posted by Daniel Wilberger on July 30, 2009 at 06:04 PM IST #
I would handle this using a utility class something like..
<input type="text" value="<%=ParamUtil.getString(renderRequest.getParameter(..)%>"
ParamUtil.getString will return "", if renderRequest.getParameter returns null.
Posted by Deepak on July 30, 2009 at 07:40 PM IST #
Thank you I never even thought of that.
Posted by Daniel Wilberger on July 30, 2009 at 10:42 PM IST #
Hello,
I would recommend to follow:
http://www.liferay.com/web/steven.cao/blog/-/blogs/jsr-286-new-features-1-in-5-public-render-parameter
I used it and it works fine.
Regards.
Posted by Rajesh Murli on August 14, 2009 at 09:28 PM IST #
Hi There,
I am looking for IPC method, which allows me to exchange data between two portlets, which are NOT on the same page.
I am aware of a cache solution (IBM/dynacache) or the bundling portlets into the same war and use session etc. I am looking for an alternative!
Does anybody have a suggestion?
Posted by robertt on August 25, 2009 at 02:37 AM IST #
"I am aware of a cache solution (IBM/dynacache) or the bundling portlets into the same war and use session etc. I am looking for an alternative! "
How about using URL ? I used it to share some basic variables (usually id, e.g. userId, articleId, etc) using URL.
This depends on portal you use, e.g. Liferay works fine with URL parameters as it does not delete parameters from URL when navigating around portal...
Idea is to use httpSession and queryString together with jsf externalContext to construct URL, add your parameters and rewrite it. If you use struts this is easy, in JSF is possible but relies on few tricks.
Posted by Petar on August 25, 2009 at 03:33 AM IST #
Hi,
I have been getting so many queries on this, I blogged about this. http://blogs.sun.com/deepakg/entry/coordination_between_portlets_across_pages
Thanks for triggering this.
Posted by Deepak on August 25, 2009 at 12:12 PM IST #
Hi Deepak,
Can we deploy two JSR286 portlets on two different containers (on different machines)and still get them communicating with each other using events or IPC?
Posted by Hariom Tiwari on September 23, 2009 at 03:58 PM IST #
This can be done via WSRP(http://wsrp.dev.java.net)
Posted by Deepak on October 01, 2009 at 12:53 PM IST #
Hi Deepak,
Thank you very much for your article and replies to the queries posted by many. Just by going through these posts, I fixed many issues.
Posted by Prashanth on November 17, 2009 at 05:16 PM IST #