SlideShare a Scribd company logo
1 of 6
Create IPC Portlet in Liferay 6.1.1 ga2
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.
Public Render Parameter: IPC (Inter Portlet Communication):
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.
By adding the following property in portlet-ext, we can enable portlets to share render
states with other portlets that are on different pages:
portlet.public.render.parameter.distribution=ALL_PORTLETS
Follow Steps to create IPC Portlet in Liferay 6.1.1 ga2
Step 1: Create new demoipc-portlet
Give first portlet name:sender
Step 2: Create second portlet in same project
Give portlet name:receiver
Step 3: In package com.test make two java class file
Sender.java
package com.test;
import java.io.IOException;
import java.util.Random;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.PortletException;
import javax.portlet.PortletRequestDispatcher;
import javax.portlet.ProcessAction;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import javax.xml.namespace.QName;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.util.bridges.mvc.MVCPortlet;
/**
* Portlet implementation class sender
*/
public class sender extends MVCPortlet {
@ProcessAction(name="pitchBall")
public void pitchBall(ActionRequest request, ActionResponse response) {
String pitchType = null;
System.out.println("pitch call");
// Send an Event that the ball has been pitched.
Random random = new Random(System.currentTimeMillis());
int pitch = random.nextInt(3) + 1;
switch (pitch) {
case 1:
pitchType = "Fast Ball";
break;
case 2:
pitchType = "Curve Ball";
break;
case 3:
pitchType = "Slider";
break;
// should never print
default:
pitchType = "Screw Ball";
}
pitchType=pitchType+"Hai You have received Event Data sent from Sender Portlet";
javax.xml.namespace.QName qName =
new QName("http://liferay.com", "ipc.pitch", "x");
response.setEvent(
qName,
pitchType);
System.out.println("call here");
}
}
Receiver.java
package com.test;
import javax.portlet.Event;
import javax.portlet.EventRequest;
import javax.portlet.EventResponse;
import javax.portlet.ProcessEvent;
import com.liferay.util.bridges.mvc.MVCPortlet;
/**
* Portlet implementation class receiver
*/
public class receiver extends MVCPortlet {
@javax.portlet.ProcessEvent(qname = "{http://liferay.com}ipc.pitch")
public void handleProcessempinfoEvent(
javax.portlet.EventRequest request, javax.portlet.EventResponse
response)
throws javax.portlet.PortletException, java.io.IOException {
javax.portlet.Event event = request.getEvent();
String value = (String) event.getValue();
System.out.print("value in process event>>>>>>>>>" + value);
response.setRenderParameter("ipc.pitch", value);
}
}
Step 4: Edit the portlet.xml
-Add below attribute in “Sender-Portlet”
-Before closing of </portlet>
<supported-processing-event xmlns:x='http://liferay.com'>
<qname>x:ipc.pitch</qname>
</supported-processing-event>
</portlet>
<event-definition xmlns:x='http://liferay.com'>
<qname>x:ipc.pitch</qname>
<value-type>java.lang.String</value-type>
</event-definition>
</portlet-app>
Note: We can declare a list of public paramters for a portlet application.
-Add below attribute in “recevier-Portlet”
-Before closing of </portlet>
<supported-processing-event xmlns:x='http://liferay.com'>
<qname>x:ipc.pitch</qname>
</supported-processing-event>
</portlet>
<event-definition xmlns:x='http://liferay.com'>
<qname>x:ipc.pitch</qname>
<value-type>java.lang.String</value-type>
</event-definition>
</portlet-app>
In my example I have created both portlet in same project so here I have add
both changes in same portlet.xml file
Portlet.xml
<?xml version="1.0"?>
<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" version="2.0">
<portlet>
<portlet-name>sender</portlet-name>
<display-name>sender</display-name>
<portlet-class>com.test.sender</portlet-class>
<init-param>
<name>view-jsp</name>
<value>/html/sender/view.jsp</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
</supports>
<portlet-info>
<title>sender</title>
<short-title>sender</short-title>
<keywords></keywords>
</portlet-info>
<security-role-ref>
<role-name>administrator</role-name>
</security-role-ref>
<security-role-ref>
<role-name>guest</role-name>
</security-role-ref>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
<supported-processing-event xmlns:x='http://liferay.com'>
<qname>x:ipc.pitch</qname>
</supported-processing-event>
</portlet>
<portlet>
<portlet-name>receiver</portlet-name>
<display-name>receiver</display-name>
<portlet-class>com.test.receiver</portlet-class>
<init-param>
<name>view-jsp</name>
<value>/html/receiver/view.jsp</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
</supports>
<portlet-info>
<title>receiver</title>
<short-title>receiver</short-title>
<keywords></keywords>
</portlet-info>
<security-role-ref>
<role-name>administrator</role-name>
</security-role-ref>
<security-role-ref>
<role-name>guest</role-name>
</security-role-ref>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
<supported-processing-event xmlns:x='http://liferay.com'>
<qname>x:ipc.pitch</qname>
</supported-processing-event>
</portlet>
<event-definition xmlns:x='http://liferay.com'>
<qname>x:ipc.pitch</qname>
<value-type>java.lang.String</value-type>
</event-definition>
</portlet-app>
Step 5: A portlet can read public render parameter using following
method
request.getPublicParameterMap()
Note: Public render parameters are merged with regular parameters so can also be
read using
request.getParameter(“id1”);
Step 6: A portlet can remove a public render parameter by invoking
following methods
response.removePublicRenderParameter(“id1”)
Step 7: Make view.jsp for sender and receiver
Make view.jsp in html/sender/view.jsp
View.jsp
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
<portlet:defineObjects />
vbjhbnj
<p>Click the link below to pitch the ball. </p>
<a href="<portlet:actionURL name="pitchBall"></portlet:actionURL>">Pitch!</a>
Make view.jsp in html/recevier/view.jsp
View.jsp
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
<portlet:defineObjects />
<%
String pitch = (String)renderRequest.getParameter("ipc.pitch");
%>
<p>And the pitch is....</p>
<p>
<% if (pitch!=null) { %>
<%=pitch %>!
<% } else { %>
... waiting for pitch.
<% } %>
Step 8: now deploy it and check it
Liferay development is not at all an simpley task as it requires a expetise with vast
experience. Attune Infocom is one of the fastest growing Liferay development firms,
which has an extremely talented pool of liferay developers who can develop custom
liferay portals for you. Attuene Infocom offer outsource Liferay Portal development
solution at worldwide.

