Portlet Development Guide

     Previous  Next    Contents    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here


Portlet Overview

Portlet Development and the Portal Life Cycle





Getting Started


Related Guides

Part I Architecture

Portlet Planning

Portlet Development in a Distributed Portal Team

Portlets in a Non-Portal Environment

Planning Portlet Instances


Interportlet Communication

Performance Planning

Portlet Types

Java Server Page (JSP) and HTML Portlets

Java Portlets (JSR 168)

Java Page Flow Portlets

Struts Portlets

Java Server Faces (JSF) Portlets

Browser (URL) Portlets

Clipper Portlets

Remote Portlets

Portlet Type Summary Table

Part II Development

Understanding Portlet Development

Portlet Components

Portlet Properties

Portlet Title Bar, Mode, and State

Portlet Preferences

Resources for Creating Portlets

Portlet Rendering

Render and Pre-Render Forking

Asynchronous Portlet Content Rendering

Portlets as Popups (Detached Portlets)

JSP Tags and Controls in Portlets

Backing Files

Building Portlets

Supported Portlet Types

Portlets in J2EE Shared Libraries

Portlet Wizard Reference

Order of Creation - Resource or Portlet First

Creating the Resource First

Create the Portlet First

Starting the Portlet Wizard

New Portlet Dialog

Select Portlet Type Dialog

Portlet Details Dialogs

How to Build Each Type of Portlet

JSP and HTML Portlets

Java Portlets

Building a Java Portlet

Java Portlet Deployment Descriptor

Importing and Exporting Java Portlets for Use on Other Systems

Customizing Java Portlets Using weblogic-portlet.xml

Floatable Java Portlets

Adding an Icon to a Java Portlet

Portlet Init-Params

Java Page Flow Portlets

JSF Portlets

The Artifacts

JSF Portlet Views

View Technologies

Document Structure

Using JSPs in JSF Portlets

Browser Portlets

Clipper Portlets

Struts Portlets

Configuring Multi-Part Form Data Support for a Struts Portlet

Remote Portlets

Web Service Portlets

Detached Portlets

Considerations for Using Detached Portlets

Building Detached Portlets

Working with Inlined Portlets

Extracting Inlined Portlets

Setting the Theme of an Inlined Portlet

Extracting Books and Pages

Portlet Properties

Editing Portlet Properties

Tips for Using the Properties View

Portlet Properties in the Portal Properties View

Portlet Properties in the Portlet Properties View

Portlet Preferences

Specifying Portlet Preferences

Specifying Preferences for Java Portlets in the Deployment Descriptor

Specifying Preferences for Other Types of Portlets using Workshop for WebLogic

Using the Preferences API to Access or Modify Preferences

Getting Preferences Using the Preferences API

Setting Preferences Using the Preferences API

Getting and Setting Preferences for Java Portlets Using the Preferences API

Getting and Setting Portlet Preferences Using the API for Other Portlet Types

JSP Tags for Getting Portlet Preferences

Portlet Preferences SPI

Implement the SPI

Using the SPI

Best Practices in Using Portlet Preferences

Desktop Testing of Portlet Preferences

Users Must be Authenticated

Do Not Store Arbitrary Data as Preferences

Perform setup steps:

Set up preferences in your portlet:

Do Not Use Instance IDs Instead of Preferences

Backing Files

How Backing Files are Executed

Thread Safety and Backing Files

Scoping and Backing Files

Backing File Guidelines

Adding a Backing File Using Workshop for WebLogic

Adding the Backing File Directly to the .portlet File

Portlet Appearance and Features

Portlet Dependencies

Identifying Portlet Dependencies

Creating and Editing a Dependency File

Example Dependency Files

Including JavaScript in a Render Dependencies File

Including Meta and Style Elements in a Render Dependencies File

Considerations and Limitations

Scoping JavaScript Variables and CSS Styles

Rewriting Resource URLs

Portlet Modes

Adding or Removing a Mode for an Existing Portlet

Properties Related to Portlet Modes

Creating Custom Modes

Portlet States

Modifying Portlet States in Workshop for WebLogic

Minimizing or Maximizing a Portlet Programmatically

Portlet Title Bar Icons

Portlet Height and Scrolling

