Portal Application Development Using Websphere Portlet Factory
Total Page:16
File Type:pdf, Size:1020Kb
Front cover Portal Application Development Using WebSphere Portlet Factory Features and techniques for rapidly developing portlets Step-by-step guidance for building a sample application Best practices, hints, tips and troubleshooting David Bowley Emily Chan Thulsi Krishnan Jason Lee Devang Patel Alfredo Navarro ibm.com/redbooks International Technical Support Organization Portal Application Development Using WebSphere Portlet Factory January 2008 SG24-7525-00 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 ADP Schedule Contract with IBM Corp. Notices This 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. Consult your 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 IBM product, program, or service may be used. Any functionally equivalent product, program, or service that does not infringe any IBM intellectual property right may be used instead. However, it is the user's responsibility 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 license inquiries, 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 such provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of 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 made to the information herein; these changes will be incorporated in new editions of the publication. IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time without notice. Any references in this information to non-IBM Web sites are provided for convenience only and do not in any manner serve as an endorsement of those Web sites. The materials at those Web sites are not part of the materials 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 without incurring any obligation to you. Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the 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 them as 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 business enterprise is entirely coincidental. COPYRIGHT LICENSE: This information contains sample application programs in source language, which illustrate programming techniques on various operating platforms. You may copy, modify, and distribute these sample programs in any form without payment to IBM, for the purposes of developing, using, marketing or distributing application programs conforming to the application programming interface for the operating platform for which the sample 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 Trademarks The 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 several other countries. Oracle, JD Edwards, PeopleSoft, Siebel, and TopLink are registered trademarks of Oracle Corporation and/or its affiliates. EJB, Java, Javadoc, JavaScript, JDBC, JRE, JSP, J2EE, and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both. Excel, Expression, Windows, and the Windows logo are trademarks of Microsoft Corporation in the United States, 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 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 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 . ..