Sun Java logo     Previous      Contents      Index      Next     

Sun logo
Sun Java System Portal Server 6 2004Q2 Developer's Guide 

Chapter 1
Introduction to the APIs

This chapter provides an introduction to customizing the portal to fit the specific needs of your organization. It describes the Sun Java System Portal Server software architecture, APIs, and programming concepts that developers can use.

This chapter contains the following sections:

See the Portal Server Administration Guide for information on administering the Portal Server software. See the Portal Server Desktop Customization Guide for information on customizing the Desktop templates and JavaServer Pages™ (JSP™.)


Note

Detailed information on the Portal Server software APIs is available in the Javadocs. The URL to access the Javadocs is:

http://hostname:port/portal/javadocs



Overview

This section provides a brief description of the Portal Server software. See Portal Server Administration Guide for a complete product architecture description.

What Is a Portal?

A portal is a doorway or entry point to a set of resources that an enterprise wants to make available to the portal’s users. For some consumer portals, the set of resources includes the entire World-Wide Web. For most enterprise portals, the set of resources includes information, applications, and other resources that are specific to the relationship between the user and the enterprise.

The primary purpose of the Portal Server software is to give end users a portal Desktop, which provides access to resources and applications. In addition, a search engine infrastructure enables intranet content to be organized and accessed from the portal Desktop.

Desktop and Desktop Hierarchy

The Desktop uses an aggregation of a variety of separate web applications (channels) within a common framework. The common framework provides multiple levels and styles of aggregation, presented to end users through a container metaphor.

In the Desktop, leaf channels are the basic unit of content, displaying a specific type of information. To the end user, a channel is a distinct unit of content in the Desktop, usually (but not always) set off with a border and header row of icons that enables users to configure the channel to their preference. A provider is a Java™ class responsible for converting the content, from a file or an application or service, into a presentable format for a channel.

The Desktop provides a mechanism for extending and aggregating content through the Provider Application Programming Interface (PAPI). The PAPI is a Java™ API that enables you to construct the basic building blocks for creating channels. Usually, though not always, channels contain content. You can also have channels of channels; that is, a container channel that aggregates other channels. A channel can also be the entire Desktop page. The container channels define the layout of the Desktop.

See Figure 1-1 for a simple representation of a portal Desktop and its providers and containers. In this figure, the Desktop front page is a tab container with two tabs. Each tab contains a table container with various channels.

Notice how one provider, in this case, URLScraperProvider, is serving more than one channel. Providers can have a one-to-many relationship with channels.

Figure 1-1  Desktop Hierarchy and Building Block Providers

This figure shows the relationship between various providers and channels.

Display Profile

The display profile is a set of XML documents used to define and configure providers and channels in the Portal Server software. The display profile defines the following three items:

A provider’s display profile document acts as a template for creating channels. They define the set of properties that channels based on this provider will make use of, as well as providing default values for these properties where appropriate. Channels and container channels must reference a provider, and will use their default property values unless the property is redefined in the channel.

The display profile used to generate a user’s Desktop is constructed by merging together multiple display profile documents. Each display profile contains a series of XML instructions for storing channel properties.

The display profile documents are stored in their entirety as a single attribute in the Sun Java System Identity Server software services layer. That is, the display profile documents are an LDAP attribute residing in an instance of the Sun Java System Directory Server software.

See the Portal Server Administration Guide and Portal Server Desktop Customization Guide for a complete discussion of the display profile and its administrative tasks.

Search Engine

The Portal Server software provides a search engine service that includes basic and advanced search and browse channels for the Desktop. The search engine uses a robot to create resource descriptions (RDs) for documents that are available in the intranet, and stores these resource descriptions in an indexed database. Resource descriptions can also be imported from another server or from a backup SOIF (Summary Object Interchange Format) file. The search engine includes Java and C APIs for submitting resource descriptions and for searching the database. The search engine database can also be used for storing other arbitrary content such as a shared content cache for other content providers.

