Portals in OpenCmsBuilding JSF and portlet applications in openCms                               Presented by: Dipl.-Ing. ...
AgendaWhat are Portals good for? • Scenarios, Market Players • Common Architectural IssuesPortals in OpenCms • How to buil...
Scenario: Company IntranetTypically a mix of content and web applications                                                 ...
Architectural approaches•       Method I: Dont use a CMS = All programmatic    •   Editors hand over articles to programme...
Architectural approaches•       Method III: Develop within CMS    •   Each piece of code is a formatter, JSP-fragment, Tem...
Method IV: Portals                                     Navigation                       Content                       Port...
Portal Issues               POST /cms/test      HTTP/1.1               Host: server               select=7•    There are 3...
Java Portlets: JSR-286•   Portlets are like Servlets      • own J2EE-Webapp (.war)      • own data source, jars, configura...
Portlet example                  - The Portlet plus some logic classes                  - Some JSPs to render the HTML-Sni...
Example: Request Flow1. A HTML-Snippet generates a POST-URL:   <p:actionURL var="target" name="choosemode"/>   <form name=...
Market View  redhat              (c) 2012 eonas GmbH
OpenCms as Portal Server                                            Pluto Portal         OpenCms 7/8                 (Refe...
Anatomy of the Portal                        - Storage location of the base wars                        - context.xml: the...
Using the Portlet Support1. Create an opencmsportal.war     • Usual Setup-Process necessary     • Portlet support enabled,...
Creating the Portlet ModuleOpenCms 8 Module- Rest of the Module not affected- Formatter for a Portlet- Document Type Defin...
JSF and Rich Client Widgets•       Several JSF Libraries provide nice, easy to use widgets    •   Primefaces, Richfaces, I...
JSR 301 and JSR329•       JSR301 and JSR329:    •   Transparent bridge between JSF and Portals    •   A JSF Application ca...
Component Overview                     Tomcat 6                                    OpenCms         Pluto with      HTTP GE...
Real world exampleExample: A simple voting portlet • Backend: Spring/Hibernate/AOP • Frontend: Primefaces                 ...
Fragen?          Dipl. Ing. Helmut Manck          Geschäftsführer          eonas IT-Beratung und Entwicklung GmbH         ...
Upcoming SlideShare
Loading in …5
×

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

1,844 views

Published on

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,844
On SlideShare
0
From Embeds
0
Number of Embeds
139
Actions
Shares
0
Downloads
36
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

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

  1. 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. 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. 3. Scenario: Company IntranetTypically a mix of content and web applications Navigation Content Content Process (c) 2012 eonas GmbH
  4. 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. 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. 6. Method IV: Portals Navigation Content Portlet Portlet Content Portlet (c) 2012 eonas GmbH
  7. 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. 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. 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. 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. 11. Market View redhat (c) 2012 eonas GmbH
  12. 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. 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. 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. 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. 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. 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. 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. 19. Real world exampleExample: A simple voting portlet • Backend: Spring/Hibernate/AOP • Frontend: Primefaces (c) 2012 eonas GmbH
  20. 20. Fragen? Dipl. Ing. Helmut Manck Geschäftsführer eonas IT-Beratung und Entwicklung GmbH Pascalstr. 10A 10587 Berlin Germany helmut.manck@eonas.de Telefon +49-30-3980 522 – 10 (c) 2012 eonas GmbH 20

×