OracleAS Portal 10g: Build Portlets with Java

Similar documents
Oracle 9i Forms Developer: New Features

Oracle9i: XML Fundamentals for Developers

Oracle9i Database: Data Mining Techniques

Oracle Agile 9.3 New Features Student Guide

Oracle9i Database: Using OLAP

Oracle9i Database: Advanced Instance Tuning

Oracle Database 10g: Advanced PL/SQL

Oracle Database 10g: New Manageability Features

Oracle Database 10g: 2 Day DBA for Windows

Oracle Database 10g: Data Guard Administration

Oracle 10g: XML Fundamentals

Evaluated Configuration for Oracle Identity and Access Management 10g ( )

Using Oracle Collaboration Suite Release 2 Student Guide

11i ebusiness Suite Essentials for Implementers

Oracle Database 10g: SQL Fundamentals I

Oracle Application Server 10g R2: Administration II

Embarcadero Rapid SQL Developer 2.0 Installation Guide

E Oracle 10g Java Bootcamp II v1

OracleAS 10g R3: Build J2EE Applications II

Embarcadero Rapid SQL Developer 2.1 Installation Guide

Evaluated Configuration for Oracle Identity and Access Management 10g ( )

Oracle Application Server 10g R3: Administration

Oracle Forms Developer 10g: Move to the Web

Oracle Fusion Middleware

11i/2.6 Implement Oracle Workflow Student Guide

Bring the Java World and Web Services into Your Portal. An Oracle White Paper September 2005

Rapid SQL Developer Debugger 2.1 User Guide

Rapid SQL Developer Debugger 2.0 User Guide

Embarcadero Change Manager 5.1 Installation Guide. Published: July 22, 2009

Oracle Tuning Pack. Table Of Contents. 1 Introduction. 2 Installation and Configuration. 3 Documentation and Help. 4 Oracle SQL Analyze

Peter Moskovits Principal Product Manager Oracle Corporation. Sue Vickers Group Manager Oracle Corporation

Oracle Alert Documentation Updates

11i Extend Oracle Applications: Building OA Framework Applications Student Guide

Technical Enhancements

Oracle Standard Management Pack

Oracle Application Server Discoverer

Embarcadero DB Optimizer 1.5 New Features Guide. Published: March 16, 2009

E Oracle 10g Java Bootcamp I v1

Copyright 1998, 2009, Oracle and/or its affiliates. All rights reserved.

Oracle 10g: Java Programming

Oracle Data Integrator 11g: Advanced Integration and Development Student Guide

Oracle Business Intelligence Discoverer

Oracle Application Express: Administration Student Guide

Oracle WebCenter Portal. Starting Points for Oracle WebCenter Portal Installation

Embarcadero All-Access Server Installation Guide

Oracle Adaptive Access Manager: Administration Student Guide

Embarcadero PowerSQL 1.1 New Features Guide. Published: July 14, 2008

Oracle Database 10g: SQL Fundamentals I

Oracle Utilities Customer Self Service Release Whitepaper: Consuming OUCSS Taskflows in Custom Portals E October 2011

Oracle 11g: XML Fundamentals

Embarcadero Change Manager 5.1 Installation Guide

Evaluation Guide - WebSphere Integration

New Features in Primavera Professional 15.2

AutoVue Document Print Service. Overview

New Features in Primavera P6 16.2

Oracle Trace Monitor User s Guide

Oracle WebCenter JSR-168 Container

USING ADMINISTRATOR FEATURES

Oracle BI Publisher 11g R1: Fundamentals

Oracle Fusion Middleware

Oracle Data Integrator: Administration and Development Volume I Student Guide

ER/Studio Enterprise Portal User Guide

Oracle Warehouse Builder 10g: Implementation Part 2

OracleAS 10g R3: Java Programming

Oracle Fusion Middleware

Embarcadero All-Access Client User Guide. Last Updated: 7/11/09

Oracle Service Bus 10g R3: Design & Integrate Services for SOA

ER/Studio Enterprise Portal 1.1 New Features Guide

Oracle WebCenter Portal

Oracle Hyperion Data Relationship Management Administration Activity Guide

ER/Studio Enterprise Portal 1.1 Installation Guide

Adaptive Risk Manager Challenge Question Cleanup 10g ( ) December 2007

Oracle Enterprise Manager

Oracle Fusion Middleware. 1 Oracle Team Productivity Center Server System Requirements. 2 Installing the Oracle Team Productivity Center Server

Product Documentation. ER/Studio Portal. Installation Guide. Version 1.5 Published October 8, 2009

