Friday, December 24, 2010

Mail Portlet Synchronization Issue

Liferay Portlet doesn't Synchronize all the mails properly. Though it shows the Mail Count in Pagination,the Pagination fails to work properly at a certain level.This is due to some unusual characters in subject/sender/to/body in your mails.You can resolve this by changing some column types from "mail_message" table.Step 1: Please make sure that your database character set is "UTF-8".If it isn't then create it as follows: create database testing character set utf-8 Step 2: Change "longtext" to "binary" for some column from "mail_message" tableas follows: alter table Mail_Message modify column sender longtext character set binary; alter table Mail_Message modify column to_ longtext character set binary; alter table Mail_Message modify column cc longtext...

Fileupload using service.xml file

I have done this in MVC portlet. File upload in liferay using service.xml file is bit tricky. With small modification in portlet-model-hints.xml we can achieve this.Step 1: Give the data type as string to store the uploaded file. entry in service.xml file <entity name="FileUploader" table="fileuploader" local-service="true"> <column name="fid" type="long" primary="true"/> <column name="content" type="String"/></entity>Step 2 : Do 'ant build-service' from specific portlet level. As you know that which is used to generate the api to interact with database.Step 3 : Open 'portlet-model-hints.xml' file which is in 'WEB-INF/src/META-INF'. Initially this xml file look like this<model-hints> <model name="com.sample.mvc.model.FileUploader"> <field...

Saturday, December 4, 2010

Get Remote IP

To get the Client System's (Remote) IP Address through portlet request: HttpServletRequest request = PortalUtil.getHttpServletRequest(actionrequest); String clientIp = PortalUtil.getOriginalServletRequest(request).getRemoteAddr(); or String clientIp = PortalUtil.getHttpServletRequest(request).getRemoteAddr(); -- Warm Regards,K.Gnaniyar Zubair,...

Sunday, November 28, 2010

Portlet to Portlet Communication

Introduction The first version of the portlet specification, JSR-168/portlet1.0, did not include any support for Inter Portlet Communication. The second version, JSR-286/ portlet2.0, which is supported for IPC Mechanism. IPC is made easy with JSR-286 to share the data between two portlets. Using IPC mechanisms, we can share the data from ACTION to VIEW phase and VIEW-VIEW Phase. There are 3 ways to share the data between 2 portlets. 1. Portlet session 2. IPC Mechanisms 2.1 Public Render Parameters 2.2 Event 2.3 Client-Side IPC 3. Cookies 1.Portlet Session ...

Pages 91234 »

Share & Enjoy

Twitter Delicious Facebook Digg Stumbleupon Favorites More