Software Services

Portal applications and resources use Identity Server software to provide services such as authentication, single-sign-on, logging, profile, and session management. See the Identity Server Administration Guide for more information.

Application Development

As a developer, you can provide access to portal resources through the Portal Server software (and the Identity Server software) APIs. For example, you can develop channel content to define aggregation of both those channels as well as channels built from the predefined set into your site’s portal.

In extending the Portal Server software, you use the APIs in the following functional areas:

Software Architecture

Figure 1-2 shows the Portal Server software architecture. In this figure, the Portal Server software components consist of:

The Java™ Developers Kit (JDK) provides the Java run-time environment for all Java software in Portal Server and its underlying components.

The Sun Java System Web Server software, or the Sun Java System Application Server software, or the BEA WebLogic Server, or the IBM Websphere Application Server provides the web container. The application server provides the Portal Server with a robust, highly scalable web container for the Portal Server web applications. It also provides the Portal Server with compatibility for other applications written to use application server and for developers that want to use the additional enterprise services that are provided by these application servers.

The Directory Server software provides the user profile data repository. The Identity Server software provides support for core services such as profile, session, authentication, and logging. It also provides single-sign-on services, policy management, debug utility, the administration console, and client support interfaces for the Portal Server. Use the Identity Server software administration console for service, profile, and user administration. See the Identity Server Administration Guide and Portal Server Administration Guide for more information.

The Portal Server software Search Engine provides the search capability. It includes basic and advanced search and browse channels for the Desktop. It uses a robot to create resource descriptions for documents that are available in the intranet, and stores these resource descriptions in an indexed database. Search includes Java and C APIs for submitting resource descriptions and for searching the database. Search also includes an administration console module for editing Search service data and for configuring the search engine and the robot. The console also lets you edit the contents of the Search database.

The Desktop provides the primary end-user interface for the Portal Server and a mechanism for extensible content aggregation through the Content Provider Interface (PAPI). The Desktop includes a variety of providers that provide a container hierarchy and the basic building blocks for building some types of channels. The Desktop implements a display profile data storage mechanism on top of an Identity Server service for storing content provider and channel data. The Desktop also includes an administration console module for editing the display profile and other Desktop service data.

Figure 1-2  Portal Server Software Architecture

This image shows the Sun Java System Portal Server architecture including the various components included with the software.


Overview of the APIs

This section describes the Portal Server software Desktop, Search, and authentication APIs for extending your portal.

Desktop APIs

The Desktop APIs allow you to create new providers for delivering portal content to users. Conceptually, the Desktop APIs consist of Java interfaces in a “stack” as shown in Figure 1-3.

Figure 1-3  Desktop APIs

This figure shows the Portal Server software APIs.

Provider API

At the bottom of Figure 1-3 is the Provider Application Programming Interface (PAPI), a foundation that contains the interfaces, base classes, provider context, and exception classes.

As a developer, use the PAPI and extend the base classes to create new providers. See chapters 2 through 4 for more information.

The PAPI defines the interface for implementing the provider. A provider is the programmatic entity responsible for generating channels on the Desktop at runtime. The channel properties are read from the display profile by the provider code to dynamically generate the channel content.

There is not necessarily a one-to-one mapping between providers and channels; a single provider can generate one or more channels depending on how you configure it.

Building Blocks

At the next level of Figure 1-3 are the building block providers. Building block providers are those providers that are public and that you can extend to create new providers. The other providers, such as bookmark and mailcheck, are not public and are not extensible.

The building block providers in the figure are all the specific content providers (leaves) and specific container (presentation) providers that Portal Server software supplies. All these public building block classes are based upon the base PAPI classes.

As a developer, you can extend the Java classes for some of the building block providers. An administrator can then use your extended classes to define channels for end user consumption.

See the Portal Server Desktop Customization Guide for more information on the out-of-the box content providers.

Desktop Servlet

