Title: Portlets 2'0 JSR 286
1Portlets 2.0JSR 286
- Steve Millidge
- Member of the JSR286 Expert Group
- Architect of the Open Source iPoint Portal
- smillidge_at_c2b2.co.uk
- www.c2b2.co.uk
2What is a Portlet
A portlet is an application that provides a
specific piece of content (information or
service) to be included as part of a portal
page. The JSR 286 Spec
3The Portlet Container
A portlet container runs portlets and provides
them with the required runtime environment. The
JSR 286 Spec
4Architecture
Portal
Remote Portlet Container
Portlet API
Portlet
Portlet
Local Portlet Container 1
Portlet API
Portlet
Portlet
Local Portlet Container 2
Portlet
5JSR 168 Limitations
6JSR168 Portlets are Islands
- Can not Communicate with other Portlets
- Can not Influence the Portal Page
- Can not generate non markup content
- Dont support Web Frameworks well
7JSR 286Building Bridges
8Shared Session Parameters
- Available in JSR 168
- Only works for portlets in the same Web
Application - Limited Use
9Public Render Parameters
- Shared Render State Between Portlets
- Parameter Declared in portlet.xml
- Portlet Declares Support for it in portlet.xml
ltpublic-render-parametergt ltidentifiergtzipcodelt/i
dentifiergt ltqname xmlnsxhttp//www.foo.com/pa
ramsgtzipcodelt/qnamegtlt/public-render-parametergt
ltportletgt ltportlet-namegtgazeteerlt/portlet-namegt
ltsupported-public-render-parametergtzipcodelt/sup
ported-public-render-parametergtlt/portletgt
10Portlet Communication
11Portlet Events
- Major Feature of 286
- Coordinates Portlets w.r.t. State Changes
- Events Raised in processAction
- New Processing Phase before Render
- processEvents
- Events can be raised in processEvents
12Event Definition
- Event Names Defined in the portlet.xml
- Portlet Declares Support in portlet.xml
- Event Content must have JAXB Binding
ltevent-definitiongt ltnamegtProductSelectedForPurch
aselt/namegt ltvalue-typegtcom.example.Productlt/valu
e-typegtlt/event-definitiongt ltportletgt
ltportlet-namegtShopping Cartlt/portlet-namegt
ltsupported-processing-eventgt ltnamegtProductSelecte
dForPurchaselt/namegt lt/supported-processing-event
gtlt/portletgt
13Possible Usage
Portal
1) processAction
ProductCataloguePortlet
2) setEvent(EventPayload)
4) render()
3) processEvent()
ShoppingCartPortlet
5) render()
14Resource Serving
- Generate non-markup Content
- Images
- PDF
- Supports Simple AJAX
- New Lifecycle Method
- serveResource
- New URL Type
- ResourceURL
- No Interportlet Coordination in serveResource
15Other Minor Improvements
- Support for Changing Headers
- Cookies, META tags etc.
- Better Web Framework Integration
- Annotations Support in Generic Portlet
- Portlet Managed Modes
- Portlet Filters similar to Servlet Filters
- Access to Portlet Window ID
- URL Generation Listeners
16Thank you
17C2B2 Shameless Plug!
- Niche Java Consultancy
- Specialising in Java Infrastructure
- Experts in Non-functional Requirements
- Scalability, Availability, Performance etc.
- Services
- Consulting, Training
- Technologies
- Core JEE, ESB, Portals, ORM
- Vendors
- BEA, Red Hat (JBoss), Sun, IBM
- Terracotta, Hyperic, Liferay, eXo, Mule