Portal application development using Websphere Portlet Factory

11,390 views

Published on

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

  • Be the first to like this

No Downloads
Views
Total views
11,390
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
145
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Portal application development using Websphere Portlet Factory

  1. 1. Front coverPortal ApplicationDevelopment UsingWebSphere Portlet FactoryFeatures and techniques for rapidlydeveloping portletsStep-by-step guidance forbuilding a sample applicationBest practices, hints, tipsand troubleshooting David Bowley Emily Chan Thulsi Krishnan Jason Lee Devang Patel Alfredo Navarroibm.com/redbooks
  2. 2. International Technical Support OrganizationPortal Application Development UsingWebSphere Portlet FactoryJanuary 2008 SG24-7525-00
  3. 3. Note: Before using this information and the product it supports, read the information in “Notices” on page iii.First Edition (January 2008)This edition applies to WebSphere Portlet Factory, version 6.0.1© Copyright International Business Machines Corporation 2008. All rights reserved.Note to U.S. Government Users Restricted Rights -- Use, duplication or disclosure restricted by GSA ADPSchedule Contract with IBM Corp.
  4. 4. NoticesThis information was developed for products and services offered in the U.S.A.IBM may not offer the products, services, or features discussed in this document in other countries. Consultyour local IBM representative for information on the products and services currently available in your area.Any reference to an IBM product, program, or service is not intended to state or imply that only that IBMproduct, program, or service may be used. Any functionally equivalent product, program, or service thatdoes not infringe any IBM intellectual property right may be used instead. However, it is the usersresponsibility to evaluate and verify the operation of any non-IBM product, program, or service.IBM may have patents or pending patent applications covering subject matter described in this document.The furnishing of this document does not give you any license to these patents. You can send licenseinquiries, in writing, to:IBM Director of Licensing, IBM Corporation, North Castle Drive, Armonk, NY 10504-1785 U.S.A.The following paragraph does not apply to the United Kingdom or any other country where suchprovisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATIONPROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS ORIMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT,MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimerof express or implied warranties in certain transactions, therefore, this statement may not apply to you.This information could include technical inaccuracies or typographical errors. Changes are periodically madeto the information herein; these changes will be incorporated in new editions of the publication. IBM maymake improvements and/or changes in the product(s) and/or the program(s) described in this publication atany time without notice.Any references in this information to non-IBM Web sites are provided for convenience only and do not in anymanner serve as an endorsement of those Web sites. The materials at those Web sites are not part of thematerials for this IBM product and use of those Web sites is at your own risk.IBM may use or distribute any of the information you supply in any way it believes appropriate withoutincurring any obligation to you.Information concerning non-IBM products was obtained from the suppliers of those products, their publishedannouncements or other publicly available sources. IBM has not tested those products and cannot confirmthe accuracy of performance, compatibility or any other claims related to non-IBM products. Questions onthe capabilities of non-IBM products should be addressed to the suppliers of those products.This information contains examples of data and reports used in daily business operations. To illustrate themas completely as possible, the examples include the names of individuals, companies, brands, and products.All of these names are fictitious and any similarity to the names and addresses used by an actual businessenterprise is entirely coincidental.COPYRIGHT LICENSE:This information contains sample application programs in source language, which illustrate programmingtechniques on various operating platforms. You may copy, modify, and distribute these sample programs inany form without payment to IBM, for the purposes of developing, using, marketing or distributing applicationprograms conforming to the application programming interface for the operating platform for which thesample programs are written. These examples have not been thoroughly tested under all conditions. IBM,therefore, cannot guarantee or imply reliability, serviceability, or function of these programs.© Copyright IBM Corp. 2008. All rights reserved. iii
  5. 5. TrademarksThe following terms are trademarks of the International Business Machines Corporation in the United States,other countries, or both: Redbooks (logo) ® Freelance Graphics® Redbooks® Cloudscape™ IBM® WebSphere® Domino® Lotus® Workplace™ DB2® Rational® Workplace Forms™The following terms are trademarks of other companies:BAPI, SAP, and SAP logos are trademarks or registered trademarks of SAP AG in Germany and in severalother countries.Oracle, JD Edwards, PeopleSoft, Siebel, and TopLink are registered trademarks of Oracle Corporationand/or its affiliates.EJB, Java, Javadoc, JavaScript, JDBC, JRE, JSP, J2EE, and all Java-based trademarks are trademarks ofSun Microsystems, Inc. in the United States, other countries, or both.Excel, Expression, Windows, and the Windows logo are trademarks of Microsoft Corporation in the UnitedStates, other countries, or both.Other company, product, or service names may be trademarks or service marks of others.iv Portal Application Development Using WebSphere Portlet Factory
  6. 6. Contents Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii The team that wrote this book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii Special acknowledgement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv Become a published author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii Comments welcome. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviii Chapter 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1 Overview of WebSphere Portlet Factory . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2 Capabilities of WebSphere Portlet Factory . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.3 Development with WebSphere Portlet Factory . . . . . . . . . . . . . . . . . . . . . . 3 1.3.1 Builders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.3.2 Models. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.3.3 Profiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.4 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.4.1 Builders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.4.2 Models. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.4.3 Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.4.4 WebApp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.4.5 Generation, Part 2: Profiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Chapter 2. Scenario introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.1 Overview of the sample scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.1.1 Scenario background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.1.2 Roles specific to the sample application scenario. . . . . . . . . . . . . . . 16 2.2 Preview of the sample application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 2.2.1 Overview of the application functionality . . . . . . . . . . . . . . . . . . . . . . 17 2.2.2 Use cases applicable to the CSR . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.2.3 Use cases applicable to an external customer . . . . . . . . . . . . . . . . . 20 2.3 Review of specific portlets - CSR perspective. . . . . . . . . . . . . . . . . . . . . . 21 2.3.1 Reviewing customer information . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.3.2 Reviewing customer order information . . . . . . . . . . . . . . . . . . . . . . . 24 2.3.3 Creating a new order on behalf of a customer . . . . . . . . . . . . . . . . . 26 2.4 Review of specific portlets - Customer perspective. . . . . . . . . . . . . . . . . . 27 2.4.1 Customer information based on authentication credentials . . . . . . . 27 2.4.2 Customer perspective - Reviewing orders . . . . . . . . . . . . . . . . . . . . 30 2.4.3 Customer perspective - Creating a new order . . . . . . . . . . . . . . . . . 31© Copyright IBM Corp. 2008. All rights reserved. v
  7. 7. 2.5 Mapping functional areas of sample application and capabilities of Portlet Factory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 2.5.1 Data Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 2.5.2 Basic user interface portlets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 2.5.3 Advanced user interface portlets. . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 2.5.4 Portlet communication and profiling . . . . . . . . . . . . . . . . . . . . . . . . . 36 Chapter 3. Creating projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 3.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 3.2 Creating a project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 3.3 Project structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 3.4 Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 3.4.1 WAR files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 3.4.2 Deployment configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 3.5 Testing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 3.6 Adding a feature set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 3.7 Conclusion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Chapter 4. Data Services: Overview and interface definition . . . . . . . . . . 67 4.1 Overview of the technical goals. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 4.1.1 Value to the Portlet Factory developer . . . . . . . . . . . . . . . . . . . . . . . 68 4.2 Data Services in Portlet Factory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 4.2.1 Architecture overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 4.2.2 Supported back-end systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 4.2.3 General concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 4.3 Developing Data Services in the sample application . . . . . . . . . . . . . . . . 73 4.3.1 Role of Data Services in ITSO Renovations . . . . . . . . . . . . . . . . . . . 74 4.3.2 Architecture and design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 4.3.3 Development steps and guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . 84 4.4 Design and implementation of data structures and Application Data Service Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 4.4.1 Data structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 4.4.2 Application Data Service Interface: Definition and operations . . . . . 92 4.5 Summary and best practices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 Chapter 5. Creating Data Services: Access to back-end systems . . . . . 105 5.1 Custom Data Service: Local XML access sample. . . . . . . . . . . . . . . . . . 106 5.1.1 Overview of accessing a custom data service . . . . . . . . . . . . . . . . 106 5.1.2 Implementing the service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 5.1.3 Testing and debugging the service . . . . . . . . . . . . . . . . . . . . . . . . . 115 5.2 SQL Data Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 5.2.1 Overview and available SQL builders . . . . . . . . . . . . . . . . . . . . . . . 118 5.2.2 Design for ITSO Renovations - Customer and order information . . 120 5.2.3 Implementing the service and operations . . . . . . . . . . . . . . . . . . . . 122vi Portal Application Development Using WebSphere Portlet Factory
  8. 8. 5.2.4 Data transformations: Use of IXml API . . . . . . . . . . . . . . . . . . . . . . 140 5.2.5 Customize data column access in SQL builders: Working with binary data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 5.2.6 Implementation of transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 5.2.7 Testing and debugging the service . . . . . . . . . . . . . . . . . . . . . . . . . 1655.3 Domino Data Access Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 5.3.1 Overview and how to use Domino Access builders . . . . . . . . . . . . 167 5.3.2 Design for ITSO Renovations: Product information . . . . . . . . . . . . 171 5.3.3 Implementing the service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 5.3.4 Data transformations: Use of Transform builders . . . . . . . . . . . . . . 185 5.3.5 Testing the service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1895.4 Data Service for external web services access. . . . . . . . . . . . . . . . . . . . 190 5.4.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 5.4.2 Design for ITSO Renovations: External product information . . . . . 192 5.4.3 Implementing the service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 5.4.4 Testing the service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206 5.4.5 Creating a Stub Service for testing . . . . . . . . . . . . . . . . . . . . . . . . . 2075.5 High-level Data Services: Wrapping access to back-end systems . . . . . 208 5.5.1 Design for ITSO Renovations: Product information . . . . . . . . . . . . 209 5.5.2 Implementing the service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 5.5.3 Testing the service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2145.6 Accessing other back-end systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 5.6.1 SAP access. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 5.6.2 J2EE Data Integration: EJB access and JMS support . . . . . . . . . . 216 5.6.3 Accessing back-end systems without Portlet Factory builders . . . . 2175.7 Summary and best practices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218Chapter 6. Creating portlets: Making it work . . . . . . . . . . . . . . . . . . . . . . 2216.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2226.2 Portlet design overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 6.2.1 The context of this chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2256.3 Development the WebSphere Portlet Factory way . . . . . . . . . . . . . . . . . 226 6.3.1 High-level overview of building portlets . . . . . . . . . . . . . . . . . . . . . . 227 6.3.2 Key builders for consumer models . . . . . . . . . . . . . . . . . . . . . . . . . 228 6.3.3 Best practices for designing large applications . . . . . . . . . . . . . . . . 2316.4 Building the web application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 6.4.1 Customer information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 6.4.2 Order List model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 6.4.3 Order Details model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2586.5 Converting the web application into portlets . . . . . . . . . . . . . . . . . . . . . . 2646.6 Configuring pages and portlets in WebSphere Portal . . . . . . . . . . . . . . . 2666.7 Accessing the Portal Credential Vault . . . . . . . . . . . . . . . . . . . . . . . . . . . 268 6.7.1 WPS Credential builder. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268 Contents vii
  9. 9. 6.7.2 Using WPS Credential builder in our application . . . . . . . . . . . . . . 269 6.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272 Chapter 7. Creating portlets: Designing the UI . . . . . . . . . . . . . . . . . . . . 275 7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276 7.1.1 What you will learn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281 7.2 Using a Rich Data Definition file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283 7.2.1 Why use an RDD? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283 7.2.2 RDD in ITSO Renovations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283 7.2.3 Adding RDD to the Customer Information portlet . . . . . . . . . . . . . . 284 7.2.4 Adding RDD to the Order List portlet . . . . . . . . . . . . . . . . . . . . . . . 286 7.2.5 Adding RDD to the Order Details and Product Details model . . . . . 287 7.2.6 How an RDD file works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288 7.2.7 When to use individual modifiers or builders instead of RDD . . . . . 290 7.2.8 Referencing and extending RDD files . . . . . . . . . . . . . . . . . . . . . . . 290 7.2.9 Examples of modifiers in the RDD Files . . . . . . . . . . . . . . . . . . . . . 294 7.2.10 Formatting the output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 7.2.11 How to create an RDD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308 7.2.12 RDD summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311 7.3 Paging your data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312 7.3.1 Adding pagination in the Order List portlet . . . . . . . . . . . . . . . . . . . 315 7.4 Using the Ajax type-ahead builder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322 7.5 Using the Dojo builders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324 7.5.1 Creating a Dojo tooltip in the Product Details portlet . . . . . . . . . . . 324 7.5.2 Adding Dojo Inline Edit in the Order Details portlet . . . . . . . . . . . . . 334 7.6 Dojo drag and drop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336 7.7 Using other Dojo features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341 7.8 Customizing the UI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346 7.8.1 UI elements of a Portlet Factory page. . . . . . . . . . . . . . . . . . . . . . . 347 7.9 HTML templates in Portlet Factory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354 7.10 Other UI builders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356 7.11 Conclusion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358 Chapter 8. Enabling portlet communication . . . . . . . . . . . . . . . . . . . . . . . 361 8.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362 8.2 Types of inter-portlet communication . . . . . . . . . . . . . . . . . . . . . . . . . . . 363 8.2.1 Types of inter-portlet events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365 8.3 Inter-portlet communication for CSA . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366 8.3.1 CustomerInfo Model to OrderList Model . . . . . . . . . . . . . . . . . . . . . 367 8.3.2 OrderList Model to OrderDetails Model. . . . . . . . . . . . . . . . . . . . . . 395 8.3.3 CustomerCredentials Model to CustomerInfo Model . . . . . . . . . . . 413viii Portal Application Development Using WebSphere Portlet Factory
  10. 10. 8.4 Best practices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4188.5 Conclusion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419Chapter 9. Customizing the application using profiling . . . . . . . . . . . . . 4219.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422 9.1.1 Value to developers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423 9.1.2 Value to users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4239.2 Profiling defined. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4239.3 Terms and definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4259.4 Types of profiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428 9.4.1 Profile selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429 9.4.2 Profile value customization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4299.5 Selection handlers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430 9.5.1 Profile selection handlers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431 9.5.2 Value setter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4369.6 Profiling in our sample application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437 9.6.1 Different entry paths for customers and CSRs . . . . . . . . . . . . . . . . 438 9.6.2 Different field properties for customers and CSRs . . . . . . . . . . . . . 462 9.6.3 Different visibility of components for customers and CSRs . . . . . . 468 9.6.4 Runtime customization profiling . . . . . . . . . . . . . . . . . . . . . . . . . . . 4729.7 Best practices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4979.8 Conclusion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500Chapter 10. Creating the Go Shopping portlet . . . . . . . . . . . . . . . . . . . . . 50110.1 Preview of the portlet you will build in this chapter . . . . . . . . . . . . . . . . 50210.2 Components within the portlet. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50410.3 A sample wizard model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51110.4 Building the Go Shopping portlet. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51710.5 Go Shopping portlet model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52010.6 Shopping Page model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540 10.6.1 Cart model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550 10.6.2 Shopping Product Catalog model . . . . . . . . . . . . . . . . . . . . . . . . . 57510.7 Order Page model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58410.8 Confirmation model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59410.9 Conclusion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612Chapter 11. Production deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61311.1 J2EE production deployment WAR (standalone non-portal applications) . . . . . . . . . . . . . . . . . . . . . . . . . . . 614 11.1.1 Building the Production War from the Designer . . . . . . . . . . . . . . 614 11.1.2 Deploying the production WAR to your application server . . . . . . 614 11.1.3 Portlet production deployment War . . . . . . . . . . . . . . . . . . . . . . . . 615 11.1.4 Deploying the Portlet WAR to your portal server . . . . . . . . . . . . . 617 Contents ix
  11. 11. 11.2 Excluding files from your application . . . . . . . . . . . . . . . . . . . . . . . . . . . 618 11.3 General deployment concepts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618 Chapter 12. Troubleshooting, debugging, and error handling . . . . . . . . 619 12.1 Troubleshooting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 620 12.1.1 Fixing compilation errors at design time . . . . . . . . . . . . . . . . . . . . 620 12.1.2 Diagnosing, resolving, and reporting runtime errors . . . . . . . . . . . 622 12.2 Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623 12.2.1 Debugging back end connectivity issues . . . . . . . . . . . . . . . . . . . 624 12.3 Error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624 12.4 Other troubleshooting information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629 12.4.1 Known limitations and issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629 12.4.2 WebSphere Portlet Factory TechNotes . . . . . . . . . . . . . . . . . . . . 629 12.4.3 WebSphere Portlet Factory Forums . . . . . . . . . . . . . . . . . . . . . . . 629 Appendix A. Setting up the environment . . . . . . . . . . . . . . . . . . . . . . . . . 631 Deploying the Domino database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632 Creating the groups in Portal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633 Customer Self-Service Application details . . . . . . . . . . . . . . . . . . . . . . . . . . . 634 Creating the application schema and data . . . . . . . . . . . . . . . . . . . . . . . . 635 Import and deploy the web service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642 Import and deploy the project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643 Installing the application theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643 Creating the pages for the CSA application . . . . . . . . . . . . . . . . . . . . . . . 643x Portal Application Development Using WebSphere Portlet Factory
  12. 12. Appendix B. Creating a Web service using WebSphere Portlet Factory 645WebSphere Portlet Factory exposes Data Services as external Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 646Implementation of the Product Web Service in ITSO Renovations application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648Deploying and using the Web Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651Testing the Web Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 654Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655Appendix C. Remote deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 658Remote deployment procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 658Advantages and disadvantages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 672Appendix D. Configuring the RAD Unified Test Environment . . . . . . . . . 673Setting up deployment configurations using RAD with an Embedded Test Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674Appendix E. Considerations for WAS CE . . . . . . . . . . . . . . . . . . . . . . . . . 681Adding a database pool to the WAS CE server . . . . . . . . . . . . . . . . . . . . . . . 682Modifying the development environment when deploying to WAS CE . . . . . 683 Modifying the project configuration files . . . . . . . . . . . . . . . . . . . . . . . . . . 683Appendix F. Execution processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687Execution processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688Execution: Portal action/render phases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691Appendix G. Additional material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693Locating the Web material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693Using the Web material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694Related publications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695Online resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695How to get Redbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695Help from IBM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697 Contents xi
  13. 13. xii Portal Application Development Using WebSphere Portlet Factory
  14. 14. Preface WebSphere® Portlet Factory is a powerful and flexible tool for rapidly building portlets on top of a service-oriented architecture. It enables developers to quickly and easily leverage their companys core assets, automatically assembling them into custom, high-value portlets. In this book, we show you specific techniques and a best practices approach for developing portlets using WebSphere Portlet Factory. Using a fictitious company scenario, we discuss how to build a Customer Self Service and Customer Representative application. Within this context, we cover the following topics: Installing and configuring the Portlet Factory development environment How to create and consume data services from SQL, Domino® and a Web service Step-by-step guidance for creating the portlets and enabling inter-portlet communication Advanced UI design techniques, including the use of AJAX for type ahead functionality and working with the Dojo Builders Enabling the use of profiling Deployment production considerations Troubleshooting and debugging techniquesThe team that wrote this book This book was produced by a team of specialists from around the world working at the International Technical Support Organization, Cambridge, Massachusetts, USA Center. David Bowley is a consultant with e-Centric Innovations in Melbourne Australia, and has been working with IBM® technologies since 1999. David specializes in the WebSphere Portal and Lotus® Domino product range, and is a regular contributor to several IT publications. David was also a co-author of the Redpaper for Portal Express Version 6.© Copyright IBM Corp. 2008. All rights reserved. xiii
  15. 15. Emily Chan is a Technical Consultant in IBM Global Business Services based out of Sydney, Australia. She has 3 years of experience in various projects focusing on products based on the WebSphere Portal framework. She holds a Bachelor degree of Computer System Engineering from the University of New South Wales. Her area of expertise is Portal Content Management focusing on Portal framework design, build and performance testing. Thulsi Krishnan is a IT Specialist in IBM India Software Labs based out of Bangalore, India. He has over 10 years of IT experience and has been focussing on portal projects for the past 2 years. He is currently pursuing a Masters degree in Computer science from VTU, Belagaum India part time. His area of expertise include J2EE™ application development and designing user interfaces. He also instructs on portal technologies for partners. Thulsi enjoys travelling, reading about new technologies and enjoying time with the family and friends. Jason Lee is a Portal Technical Leader for IBM Lotus Software Group ASEAN and leads the pre-sales engagements in the region. He has over 8 years of development and management experience and has been involved in many intranet and extranet portal projects which include development of the Singapore Governments e-business portal. He holds a masters in computer science and business administration from the National University of Singapore and Bradford University respectively. His experiences include development in ASP/DCOM, J2EE Frameworks and other web technologies. Devang Patel is a Team Lead in WebSphere Portlet Factory Technical Support Organization based out of Research Triangle Park, NC, US. He has 5 years of experience in various products based on the WebSphere Portal framework. He holds a Masters degree in Computer Science from North Carolina State University. His areas of expertise include rapid J2EE application development, designing complex user interfaces, and Sarbanes-Oxley compliance framework. He has written extensively on serviceability related topics.xiv Portal Application Development Using WebSphere Portlet Factory
  16. 16. Alfredo Navarro is a Senior Software Engineer in Lotus Workforce Management based on the Dublin Software Lab, Ireland. He has 7 years of experience in Enterprise Application Integration, Web Services and Portal applications. He holds a degree in Computer Science from the University of Zaragoza, Spain. He has spent more than 5 years working as Architect in Germany and developing skills in integration technologies, workflow engines and back-end connectors. His areas of expertise include J2EE application development, software architecture and design patterns. He has written extensively on data integra