Making All Portlets Scroll

Getting Request Data in Page Flow Portlets

JSP Tags and Controls in Portlets

Viewing Available JSP Tags

Viewing Available Controls

Portlet State Persistence

Adding a Portlet to a Portal

Deleting Portlets

Advanced Portlet Development with Tag Libraries

Adding ActiveMenus

Configuring the ActiveMenus Tag

Using The TypeInclude tag

Using The Type Tag

Using The TypeDefault Tag

Using The menuItem Tag

Using the ActiveMenus Tag

Enabling Drag and Drop

Using the DragDrop Tags

Using the dragDropScript Tag

Using the draggableResource Tag

Using the resourceDropZone Tag

Enabling Dynamic Content

Understanding the DynamicContent Tags

The Container Tag

The Container Action Script Tag

The Execute Container Action Tag

The Parameter Tags

Using the DynamicContent Tags

Using the User Picker

Using the UserPicker Tags

Importing and Exporting Java Portlets

Importing Java Portlets

Exporting Java Portlets

Using the JSR168 Import Utility

Creating Clipper Portlets


Creating a Clipper Portlet

Modifying Clipper Portlet Properties

Using the Properties Editor

Setting Clipper Properties Manually as Preferences

Modifying the Appearance of a Clipper Portlet

Authenticating a Clipper Portlet

Form-Based Authentication

Basic HTTP Authentication

Configuring URL Rewriting

Navigable Link Configurations

Resource URL Configurations

URL Rewriting Configuration Techniques

Implementing IClipperUrlFilter

Using Portlet Preferences

Clipper Portlets and HTTPS

Certificates and WebLogic Server

Resetting the Clipper Portlet

Using Backing Files with Clipper Portlets

Updating Portlet Preferences While the Server is Running

Clipper Portlet Limitations

Optimizing Portlet Performance

Performance-Related Portlet Properties

Portlet Caching

Remote Portlets

Portlet Forking

Configuring Portlets for Forking

Architectural Details of Forked Portlets

Understanding Request Latency and the Portal Life Cycle

Queuing and Dispatching Forked Portlets for Processing

Dispatching Pre-Render Forked Portlets to Threads

Dispatching Render Forked Portlets to Threads

Threading Details and Coordination

Forking Versus Asynchronous Rendering

Best Practices for Developing Forked Portlets

Consider Thread Safety

Consider the Runtime Environment for Forked Portlets

Isolation of Forked Portlets from the Runtime Environment

BackingContext and Pre-Render Forked Portlets

Use Caution with Interportlet Communication and Forked Portlets

Asynchronous Portlet Content Rendering

Implementing Asynchronous Portlet Content Rendering

Thread Safety and Asynchronous Rendering

Considerations for IFRAME-based Asynchronous Rendering

Considerations for AJAX-based Asynchronous Rendering

Comparison of IFRAME- and AJAX-based Asynchronous Rendering

Comparison of Asynchronous and Conventional or Forked Rendering

Portal Life Cycle Considerations with Asynchronous Content Rendering

Asynchronous Content Rendering and IPC

File Upload Forms

Disabling Asynchronous Rendering for a Single Interaction

URL Compression

Monitoring and Determining Portlet Performance


Use Case

Detecting a Misbehaving Portlet

Disabling the Bad Portlet and Enabling an Alternative Portlet

Local Interportlet Communication

Definition Labels and Interportlet Communication

Portlet Events

Event Handlers

Generic Event Handlers

Event Types

Event Actions

Portlet Event Handlers Wizard Reference

Portlet Event Handlers Wizard Dialogs

Portlet Event Handlers Wizard - Add Handler Field Descriptions

Portlet Event Handlers Wizard - Add Action Field Descriptions

JSF Events

IPC Example

Before You Begin - Environment Setup

Basic IPC Example

Create the Portlets

Create the JSP Files and Portlets

Create the Backing File

Attach the Backing File

Add the Event Handler to bPortlet

Test the Project


IPC Special Considerations and Limitations

Using Asynchronous Portlet Rendering with IPC

Generic Event Handler for WSRP

Consistency of the Listen To Field

Adding the Content Presenter Portlet

Using the Content Presenter Example

