Oracle9iAS Portal Developer Kit
Database Provider Samples

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

This document explains:

CONTENTS

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

Files

Documentation


SETUP

To give you a good understanding of what goes on behind the scenes, these instructions describe how to install the database provider samples 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.
  3. Grant your schema permission to call Oracle9iAS Portal APIs:
  4. Install the sample example:
The install.sql script runs each of the PL/SQL package scripts in turn.  After completing these steps, all the logic needed to run your sample database provider and portlets resides in the database.

Registering Your Provider

The install script automatically registers your Provider for you. At the end of installation it prints out the Provider Registration information. Please verify that the Provider was registered successfully.

1.  Login to Oracle9iAS Portal as a portal administrator.

2.  Click the Administer tab.

3.  Under the Administer tab, click on Display Portlet Repository within the portlet called Provider.

4.  Scroll down to verify that the Sample Provider is listed with the Parameters Portlet and the HTML CSS Portlet.

You are now all set to add these portlets to your own pages.


PORTLETS

The portlets in the Sample Provider are meant to serve as a guide for developing PL/SQL portlets that require parameters or use the Cascading Style Sheets.  They have been refined to reflect the best practices in PL/SQL portlet development.

Parameters Passing Portlet

 

The Parameters Portlet is designed to illustrate how you can pass parameters between portlets. Create a page with two instances of this portlet and see how you can pass values from one portlet instance to the other.

This portlet will take a name in a field provided on the portlet, and expect the user to click on either of two buttons provided -  'Display in this portlet' or 'Display in all portlets'. Depending on the button clicked, the portlet will pass the name entered in the field to the same portlet or other portlets on the page. On receiving the parameter, the portlet will substitute the welcome message on the portlet with the addition of the new parameter.

You can choose to pass your parameters to all the portlets on a page or to a specific portlet on the page by specifying the reference path of that instance. This sample provides well-commented code to help you with such functionality.

 

CSS Portlet

 

The CSS Portlet illustrates the usage of Cascading Style Sheets. The different styles for different lines on this portlet are derived from CSS. Using HTML CSS has several advantages : 

As an example if you want to use the CSS Font class of PortletHeading3.

HTML code to generate :

<p>

<FONT class="PortletHeading3">This is a sample Heading3</FONT>

PL/SQL code that generates the HTML code above :

htp.para

l_text_name := 'This is sample Heading3';

l_text := wwui_api_portlet.portlet_heading(p_string => l_text_name, p_level => 3);

htp.p(l_text);

This sample provides well-commented code to help you with such functionality.

 


Revision history: