Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Portlets 2.0 Tssjs Prague 2008

1,500 views

Published on

Presentation on the future of portals and portlets from The Server Side Java Symposium 2008

  • Be the first to comment

  • Be the first to like this

Portlets 2.0 Tssjs Prague 2008

  1. 1. Portlets 2.0 Next Generation Portlet Applications Steve Millidge Founder of C2B2 Member of the JSR286 Expert Group Architect of the Open Source iPoint Portal [email_address] www.c2b2.co.uk
  2. 2. About Me <ul><li>Director C2B2 Consultancy focused on JEE </li></ul><ul><ul><li>Fast, Reliable, Manageable, Secure </li></ul></ul><ul><li>12 years of Large Scale Web and JEE </li></ul><ul><ul><li>Tour De France </li></ul></ul><ul><ul><li>HM Revenue and Customs </li></ul></ul><ul><ul><li>Department of Transport </li></ul></ul><ul><ul><li>Ordnance Survey </li></ul></ul><ul><li>8 years with Portals </li></ul>
  3. 3. Agenda <ul><li>Portlet Concepts </li></ul><ul><li>JSR 168 </li></ul><ul><li>JSR 286 Building Bridges </li></ul><ul><li>Portlet Reprise </li></ul><ul><li>Demo </li></ul>
  4. 4. Portlet Concepts
  5. 5. What is a Portal “ A portal is a web based application that commonly provides personalisation, authentication, content aggregation, from different sources and hosts the presentation layer of information systems.” The JSR 286 Spec
  6. 6. What is a Portal? TRADITIONAL VIEW
  7. 7. What 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
  8. 8. What is a Portlet?
  9. 9. The Portlet Container “ A portlet container runs portlets and provides them with the required runtime environment.” The JSR 286 Spec
  10. 10. Architecture Portal Local Portlet Container 2 Remote Portlet Container Local Portlet Container 1 Portlet API Portlet API Portlet Portlet Portlet Portlet Portlet
  11. 11. JSR 168
  12. 12. JSR 168 <ul><li>Released October 2003 </li></ul><ul><li>Portlet API </li></ul><ul><li>Portlet Taglib </li></ul><ul><li>Portlet Lifecycle </li></ul><ul><li>Window States </li></ul><ul><li>Views </li></ul><ul><li>Preferences </li></ul><ul><li>Packaging </li></ul>
  13. 13. Portlet Lifecycle <ul><li>init() </li></ul><ul><ul><li>Called once when enters service </li></ul></ul><ul><li>processAction() </li></ul><ul><ul><li>Called in response to an Action Request </li></ul></ul><ul><li>render() </li></ul><ul><ul><li>Called to generate the markup fragment </li></ul></ul><ul><li>destroy() </li></ul><ul><ul><li>Called once when taken out of service </li></ul></ul>
  14. 14. JSR 168 Limitations
  15. 15. JSR168 Portlets are Islands <ul><li>Can not Communicate with other Portlets </li></ul><ul><li>Can not Influence the Portal Page </li></ul><ul><li>Can not generate non markup content </li></ul><ul><li>Don’t support Web Frameworks well </li></ul>
  16. 16. JSR 286 -Building Bridges
  17. 17. Inter-portlet Communication
  18. 18. Shared Session Parameters <ul><li>Available in JSR 168 </li></ul><ul><li>Only works for portlets in the same Web Application </li></ul><ul><li>Limited Use </li></ul>
  19. 19. Architecture Portal Local Portlet Container 2 Remote Portlet Container Local Portlet Container 1 Portlet API Portlet API Portlet Portlet Portlet Portlet Portlet
  20. 20. JSR 286 IPC Aims <ul><li>Work in All Scenarios </li></ul><ul><ul><li>Same Web App </li></ul></ul><ul><ul><li>Local Container </li></ul></ul><ul><ul><li>Multiple Containers </li></ul></ul><ul><ul><li>Remote Container </li></ul></ul><ul><li>Solutions </li></ul><ul><ul><li>Public Render Parameters </li></ul></ul><ul><ul><li>Events </li></ul></ul>
  21. 21. Public Render Parameters http://website/portal?zipcode=wr143sz
  22. 22. Demo: Public Render Parameters (JBoss Portal)
  23. 23. Public Render Parameters <ul><li>Enables Coordination of Render Params </li></ul><ul><ul><li>Across Portlets </li></ul></ul><ul><ul><li>Across Portlet Applications </li></ul></ul><ul><li>Global to all Portlets Declaring Support </li></ul><ul><li>Available in ALL Lifecycle Methods </li></ul><ul><li>Bookmarkable </li></ul><ul><ul><li>Simple Strings </li></ul></ul>
  24. 24. Declaring Support ... <public-render-parameter> <identifier>foo</identifier> <qname xmlns:x= http://c2b2/ns >X:foo2</qname> </public-render-parameter> ... <portlet> <portlet-name>PortletA</portlet-name> ... <supported-public-render-parameter> foo</supported-public-render-parameter> </portlet> ... If you do not declare support for the parameter you won’t receive it
  25. 25. Portlet Events <ul><li>Major Feature of 286 </li></ul><ul><li>Coordinates Portlets w.r.t. State Changes </li></ul><ul><li>Events Raised in processAction </li></ul><ul><li>New Processing Phase before Render </li></ul><ul><ul><li>processEvents </li></ul></ul><ul><ul><li>Events can be raised in processEvents </li></ul></ul>
  26. 26. Event Demo (JBoss Portal)
  27. 27. Event Processing
  28. 28. What is an Event <ul><li>Name </li></ul><ul><ul><li>E.g. “CitySelected” </li></ul></ul><ul><li>QName </li></ul><ul><ul><li>E.g. “c2b2:Gazeteer.CitySelected” </li></ul></ul><ul><li>Payload </li></ul><ul><ul><li>Serializable Java Object </li></ul></ul><ul><ul><li>JAXB XML Binding </li></ul></ul>
  29. 29. Event Definition <ul><li>Event Names Defined in the portlet.xml </li></ul><ul><li>Portlet Declares Support in portlet.xml </li></ul>< event-definition> <name>ProductSelectedForPurchase</name> <value-type>com.example.Product</value-type> </event-definition> … <portlet> <portlet-name>Shopping Cart</portlet-name> <supported-processing-event> <name>ProductSelectedForPurchase</name> </supported-processing-event> </portlet>
  30. 30. Resource Serving <ul><li>Portlet Directly Serves a Resource </li></ul><ul><li>RSS Feed </li></ul><ul><li>Image Content </li></ul><ul><li>AJAX Requests </li></ul>
  31. 31. Resource Serving <ul><li>Generate non-markup Content </li></ul><ul><ul><li>Images </li></ul></ul><ul><ul><li>PDF </li></ul></ul><ul><li>Supports Simple AJAX </li></ul><ul><li>New Lifecycle Method </li></ul><ul><ul><li>serveResource </li></ul></ul><ul><li>New URL Type </li></ul><ul><ul><li>ResourceURL </li></ul></ul><ul><li>No Interportlet Coordination in serveResource </li></ul>
  32. 32. Other “Minor” Improvements <ul><li>Support for Changing Headers </li></ul><ul><ul><li>Cookies, META tags etc. </li></ul></ul><ul><li>Better Web Framework Integration </li></ul><ul><li>Annotations Support in Generic Portlet </li></ul><ul><li>Portlet Managed Modes </li></ul><ul><li>Portlet Filters similar to Servlet Filters </li></ul><ul><li>Access to Portlet Window ID </li></ul><ul><li>URL Generation Listeners </li></ul>
  33. 33. Portlet Reprise
  34. 34. Remember <ul><li>Portlets are NOT Lightweight GUI Components </li></ul><ul><ul><li>E.g. Tree View, List View </li></ul></ul><ul><li>Portlets are mini Applications </li></ul><ul><li>REMEMBER </li></ul>
  35. 35. Traditional Architecture Portal Local Portlet Container 2 Remote Portlet Container Local Portlet Container 1 Portlet API Portlet API Portlet Portlet Portlet Portlet Portlet
  36. 36. Portlet Container in the Wild Portlet Container 1 Portlet API Portlet Portlet WSRP REST Portal Portlet Container 2 Portlet API Portlet Portlet WSRP REST Portal IPC
  37. 37. Why Portlets? <ul><li>Standards Based </li></ul><ul><li>Personalisation Support </li></ul><ul><li>Instance Support </li></ul><ul><li>Modes Support </li></ul><ul><li>Lifecycle Methods </li></ul><ul><li>Inter-Portlet Communication </li></ul>
  38. 38. Demo: Federation (iPoint)
  39. 39. Federation iPoint
  40. 40. Demo: WebOS (eXo)
  41. 41. Portlets as Remote Applications
  42. 42. Conclusion <ul><li>Portlets are Mini Applications </li></ul><ul><li>Portlets can now Communicate / Collaborate </li></ul><ul><li>Portlets can Generate Rich Content </li></ul><ul><li>Portlets not just for Portals </li></ul>
  43. 43. Questions

×