Starting the Content Presenter Example

Performing Inline Editing in the Content Presenter Example

Entering Inline Edits

Enabling Inline Editing for the Training Announcement Portlet

Enabling Inline Editing in Your Portlets

Configuring the Content Presenter Portlet in Your Portal

Configuring the Content Presenter Portlet

Changing How Much Content Appears in the Portlet

Using Portlet Publishing to Expose a Content Presenter Portlet

Adding a Third-Party Portlet

Using the Collaboration Portlets

What Are Collaboration Portlets?

Adding Collaboration Portlets To Your Portal

Step 1. Add Collaboration Facets

Step 2: Add Collaboration Repository to Your Domain

Step 3: Create a Role for Collaboration Portlet Users

Step 4. (Optional) Configure a Repository

Step 5. Entitle the Collaboration Data Repository

Step 6. Add Users to the New Role

Step 7. Configure the Collaboration Portlets

Step 8. Add Collaboration Portlets to Your Desktop

Configuring Collaboration Portlets for a Shared View

Overview of User and Common Area Portlets

Configuring a Common Area Portlet

Using the Collaboration Portlets

Using the Collaboration Portlet Source Code

Copying the Source Code to Your Project

Source Code Disclaimers

Third-Party Portlets

Autonomy Portlets

Documentum Portlets

MobileAware Portlets

Working With JSF Portlets


Configuring JSF Within Weblogic Portal

JSF Library Modules in WebLogic Server

Installing the JSF Libraries into a Portal Web Project

Configuring JSF 1.2 in WLP

Creating JSF Portlets

JSF Configuration Settings

Client or Server State Storage

Prefix or Suffix Servlet Mapping

Other Settings

Native Bridge Architecture

Container Architecture Overview

Container Interactions

Understanding WLP and JSF Rendering Life Cycles

WLP and JSF Life Cycles

Invocation Order of WLP and JSF Life Cycle Methods

Accessing WLP Context Objects from JSF Managed Beans

Understanding Scopes and JSF Portlets

Conceptual Scopes for Standard JSF Applications

JSF Standard Scopes

View Scope

Pageflow/Conversation Scope

Conceptual Scopes for Portal Applications

Implementation Patterns for Portal Scopes

Reinterpretation of the JSF Session and Request Scopes

Pageflow Scope

Global Session and Portlet Group Session Scopes

State Sharing Patterns

State Sharing Concepts

HttpSession Versus HttpServletRequest

Store State in the HttpSession

Drawbacks of Using the HttpSession

Base Code for HttpSession Patterns


SearchBeanBase (For HttpSession Patterns)

Single Portlet Pattern

Portlet Instance Session Scoped Data (uses HttpSession)

Multiple Portlet Patterns

Pattern: Global Session Scoped Data (uses HttpSession)

Pattern: Portlet Group Session Scoped Data (uses HttpSession)

Instance Label Pattern

Portlet Preference

Pattern: Portlet Group Session Scoped Data (uses Events)

Trigger Portlet

Listener Portlets

Using Common WLP Features With JSF Portlets

Portlet Container Features

Support for Modes in JSF Portlets

Portlet Error Page

Portlet Preferences

Portal Container Features and JSF Portlets


Skeleton Files

Understanding Navigation

Navigating Within a Portlet with the JSF Controller

Support for Redirects

Navigation Within a Portal Environment

Programmatically Constructing JSF Portlet URLs

Changing the Active Portal Page

Using an Output Link

Using a Command Link or Button With Events

Changing the Active Portal Page Using the Navigation Controller and a Portal Event

Changing the Active Portal Page Programmatically

Interportlet Communication with JSF Portlets

Using Session and Request Attributes for IPC (Anti-pattern)

Using the WLP Event Facility for IPC with JSF Portlets

Triggering a Portal Framework Event from a JSF Portlet

Listening for a Portal Framework Event in a JSF Portlet


Comparison of the IPC Approaches



Namespacing Managed Bean Names

Client ID Namespacing with the View and Subview Components

Client ID Namespacing with the WLP NamingContainer

NamingContainer Use Cases

Use Case 1: Multiple Portlet Instances on a Page with Desktop Asynchronous Mode Enabled