More Related Content

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

Featured

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software
 

Featured (20)

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

Create IPC Portlet in Liferay 6.1.1 ga2

  • 1. Create IPC Portlet in Liferay 6.1.1 ga2 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. Public Render Parameter: IPC (Inter Portlet Communication): 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. By adding the following property in portlet-ext, we can enable portlets to share render states with other portlets that are on different pages: portlet.public.render.parameter.distribution=ALL_PORTLETS Follow Steps to create IPC Portlet in Liferay 6.1.1 ga2 Step 1: Create new demoipc-portlet Give first portlet name:sender Step 2: Create second portlet in same project Give portlet name:receiver Step 3: In package com.test make two java class file Sender.java
  • 2. package com.test; import java.io.IOException; import java.util.Random; import javax.portlet.ActionRequest; import javax.portlet.ActionResponse; import javax.portlet.PortletException; import javax.portlet.PortletRequestDispatcher; import javax.portlet.ProcessAction; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; import javax.xml.namespace.QName; import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.util.bridges.mvc.MVCPortlet; /** * Portlet implementation class sender */ public class sender extends MVCPortlet { @ProcessAction(name="pitchBall") public void pitchBall(ActionRequest request, ActionResponse response) { String pitchType = null; System.out.println("pitch call"); // Send an Event that the ball has been pitched. Random random = new Random(System.currentTimeMillis()); int pitch = random.nextInt(3) + 1; switch (pitch) { case 1: pitchType = "Fast Ball"; break; case 2: pitchType = "Curve Ball"; break; case 3: pitchType = "Slider"; break; // should never print default: pitchType = "Screw Ball"; } pitchType=pitchType+"Hai You have received Event Data sent from Sender Portlet"; javax.xml.namespace.QName qName = new QName("http://liferay.com", "ipc.pitch", "x"); response.setEvent( qName, pitchType); System.out.println("call here");
  • 3. } } Receiver.java package com.test; import javax.portlet.Event; import javax.portlet.EventRequest; import javax.portlet.EventResponse; import javax.portlet.ProcessEvent; import com.liferay.util.bridges.mvc.MVCPortlet; /** * Portlet implementation class receiver */ public class receiver extends MVCPortlet { @javax.portlet.ProcessEvent(qname = "{http://liferay.com}ipc.pitch") public void handleProcessempinfoEvent( javax.portlet.EventRequest request, javax.portlet.EventResponse response) throws javax.portlet.PortletException, java.io.IOException { javax.portlet.Event event = request.getEvent(); String value = (String) event.getValue(); System.out.print("value in process event>>>>>>>>>" + value); response.setRenderParameter("ipc.pitch", value); } } Step 4: Edit the portlet.xml -Add below attribute in “Sender-Portlet” -Before closing of </portlet> <supported-processing-event xmlns:x='http://liferay.com'> <qname>x:ipc.pitch</qname> </supported-processing-event> </portlet> <event-definition xmlns:x='http://liferay.com'> <qname>x:ipc.pitch</qname> <value-type>java.lang.String</value-type> </event-definition> </portlet-app> Note: We can declare a list of public paramters for a portlet application. -Add below attribute in “recevier-Portlet”
  • 4. -Before closing of </portlet> <supported-processing-event xmlns:x='http://liferay.com'> <qname>x:ipc.pitch</qname> </supported-processing-event> </portlet> <event-definition xmlns:x='http://liferay.com'> <qname>x:ipc.pitch</qname> <value-type>java.lang.String</value-type> </event-definition> </portlet-app> In my example I have created both portlet in same project so here I have add both changes in same portlet.xml file Portlet.xml <?xml version="1.0"?> <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" version="2.0"> <portlet> <portlet-name>sender</portlet-name> <display-name>sender</display-name> <portlet-class>com.test.sender</portlet-class> <init-param> <name>view-jsp</name> <value>/html/sender/view.jsp</value> </init-param> <expiration-cache>0</expiration-cache> <supports> <mime-type>text/html</mime-type> <portlet-mode>view</portlet-mode> </supports> <portlet-info> <title>sender</title> <short-title>sender</short-title> <keywords></keywords> </portlet-info> <security-role-ref> <role-name>administrator</role-name> </security-role-ref> <security-role-ref> <role-name>guest</role-name> </security-role-ref> <security-role-ref>
  • 5. <role-name>power-user</role-name> </security-role-ref> <security-role-ref> <role-name>user</role-name> </security-role-ref> <supported-processing-event xmlns:x='http://liferay.com'> <qname>x:ipc.pitch</qname> </supported-processing-event> </portlet> <portlet> <portlet-name>receiver</portlet-name> <display-name>receiver</display-name> <portlet-class>com.test.receiver</portlet-class> <init-param> <name>view-jsp</name> <value>/html/receiver/view.jsp</value> </init-param> <expiration-cache>0</expiration-cache> <supports> <mime-type>text/html</mime-type> <portlet-mode>view</portlet-mode> </supports> <portlet-info> <title>receiver</title> <short-title>receiver</short-title> <keywords></keywords> </portlet-info> <security-role-ref> <role-name>administrator</role-name> </security-role-ref> <security-role-ref> <role-name>guest</role-name> </security-role-ref> <security-role-ref> <role-name>power-user</role-name> </security-role-ref> <security-role-ref> <role-name>user</role-name> </security-role-ref> <supported-processing-event xmlns:x='http://liferay.com'> <qname>x:ipc.pitch</qname> </supported-processing-event> </portlet> <event-definition xmlns:x='http://liferay.com'> <qname>x:ipc.pitch</qname> <value-type>java.lang.String</value-type> </event-definition> </portlet-app>
  • 6. Step 5: A portlet can read public render parameter using following method request.getPublicParameterMap() Note: Public render parameters are merged with regular parameters so can also be read using request.getParameter(“id1”); Step 6: A portlet can remove a public render parameter by invoking following methods response.removePublicRenderParameter(“id1”) Step 7: Make view.jsp for sender and receiver Make view.jsp in html/sender/view.jsp View.jsp <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %> <portlet:defineObjects /> vbjhbnj <p>Click the link below to pitch the ball. </p> <a href="<portlet:actionURL name="pitchBall"></portlet:actionURL>">Pitch!</a> Make view.jsp in html/recevier/view.jsp View.jsp <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %> <portlet:defineObjects /> <% String pitch = (String)renderRequest.getParameter("ipc.pitch"); %> <p>And the pitch is....</p> <p> <% if (pitch!=null) { %> <%=pitch %>! <% } else { %> ... waiting for pitch. <% } %> Step 8: now deploy it and check it Liferay development is not at all an simpley task as it requires a expetise with vast experience. Attune Infocom is one of the fastest growing Liferay development firms, which has an extremely talented pool of liferay developers who can develop custom liferay portals for you. Attuene Infocom offer outsource Liferay Portal development solution at worldwide.