Oracle9iAS Portal Developer Kit
Database Provider Starter Examples

The database provider starter examples provide a detailed template for creating your own database providers and portlets. The code is well commented.

This document explains:

- How the starter examples are packaged and how to install them

- The two portlets included in the starter example:

  - Hello World
  - Snoop

### CONTENTS

This section describes the files included in the starter example. There are package specifications (*.pks), package bodies (*.pkb), and a bare-bones installation script.

Files

- HELLOWORLD_PORTLET.pks: Contains detailed comments and headers for the Hello World Portlet.

- HELLOWORLD_PORTLET.pkb: Logic behind Hello World Portlet.

- SNOOP_PORTLET.pks: Contains detailed comments and headers for the Snoop Portlet.

- SNOOP_PORTLET.pks: Logic behind Snoop Portlet.

- STARTER_PROVIDER.pks: Contains detailed comments and headers for the Starter Provider.

- STARTER_PROVIDER.pkb: Logic behind Starter Provider.

- insintpr.sql: Installation script.

Documentation

- install.starter.html: This document.

###
SETUP

To give you a good understanding of what goes on behind the scenes, these instructions describe how to install the database provider starter examples manually.

Installing the Packages

1. Find provsyns.sql and change to that directory (e.g. c:\portal30\webdb30\admin\plsql\wwc). Later, you will run this script to grant permission to call Oracle9iAS Portal APIs.
2. Create the schema where you will install the example.
   - Login to sqlplus (e.g. sqlplus sys/change_on_install)
   - Create a new schema (e.g. create user starter identified by starter;)
   - Give it permissions (e.g. grant connect, resource to starter;)
3. Grant your schema permission to call Oracle9iAS Portal APIs
   - Login as the schema where your portal is installed (e.g. connect portal30/portal30;)
   - Run provsyns.sql as the schema where your portal is installed (e.g. @provsyns.sql starter;)
   - Exit sqlplus
4. Install the starter example
   - Change to the directory where you unzipped this example
   - Login to sqlplus as your schema (e.g. sqlplus starter/starter)
   - Run insintpr.sql (e.g. @insintpr.sql)

The insintpr.sql script runs each of the PL/SQL package scripts in turn. After completing these steps, all the logic needed to run your starter database provider and portlets resides in the database.

Registering Your Provider

In order for Oracle9iAS Portal to display the Starter Provider (and for your users to see your portlets), you need to register this new provider:

1. Login to Oracle9iAS Portal as a portal administrator.
2. Click the Administer tab.
3. Under the Administer tab, click on Add a Portlet Provider within the portlet called Provider.
4. Fill out Provider information for the Sample.

   - Name: Starter_Provider

   - Display Name: Starter Provider

   - Timeout: 100

   - Timeout Message: Application Timed Out

   - Implementation Style: Database

   - Provider Login Frequency: Never

   - Register on Remote Nodes: No

   - Owning Schema: STARTER (or the name of the schema you created for this provider)

   - Package Name: STARTER_PROVIDER.

   5. Click OK.

Note: This registration can also be done programmatically. Please see the PL/SQL API Reference for more information.

###
PORTLETS

The portlets in the Starter Provider are meant to serve as a guide for developing PL/SQL portlets. They have been refined to reflect the best practices in PL/SQL portlet development.

Hello World Portlet

The Hello World Portlet is designed to illustrate a basic portlet framework which you can fill. It uses all the portlet show modes and in doing so it exposes all the different ways a portlet can be used. The main show mode is MODE_SHOW, which you see on the portlet itself.

The links on the portlet banner expose other show modes (Help - MODE_SHOW_HELP, About - MODE_SHOW_ABOUT, Customize - MODE_SHOW_EDIT). If you click on the title of the portlet, you see MODE_DETAILS which brings you to interface the portlet would show if it could use the entire screen.

Two other modes which can be seen elsewhere are MODE_PREVIEW and MODE_EDIT_DEFAULTS for customizing the settings of this portlet for all Portal users. You can see MODE_PREVIEW by clicking on the portlet title before adding it to a page. Access MODE_EDIT_DEFAULTS when you customize a page: the portlet placeholder shows a link "Edit Defaults".

Snoop Portlet

The Snoop Portlet is builds on the model of the Hello World Portlet and adds a listing the what is inside the Portlet Runtime Record. This record contains all the information needed for a portlet to both react and interact with its environment.

Revision history:

- September 28, 2000. Version 1.0.5.