Sun Java System Portal Server 7.1 Developer's Guide

JSPContainerProviderAdapter Class

To extend container functionality for JSP-based container providers, a JSPContainerProviderAdapter class is included with the software. This class extends the JSPProvider. The JSPContainerProviderAdapter can be used as the base class for any JSP-based ContainerProvider and is similar in functionality to the ContainerProviderAdapter. For example, the JSPSingleContainerProvider extends from this class.

The JSPContainerProviderAdapter class provides default implementations of methods in the ContainerProvider interface implemented using a ContainerProviderContext object as the persistent store and extends JSPProvider to facilitate the execution of JSPs. It includes interfaces to get/setAvailableChannels(), get/setSelectedChannels(), and getContainerProviderContext().

Three sample extensions (namely JSPSingleContainerProvider Class, JSPTableContainerProvider Class, and JSPTabContainerProvider Class) to the JSPContainerProviderAdapter API are included.

JSPSingleContainerProvider Class

This section contains discusses about the JSPSingleContainerProvider in detail:

Introduction to JSPSingleContainerProvider

A single container wraps the content of a single channel. The single container enables a channel to take over an entire browser page. For example, this can be used to provide the front page or can be used to display a single channel whose name is passed in the request parameter. Typically, the front page consists of some banners and the output of another channel. The purpose of the single channel is to allow these banners, menu bars, and the like to be wrapped around the content of the included channel.

Another purpose of the single container is that the decorational elements (such as banners and menu bars) which wrap around the channel can be easily changed without changing the channel itself.

Using the JSPSingleContainerProvider

The JSPSingleContainerProvider class extends JSPContainerProviderAdapter. A single container simply displays a single leaf channel or a container. It must be a JSP that wraps a container or leaf channel.

ProcedureThe JSPSingleContainerProvider Class

  1. Gets the selected channel name.

  2. Returns the selected channel name as a String.

    If more than one channel is defined, it displays the first channel in the list.

    Some examples of single container include JSPContentContainer, JSPLayoutContainer, JSPEditContainer.