At the top of Figure 1-3 is the Desktop servlet, which routes client requests for content and processing and passes them on to the specific provider object. The Desktop servlet processes the following actions:

content

Gets the named channel’s main content

edit

Gets the named channel’s edit content

process

Allows the named channel to process form data

logout

Ends the user’s session

The action is performed on the channel (for the content, edit, and process actions). The following request parameter names are reserved by the portal Desktop.

How Concepts in the Provider API Map to the Identity Server Software

The Provider API furnishes architectural separation from the Identity Server software; but the PAPI is implemented in terms of specific Identity Server software APIs within the Portal Server software framework.

Typically, to create a provider, you will need to access various software services for provider development. For example, this might include attribute (property) access, session services, and client-based property retrieval. In the PAPI, these services are accessible through the Provider and ContainerProviderContext interfaces. The implementation of these interfaces connects to Identity Server’s software services in an implementation independent manner. The actual implementation of the software services, for the most part, is located in another layer; the context interfaces simply pull these features together into a common interface to simplify provider development.

Search APIs

The Portal Server software Search service provides:

Search Robot

The robot examines a set of selected URLs and searches for documents. For each found document, the robot then creates a resource description (RD) of the document using a predefined schema. The schema defines what pieces of information about the document are put in the RD. For example, the RD could contain a date, the author, the title, the URL, and an abstract about the document. These RDs can be grouped together or classified according to a given hierarchical taxonomy.

You can configure the robot through the Identity Server software administration console.

The robot has many customizeable parameters, including the following configuration parameters:

In addition, the robot API enables you to write custom content parsers and summarizers for special URL handling requirements. You can also use the robot API to remove advertisements, generate alerts when certain pages are found, and perform specialized logging.

Search Database

The Search database consists of Summary Object Interchange Format (SOIF) objects. The search API creates, reads, modifies, and writes the Search database entries. Assisting APIs create buffers, set and get attribute value pairs (used to define content and metadata for the objects in the database), handle exceptions, create a SOIF output stream, and read a SOIF input stream.

Normally, the Search database can be accessed by using the SOIF API, but the database can also be accessed through command-line utilities. You can also add RDs that you create, or import RDs from another database.

An RD is a description of some object to include into the system. SOIF is the format used to represent RDs.

Authentication APIs

The Portal Server software uses the Identity Server software APIs for authentication, single sign-on, session, profile, and logging.

In general, most development work for a portal developer in the Identity Server software area will be to customize the authentication interfaces. Table 1-1 explains the authentication development tasks and where to go for the information.

Table 1-1  Authentication Development Tasks  

If you want to

Go to

Change the look and feel of the authentication screen

Identity Server Administration Guide

Enable or disable authentication modules

Identity Server Administration Guide

Add a custom authentication module

Identity Server Programmer’s Guide. By default, the Identity Server software supplies authentication modules for the following types of logins: Anonymous, Certificate, LDAP, Membership, RADIUS, SafeWord, SecureID, and UNIX.


Portal Environment

This section contains the following:

Web Container

The Portal Server software providers run within the Java™ Virtual Machine provided by the web container, which may vary between different web containers. The Portal Server software environment in the Sun Java System Web Server software or Sun Java System Application Server software web container is Java™ Development Kit (JDK™) 1.3.1_04.

File System

The Portal Server product uses /opt/SUNWps (/opt is a default that can be changed during installation), /etc/opt/SUNWps, and /var/opt/SUNWps for installing Portal Server specific packages and other files into the file system.

Most Portal Server software Java classes are defined in packages under the com.sun.portal package name.

The Portal Server software installs all of its web applications code into a single web application. By default, this web application is installed on the /portal URI in the web container. The Portal Server web applications are built dynamically by the deploy command after the individual files that comprise the web application are installed onto the system.



Previous      Contents      Index      Next     


Copyright 2004 Sun Microsystems, Inc. All rights reserved.