Use Case 2: Using EL to Connect Multiple Components on a Page

Use Case 3: Generating DOM Element IDs for Custom JavaScript

Best Practice: Always Use the NamingContainer

NamingContainer in EL Expressions

Using Custom JavaScript in JSF Portlets

DOM Manipulation within a JSF Portlet

Introduction to the Use Case

DOM Manipulation Use Case

Form Validation within a JSF Portlet

Ajax Enablement

Ajax in JSF Portlets

Partial Page Rendering Pattern

Asynchronous Desktop Mode

Asynchronous Portlet Mode – Ajax or IFrame

Stateless API Request Pattern

Portlet Aware API Request Pattern

Portlet Aware Data API Example

Controlling the WLP Ajax Framework

Forcing a Non-Targeted Portlet to Render

Disabling Partial Page Rendering Ajax for a Request

Localizing JSF Portlets

Configuring the JSF Locale

Resource Bundles

Listing Locales in faces-config.xml

Ensuring Parity in Configured WLP and JSF Locales

Modularizing Resource Bundles

Preparing JSF Portlets for Production

Configuration Tasks

Configuring URL Templates for Proxy Servers

JSF Portlets with WSRP

Defining Error Pages

Performance and Scalability

JSF Portlets in a Clustered Environment

Portlet Render Caching

Securing JSF Portlets

Deny Direct Access to the Portlet Views

Session Timeouts

Tips for Logging, Iterative Development, and Debugging of JSF Portlets

Enabling Logging

Using Iterative Development for JSF Portlets

Testing Outside of the Portlet Container

Using Application Republish

HttpSession Caching

Handling OutOfMemory Errors


Step 1: Attaching Source

Step 2: Suggested JSF Framework Break Points

Consolidated List of Best Practices



Logging, Iterative Development, Debugging

Custom JavaScript

Preparing JSF Portlets for Production

Interportlet Communication


State Sharing Patterns

Rendering Lifecycles

Ajax Enablement

Login Portlet

Part III Staging

Assembling Portlets into Desktops

Portlet Library

Managing Portlets Using the Administration Console

Copying a Portlet in the Library

Modifying Library Portlet Properties

Modifying Desktop Portlet Properties

Deleting a Portlet

Managing Portlets on Pages

Adding Portlets to a Page

Positioning Elements on a Page

Overview of Portlet Categories

Creating a Portlet Category

Modifying Portlet Category Properties

Adding Portlets to a Portlet Category

Overview of Portlet Preferences

Creating a Portlet Preference

Editing a Portlet Preference

Overview of Delegated Administration

Overview of Visitor Entitlements

Deploying Portlets

Deploying Portlets

Part IV Production

Managing Portlets in Production

Pushing Changes from the Library into Production

Transferring Changes from Production Back to Development

Part V Appendixes

Portlet Database Data

Database Structure for Portlet Data

Removing Portlets from Production

Portlet Resources in the Database

Types of Database Tables

Management of Portlet Data

How the Database Shows Removed Portlets

JSF Portlet Development

Code Examples

The JSFPortletHelper Class

Login Portlet Example

Login Portlet Motivation

Login Portlet Design


Invalidating the Session

Login Portlet Implementation

JSF Login View

JSF Managed Backing Bean


Backing File

Resource Bundle

Portlet Definition File

Using Facelets

Introduction to Facelets

Configuring Facelets Support

Using Tomahawk

What is Apache MyFaces Tomahawk?

Support for Tomahawk in WLP

Use Tomahawk 1.1.7 and Later

Portlet Scoping

Ajax Enablement

Installing and Configuring Tomahawk

Resolving the Duplicate ID Issue

CleanupPhaseListener Class

Referring to Resources

Using DefaultAddResource (Not recommended)

Using NonBufferingAddResource (Simplest)

Using a Static WLP Render Dependencies File (Most correct, but tedious)

Using Dynamic WLP Render Dependencies (Not possible, for reference only)

forceId Attribute

File Upload

Integrating Apache Beehive Pageflow Controller

Apache Beehive Page Flow

JSF and Page Flows

Configuring the JSF Integration with Page Flows


Building Unsupported JSF Implementations

  Back to Top       Previous  Next