Showing posts with label IPC. Show all posts
Showing posts with label IPC. Show all posts

Friday, 30 December 2011

IPC - Inter Portlet Communication using "Public Render Parameter feature"

To Communicate two Portlet using Public Render Parameter...

JSR286 Support the functionality of Public-Render-Parameter.Using this you can share value in Portlets.

Some few Configuration for IPC.

If you have two Portlet and you want to share parameter named "paramName" which share value in both Portlet.

1). You have to add following tag in both Portlet.xml

<portlet-app ....>
     <portlet> .. </portlet>
     <public-render-parameter>
        <identifier>paramName</identifier>
        <qname xmlns:x="http://xyz.com/param">x:
paramName</qname>
     </public-render-parameter>  
</portlet-app>

here <identifier>paramName</identifier> "paramName" is your identifire ,which you use to set and get Value.

A QName is a qualified name. Using a QName allows events to be name-spaced properly so that no two event names are identical 


2). Also you have to add supported-public-render-parameter in both portlet.xml


<portlet-app ....>
     <portlet>
     <supported-public-render-parameter>paramName</supported-public-render- parameter>
     </portlet>
     <public-render-parameter>
        <identifier>paramName</identifier>
        <qname xmlns:x="http://xyz.com/param">x:
paramName</qname>
     </public-render-parameter>  
</portlet-app>
3). Now we have to set Render Parameter. Do following in Sender Portlet

 In ProcessAction(..) method 


   public void processAction(ActionRequest req, ActionResponse res)
         throws IOException, PortletException {
        // Your Code ...
                 res.
setRenderParameter("parameName", "value");
        }


4). Now last Configuration in another Portlet get value from Parameter using PortletRequest......


    ParamUtil.getString(portletRequest,"parameName");



5). to remove render Parameter 

public void processAction(ActionRequest req, ActionResponse res)
         throws IOException, PortletException {
        // Your Code ...
                 res.
removePublicRenderParameter("parameName");
        }



6). If you are use IPC in JSF,Icefaces Portlet one thing to remember...
add following tag in Portlet.xml

<portlet>
......
   <init-param>
       <name>com.sun.faces.portlet.SAVE_REQUEST_SCOPE</name>
       <value>true</value>
    </init-param>
<portlet>






....................................................................................

Infinidb _CpNoTf_ problem

infinidb table with a varchar column insert string as a '_CpNoTf_' while using Cpimport. The Problem is occured if inserted string ...