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>






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

Sunday, 18 December 2011

Build EXT Service with "id" column - [JDBCExceptionReporter:101] Unknown column 'xxxxxxx_.id_' in 'field list'

In Liferay5.2.3 when you are trying to build a sevice with Column name "id" not
a Id,ID or etc other than "id".

for Example a table- ExampleTable has field


id long not null,
name varchar(30),
emailAddress varchar(30),

After Creating Table when you creat a Ext Service and trying to call LocalSrviceUtil ,Liferay-Hibernate  gives error like,

 [JDBCExceptionReporter:101] Unknown column 'ExampleTable0_.id_' in 'field list'


..Liferay portal doesnot support for "id" name column.

To remove these type of error,


Just rename the table field "id" to "id_" you doesn't have to rebuild Service.







 

Thursday, 15 December 2011

Run Your Liferay on Shared Server.

1.Download Liferay Portal
            http://www.liferay.com/downloads/liferay-portal/available-releases

2.Extract Portal on your Shared Server.

3.Goto ..\liferay-portal-Version\tomcat-6.0.18\webapps\ROOT\WEB-INF\classes\

4.Edit portal-ext.properties  , if file is not there create a new file same name.

5. put cofiguration of database.(or it will take default liferay DB HSQL )


       #
       #   db connection
       #
       jdbc.default.driverClassName=com.mysql.jdbc.Driver
       jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
       jdbc.default.username=xxxx
       jdbc.default.password=xxxx

       #
       #  if running from sub folder.because you are running on shared.
       #  change Root foleder naem to your context.
       #
      
      portal.ctx=/portal    


       #
       #  Document ,Articles and images Stored

       # 
     
        liferay.home=/home/lportal/liferay
create a .htaccess file to Liferay root directory 
and Add following contentc to file ..
     SetHandler jakarta-servlet
     SetEnv JK_WORKER_NAME ajp13

Sunday, 11 December 2011

Liferay Delete User From OpenSSO

  • Deploy opensso-client-jdk15/opensso-client-jdk14 as per your JDK Version in Tomcat.
  •  
  • Click on Configuration
  • Client SDK is successfully configured.
    AMConfig.properties created at
    C:\WINDOWS\system32\config\systemprofile\OpenSSOClient\_Program Files_Apache Software Foundation_Tomcat 7.0_webapps_opensso-client-jdk15_AMConfig.properties
  • Now Create a Java/Web Project ..Or Create a Portlet (Liferay).
  • Copy AMConfig.properties to your Application.(In Source Folder,not in a Package)
  • Add Lib : openssoclientsdk.jar in Lib folder.
  • Write Java File ......with Below Two Methods..
  •  
  •      

Infinidb _CpNoTf_ problem

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