D22 Portlet Development With Open Source Frameworks

  • View

  • Download

Embed Size (px)

Text of D22 Portlet Development With Open Source Frameworks

  • 1. Session Number:D22 Jump START your Portlet development with Open Source Frameworks! Sean Newby, Perficient Sunil Patil, Ascendant Technology LLC Peter Blinstrubas, IBM

2. Agenda

  • IBM Portlet Development Perspective
  • Struts 2.0
  • Spring 2.0


  • IBM Portlet Development Perspective
  • Email: peteblin@us.ibm.com

4. Why Use a Framework for Portlet Development?

  • Starts off small and later is enhanced.
  • Model View Controller well established.
    • Provides separation between different layers
  • Frameworks force developers into using a standard approach when building applications
  • Shield some of the underlying complexity of developing an application.
  • Provides interfaces or abstract classes to speed and structure your development effort.
  • Options
    • Write the portlet in portal api
    • Develop a custom framework for portlet development.
      • Port servlet world framework to the portlet world
    • Use an existing framework!

5. Frameworks for Portlet Development

  • IBMFrameworks
    • Just the Portlet API
    • WebSphere Portlet Factory
      • AJAX based on DOJO
    • JSF V1.1 on Portal 6.xwithJWL 3.0
    • JSF 1.2 for Portal running on WAS 7(plans subject to change)
      • AJAX
    • Struts Apache Bridge for JSR 168 Container on WAS 6.1
    • Currently Struts Portlet Framework supports Struts 1.1 and 1.29
  • Alternative Frameworks
    • Custom MVC
    • Spring 2.0
    • Struts 2.0
    • Many More (i.e. Shale, Wicket,)

6. What is the Struts Portlet Framework?

  • Runtime
    • A package that supports Struts application in Portal.
    • Includes a level of Struts (1.1 and 1.29)
    • A portlet controller and a request processor.
    • Implementations of some of the Struts tags
  • Tool Set
    • Flow Editor for creating and wiring pages and actions together
    • A full Struts-Config editor
    • Link validation and re-factoring for Struts specific links
    • Wizards for creating Actions, Struts JSPs and Form Beans
    • Page Designer Visualizations for some Struts-html tags
    • Full Page Designer Palette for Struts Tags

7. What is the Struts Portlet Framework?

  • Support for writing/migrating Struts applications that can be deployed in WebSphere Portal
  • Also provides samples to show how portal features can be incorporated by Struts applications

8. Struts 1.x in General

  • Struts is:
    • Controller based framework
  • Struts does not have:
    • A built-in UI component model
    • A built-in event model for UI components
    • A built-in state management for UI components
    • A built-in support of multiple renderers (Struts is
      • more or less tied up with HTML)
  • Struts is Not a standard (despite its popularity)
  • IBM has no plans to continue SPF Development.
  • Recommended for Legacy Struts Applications.
    • Also consider Apache Bridge

9. IBM and JSF

  • Part of Java EE 5
    • Participation in JSR Expert Group
    • J2EE-based Web UI and application framework
  • WPLC
      • Underlying technology in Composite Application Designer
      • Used in Portal Workflow portlets
      • Being incorporated into Lotus Expeditor
      • Widgets in Portlet Factory
  • Recommended for new portlet development
  • Note: Refer to session D12 for JSF details

10. JSF General

  • Benefits
    • Reusable UI Components
    • Custom Tag Libraries
    • API for managing UI components, events, input navigation, page navigation
    • Addresses complex navigation requirements
    • Extensible - Everything is pluggable
    • Rich tooling support
    • Flexible Actions: different navigations for multiple components on a single page
    • Supports Expression
    • Built in state management
  • Concerns
    • Complexity
    • Still relatively new
    • Out of the box capability to meet requirements
    • Availability of skills


  • Plug-in to Eclipse & Rational Application Developer
  • Multi-page custom portlets/applications without coding
  • Integration capabilities (SAP, Domino, PeopleSoft, Siebel, Web Services, Databases, Portal Content Repository)
  • Service-oriented development
  • Support for Portal features such as portlet communication, business user configuration, auto-deploy, single sign-on
  • Dynamic profiling capability, to create multiple variations from a single set of source portlets

WebSphere Portlet FactoryRapid Portlet Creation and Customization Tooling IBM WebSphere Portlet Factorysimplifies&acceleratesthe development, deployment, maintenance, and reuse of custom portlets and applications. 12. Portlet Factory General

  • Benefits
    • DataCentric Applications
    • Expand Portlet Creation to developers of all skill level
    • Captures Design Patterns/Standardize Development Model
    • Lots of adapters
    • Strong XML/Web Service support
    • Code generation technology protects investment
    • Protecting against backend product upgrades
  • Concerns
    • New vocabulary (learning curve)
    • Complex application, process intensive

13. There are so many choices? Portlet API JSF Framework Struts Portlet Framework Struts 2.0 My Servlet Framework There may be many valid and not so valid reasons to consider. Portlet Factory Spring 2.0 Apache Bridge 14.

  • Apache Struts 2.0:
  • Sunil Patil, Senior Consultant, Ascendant Technology LLC
  • Email: spatil@atech.com

15. Struts 2.0 Introduction

  • Action Framework, allows you to map URL to Action Class
  • Missing features of Apache Struts 1.0 will be ported to Struts 2.0
  • OpenSymphonys WebWorks framework will cease to exists
    • WebWorks will only release patches for existing versions.
  • The WebWorks framework has built-in support for JSR-168 portlet development
  • Architecture based on OpenSymphonys WebWorks Framework
    • Command pattern implementation
      • Actions are command objects

16. Client Selection Example

  • At previous client using Apache Struts 2.0 framework
  • Reasons Struts 2.0 framework is considered
    • Customer wanted precise control on the Portlet Screens
    • Customer wanted to use common look and feel across all portlets
    • Has considered JSF, but developing custom components in JSF requires lot of work
    • Developers already had experience on Apache Struts 1.0, easy migration
    • Provides clear separation between Action and Render phase

17. Key Struts 2.0 objects/concepts

  • Jsr168Dispatcher:
    • The Controller portlet that handles all requests to the portlet application. Similar to ActionServlet in Struts 1.0 framework
  • Action
    • Jsr168Dispatcher passed request to configured Action to handle request.