Oracle9iAS Portal Developer Kit
Caching Examples

The PL/SQL caching examples provide a detailed template for creating your own cached portlets.  The code is well commented.

This document explains:

CONTENTS

This section describes the files included in the caching example.  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 caching 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:
  3. Grant your schema permission to call Oracle9iAS Portal APIs:
  4. Install the cache 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.

In order for Oracle9iAS Portal to display the Cache 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 Display Portlet Repository within the portlet called Provider.

4.  Scroll down to verify that the Cache Provider is listed with the Validation based Caching Portlet and the Expiry based Caching portlet.

You are now all set to add this portlet to your own pages.


PORTLETS

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

Validation based Caching Portlet

This portlet illustrates how Validation based Caching can be used in your portlets. It displays the current time in HH:MI:SS format.  You will find that the if you reload within the 10 seconds where the first digit of the seconds field has not yet changed, the portlet still displays the old time. Only if you refresh the page after those 10 seconds, the time displayed changes.

Expiry based Caching Portlet

This portlet illustrates how Expiry based Caching can be used in your portlets.  It displays the current time in HH:MI:SS format.   The caching period for this example is set to one minute.  You will find that the if you reload within the one minute, the portlet still displays the old time. Only if you refresh the page after one minute, the time displayed is changed.


Revision history: