Your SlideShare is downloading. ×
OpenCms Days 2012 - OpenCms 8 as a JSR-286 compliant portlet server
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

OpenCms Days 2012 - OpenCms 8 as a JSR-286 compliant portlet server


Published on

Published in: Technology

  • Be the first to comment

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide


  • 1. Portals in OpenCmsBuilding JSF and portlet applications in openCms Presented by: Dipl.-Ing. Helmut Manck OpenCms conference 2012 25. September 2012 (c) 2012 eonas GmbH
  • 2. AgendaWhat are Portals good for? • Scenarios, Market Players • Common Architectural IssuesPortals in OpenCms • How to build a portalJSF and Portlets • How to build a portlet (c) 2012 eonas GmbH
  • 3. Scenario: Company IntranetTypically a mix of content and web applications Navigation Content Content Process (c) 2012 eonas GmbH
  • 4. Architectural approaches• Method I: Dont use a CMS = All programmatic • Editors hand over articles to programmers • Programmers integrate, test and release • Good for Programmers, Bad for Editors• Method II: Separate CMS and Applications • Two independent parts: one CMS-driven, one programmatic driven. • Clean and sweet until navigation and deep links are an issue. (c) 2012 eonas GmbH
  • 5. Architectural approaches• Method III: Develop within CMS • Each piece of code is a formatter, JSP-fragment, Template or similar • Development within (Open)CMS • Pro: Single location of code • Con: IDE support, independent testing, technological freedom • Or you use Portals... (c) 2012 eonas GmbH
  • 6. Method IV: Portals Navigation Content Portlet Portlet Content Portlet (c) 2012 eonas GmbH
  • 7. Portal Issues POST /cms/test HTTP/1.1 Host: server select=7• There are 3 Portlets on the Page. Who handles this POST-Request?• Portals must provide: • Name spacing • Link Generation • (with in HTML-Space and the generated URLs) (c) 2012 eonas GmbH
  • 8. Java Portlets: JSR-286• Portlets are like Servlets • own J2EE-Webapp (.war) • own data source, jars, configuration, version • plus a portlet.xml• Portlets extend GenericPortlet • “render”: Deliver HTML-Snippet • “action”: Process POST • “resource”: Deliver CSS, JS, Ajax (c) 2012 eonas GmbH
  • 9. Portlet example - The Portlet plus some logic classes - Some JSPs to render the HTML-Snipplets - J2EE-Configuration plus Portlet-Config - Build recipe based on maven - Additional Libs - Can be developed, tested, debugged locally with full IDE support (e.g. hot code replace) (c) 2012 eonas GmbH
  • 10. Example: Request Flow1. A HTML-Snippet generates a POST-URL: <p:actionURL var="target" name="choosemode"/> <form name="form" action="${target}“ method="post">2. Form-Submit triggers URL, then redirect to processAction(request, response)3. New HTML-Snipplet is rendered. render(request,response) (c) 2012 eonas GmbH
  • 11. Market View redhat (c) 2012 eonas GmbH
  • 12. OpenCms as Portal Server Pluto Portal OpenCms 7/8 (Reference implementation for JSR286) OpenCms Portal Portal Driver - Maven Overlay (glue logic) (c) 2012 eonas GmbH
  • 13. Anatomy of the Portal - Storage location of the base wars - context.xml: the portal needs enhanced privileges - web.xml must be heavily modified, spring support is required by pluto, add some filters - the driver ( = glue logic ) is referenced here - Maven overlays the base wars, builds the final war, Pluto requires a certain Spring version. (c) 2012 eonas GmbH
  • 14. Using the Portlet Support1. Create an opencmsportal.war • Usual Setup-Process necessary • Portlet support enabled, but no templates, formatters or document types contained.2. Create an OpenCms Module • Define Look & Feel, CSS etc.3. The selected portlet is rendered using API-Calls within the formatter (usually) PortletTag tag = new PortletTag(); tag.setPortletId(id); tag.setPageContext(copy); tag.doStartTag(); (c) 2012 eonas GmbH
  • 15. Creating the Portlet ModuleOpenCms 8 Module- Rest of the Module not affected- Formatter for a Portlet- Document Type Definition for a Portlet- Maven Pom to build the Module (c) 2012 eonas GmbH
  • 16. JSF and Rich Client Widgets• Several JSF Libraries provide nice, easy to use widgets • Primefaces, Richfaces, ICEfaces • Lots of widgets, mostly easy to use • Ajax support “built in”, Partial updates, Push-Support • E.g. Primefaces Datatable• JSF is gaining traction • Application development gets much faster • Applications get a “rich client” look & feel• How to integrate into a portlet? (c) 2012 eonas GmbH
  • 17. JSR 301 and JSR329• JSR301 and JSR329: • Transparent bridge between JSF and Portals • A JSF Application can be made Portlet just by adding a few Jars and some configuration (portlet.xml)• Portal vendors are pushing this technology • RedHat (Jboss) • Liferay• The Liferay-JSF-Bridge can be used with OpenCms/Pluto! (c) 2012 eonas GmbH
  • 18. Component Overview Tomcat 6 OpenCms Pluto with HTTP GET Portal Portal Driver dispatch() - Render or Action Portlet B JSF Bridge Webapp Primefaces Portlet A Webapp Plain Portlet (c) 2012 eonas GmbH
  • 19. Real world exampleExample: A simple voting portlet • Backend: Spring/Hibernate/AOP • Frontend: Primefaces (c) 2012 eonas GmbH
  • 20. Fragen? Dipl. Ing. Helmut Manck Geschäftsführer eonas IT-Beratung und Entwicklung GmbH Pascalstr. 10A 10587 Berlin Germany Telefon +49-30-3980 522 – 10 (c) 2012 eonas GmbH 20