Oracle Information Rights Management Oracle IRM Windows Authentication Extension Guide 10gR3 August 2008

This presentation is for informational purposes only and may not be incorporated into a contract or agreement.

Oracle Customer Care. Implementation Guide. Release 11i. August, 2000 Part No. A

Oracle Enterprise Manager


Java Programming Language

Describe CVS Tutorial

Oracle Information Rights Management Sealed for Lotus Notes Extension 10gR3 PR3 May 2008

Oracle Enterprise Single Sign-on Kiosk Manager

OIPA System Requirements. Oracle Insurance Policy Administration - Life Release 8.1 E May 2009

Oracle BPM 10g R3 Programming 1 Essentials

Oracle Database. Products Available on the Oracle Database Examples Media. Oracle Database Examples. Examples Installation Guide 11g Release 1 (11.

Oracle Fusion Middleware

ER/Studio Data Architect

equestionnaire User Guide

Oracle Cloud What's New for Oracle WebCenter Portal Cloud Service

Oracle Enterprise Manager Ops Center. Introduction. What You Will Need

ER/Studio Enterprise Portal User Guide

Oracle Enterprise Manager Ops Center. Introduction. What You Will Need. Hardware and Software Configuration

Oracle Banking Channels Bank User Base

Oracle Database 10g: Using OLAP

SAS Web Infrastructure Kit 1.0. Overview

Oracle Application Testing Suite: Introduction Student Guide

Oracle Database Express Edition

Oracle WebCenter WSRP Consumer

Transcription:

OracleAS Portal 10g: Build Portlets with Java Student Guide D16650GC10 Edition 1.0 June 2004 D39508

Author Peter Moskovits Technical Contributors and Reviewers Martin Alvarez S. Arunagirinathan Chris Broadbent Martijn van der Bruggen Matthew Davidchuck Uta Jacobi Linda Klein Peter Laseau Peter Lubbers Mark Pare Glenn Stokol Sue Vickers Vanessa Wang Prasad Yammanur Tina Yetman Publisher Hemachitra K Copyright 2004, Oracle. All rights reserved. This documentation contains proprietary information of Oracle Corporation. It is provided under a license agreement containing restrictions on use and disclosure and is also protected by copyright law. Reverse engineering of the software is prohibited. If this documentation is delivered to a U.S. Government Agency of the Department of Defense, then it is delivered with Restricted Rights and the following legend is applicable: Restricted Rights Legend Use, duplication or disclosure by the Government is subject to restrictions for commercial computer software and shall be deemed to be Restricted Rights software under Federal law, as set forth in subparagraph (c)(1)(ii) of DFARS 252.227-7013, Rights in Technical Data and Computer Software (October 1988). This material or any portion of it may not be copied in any form or by any means without the express prior written permission of Oracle Corporation. Any other copying is a violation of copyright law and may result in civil and/or criminal penalties. If this documentation is delivered to a U.S. Government Agency not within the Department of Defense, then it is delivered with Restricted Rights, as defined in FAR 52.227-14, Rights in Data-General, including Alternate III (June 1987). The information in this document is subject to change without notice. If you find any problems in the documentation, please report them in writing to Education Products, Oracle Corporation, 500 Oracle Parkway, Box SB-6, Redwood Shores, CA 94065. Oracle Corporation does not warrant that this document is error-free. Oracle and all references to Oracle Products are trademarks or registered trademarks of Oracle Corporation. All other products or company names are used for identification purposes only, and may be trademarks of their respective owners.

Contents I Introduction Course Objectives I-2 Course Agenda: Day 1 I-4 Course Agenda: Day 2 I-5 1 Introduction to OracleAS Portal Objectives 1-2 Enterprise Portal Solution 1-3 Oracle Application Server Components 1-4 What Is Grid Computing? 1-6 What Is OracleAS Portal? 1-7 Extensible Portal Framework 1-8 What Is a Portal Page? 1-10 Accessing Portal Pages 1-11 What Is a Portlet? 1-12 Anatomy of a Portlet 1-13 What Is a Portlet Provider? 1-14 Requesting a Portal Page 1-16 Built-in Portal Pages 1-17 OracleAS Portal Builder Page 1-18 OracleAS Portal Navigator 1-19 Page Group and Portal Page Modes 1-20 Getting Help About OracleAS Portal 1-21 Major User Roles in OracleAS Portal 1-22 Building Portlets in OracleAS Portal 1-24 Challenges of the Portlet Developer 1-26 When Are Programmatic Portlets the Best Development Choice? 1-28 Provider Development Options 1-29 Web or Database Providers 1-32 What Is the OracleAS Portal Developer Kit? 1-33 The Web Provider Architecture 1-34 The PDK-Java Deployment Environment 1-35 The Development Environment 1-36 Summary 1-37 Practice Overview 1-38 Practice 1 1-39 2 Developing and Deploying Simple J2EE-Based Portlets Objectives 2-2 Overview of Java Servlets 2-3 Benefits of Servlets 2-4 Overview of JavaServer Pages 2-5 Benefits of JSPs 2-6 Creating J2EE-Based Portlets 2-8 Overview of the Web Provider Configuration Files 2-9 How to Create a J2EE-Based Portlet 2-10 iii

Portlet Renderers 2-12 Step 1. Writing the Portlet Code 2-13 Step 2. Creating the Provider Definition File 2-17 Step 3. Defining the web.xml Configuration File 2-23 Step 4. Packaging the Provider for Deployment 2-25 Step 5. Deploying Web Providers 2-28 Step 6. Testing Web Providers 2-29 Step 7. Registering Web Providers 2-30 Step 7. Registering Web Providers: General Properties 2-33 Step 7. Registering Web Providers: Control Access 2-36 Step 8. Adding the Portlet to a Portal Page 2-37 How to Build a J2EE-Based Portlet with Oracle JDeveloper 2-38 Step 1. Invoking the Java Portlet Wizard 2-39 Step 1. The Java Portlet Wizard 2-41 Step 1. Automating the Generation of the Configuration Files 2-42 Step 2. Creating a Deployment Profile 2-43 Step 2. Deploying the Provider to the Application Server 2-44 Step 3. Testing the Web Provider from JDeveloper 2-45 Summary 2-46 Practice Overview 2-47 Practice 2 2-48 3 Extending Portlet Functionality Objectives 3-2 Identifying Portlet Show Modes 3-3 Shared Screen Mode 3-5 Preview Mode 3-7 Show Details Mode 3-8 Edit and Edit Defaults Mode 3-9 About and Help Modes 3-10 Link Mode 3-11 Managing Portlet Display Modes 3-12 Managing Portlet Show Modes 3-13 Using the Page Style in the Portlet Code 3-14 OracleAS Portal Session 3-16 The Session Context 3-17 Methods of the ProviderUser Class 3-18 Methods of the RenderContext Class 3-19 Session Storage 3-20 PDK-Java Session Services 3-21 Methods of the ProviderSession Class 3-22 Accessing the Session Storage 3-23 Before Using the Session Store 3-25 Storing Objects in the Session Storage 3-26 Enabling Sessions in Web Providers 3-28 iv

Registering Session-Enabled Web Providers 3-29 Summary 3-30 Practice Overview 3-31 Practice 3 3-32 4 Enhancing Portlet Reusability Through Parameters and Events Objectives 4-2 Overview of Parameter Passing 4-3 Parameter Types 4-4 Adding Public Parameters to Portlets 4-5 Step 1. Adding Public Portlet Parameter Definition to the Provider Definition File 4-6 Step 2. Reading the Public Portlet Parameter 4-7 Step 2. Reading Multiple Public Portlet Parameters 4-8 Adding Public Parameters to Portlets with the Java Portlet Wizard 4-10 Supporting Public Portlet Parameters 4-11 Passing Page Parameters 4-12 Private Portlet Parameters 4-13 Passing Private Portlet Parameters 4-14 Reading Parameters Passed to Portlets 4-15 Comparing Qualified and Unqualified Private Portlet Parameters 4-16 Overview of Events 4-17 Supporting Events 4-18 Setting Up Events 4-19 Adding Event Support to Portlets 4-20 Step 1. Declaring Events and Event Parameters in the Provider Definition File 4-21 Step 2. Reference the Declared Events in the Portlet Renderer Code 4-22 Adding Events to Portlets with the Java Portlet Wizard 4-26 Rendering Multiple JSPs in the Same Portlet Container 4-27 Summary 4-31 Practice Overview 4-32 Practice 4 4-33 5 Implementing Portlet Customization Objectives 5-2 Preference Storage Overview 5-3 Customizing Portlets 5-4 Setting Portlet Defaults 5-5 Storing Portlet Customization Data 5-6 Implementing Portlet Customization 5-7 Writing the Portlet Customization Code 5-8 The Customization Request Flow 5-10 v

Rendering the Customization Form 5-12 A Sample Customization Renderer 5-13 The Personalization Data Class 5-14 The FilePreferenceStore 5-16 The DBPreferenceStore 5-17 Comparing the Preference Stores 5-18 Enabling Portlet Customization 5-19 Implementing the Edit Defaults Form 5-21 Supporting Portlet Customization with the Java Portlet Wizard 5-22 Saving the Portlet State to the Preference Store 5-23 Summary 5-24 Practice Overview 5-25 Practice 5 5-26 6 Implementing Portlet Security Objectives 6-2 The Security Manager 6-3 Security Managers Provided by PDK-Java 6-4 AuthLevelSecurityManager: Levels of User Authentication 6-5 Defining the Security Manager in the Provider Definition File 6-6 Building Custom Security Managers 6-8 Defining the Custom Security Manager in the Provider Definition File 6-11 Communicating with OID 6-12 Accessing User Information from OID 6-13 Setting Up the Communication to OID 6-14 Step 1. Configuring the OidManager 6-16 Step 2. Defining the OID Connection Information 6-18 Applying the GroupSecurityManager 6-19 Accessing User Information 6-21 Summary 6-23 Practice Overview 6-24 Practice 6 6-25 7 Enhancing Portlet Performance by Using Caching Objectives 7-2 Caching Goals 7-3 Caching Portlets of Web Providers 7-4 Portlet Caching Techniques 7-6 Levels of Caching 7-8 Expiry-Based Portlet Caching 7-9 Enabling Expiry-Based Portlet Caching 7-10 Validation-Based Portlet Caching: Initial Request 7-12 Validation-Based Portlet Caching: Subsequent Request 7-13 Validation-Based Portlet Caching 7-14 OracleAS Web Cache 7-15 vi

Invalidation-Based Portlet Caching 7-17 Invalidation-Based Caching Example 7-20 Enabling Invalidation-Based Caching for Java Portlets 7-21 Step 2. Configuring the Provider Definition File 7-22 Step 3. Adding Invalidation Calls to the Portlet Code 7-23 Cached Portlet Content 7-25 Summary 7-26 Practice Overview 7-27 Practice 7 7-28 8 Writing Multilingual Portlets Objectives 8-2 Java Internationalization and Localization 8-3 About Unicode 8-4 How Java Represents Characters 8-5 The java.util.locale Class 8-6 The ResourceBundle Class 8-8 Finding ResourceBundle Key Values 8-9 Supporting Multilingual Portlets 8-10 OracleAS Portal s Multilingual Support 8-11 Building Multilingual Portlets 8-12 Step 1. Identifying Language-Dependent Strings in Your Portlet 8-13 Step 2. Creating a Default Resource Bundle 8-14 Step 3. Creating Resource Bundles for the Supported Languages 8-15 Step 4. Updating the Portlet Renderer Code 8-16 Displaying Language-Dependent Portlet Content 8-17 Displaying Country-Specific Portlet Content 8-18 Multilingual Portlet Attributes 8-19 Providing Translation for Portlet Attributes 8-20 Step 1. Adding Portlet Attributes to the Default Resource Bundle 8-21 Step 2. Adding Portlet Attributes to the Language-Specific Resource Bundles 8-23 Step 3. Updating the Provider Definition File 8-24 Step 4. Redeploying and Refreshing the Provider 8-25 Summary 8-26 Practice Overview 8-27 Practice 8 8-28 9 Enabling Portlet Logging Objectives 9-2 Overview of Logging 9-3 OC4J Application Logging 9-5 vii

Portlet Logging 9-6 Levels of Portlet Logging 9-7 Adding Logging Capabilities to Portlets 9-8 Setting Portlet Logging Level 9-9 Summary 9-11 Practice Overview 9-12 Practice 9 9-13 10 Debugging Portlets Objectives 10-2 Overview of Debugging 10-3 Remote Debugging with Oracle9i JDeveloper 10-4 Setting Up Remote Debugging in Oracle9i JDeveloper 10-5 Step 1. Configuring a Project for Remote Debugging 10-6 Step 2. Configuring OC4J s Servlet Environment for Debugging 10-7 Step 3. Starting OC4J in Remote Debugging Mode 10-9 Step 4. Starting the Debuggee Process by Accessing the Portlet 10-10 Step 5. Connecting the JDeveloper Debugger to the Portlet 10-11 JDeveloper Remote Debugging 10-12 Summary 10-13 Practice Overview 10-14 Practice 10 10-15 Appendix A - Practice Solutions Appendix B - Overview of J2EE and OC4J Appendic C - Enabling Mobile Portlets viii