The PL/SQL caching examples provide a detailed template for creating your own cached portlets. The code is well commented.
This document explains:
How the caching examples are packaged and how to install them
The two portlets included in the caching example:
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
expirycache_portlet.pks: Contains detailed comments and headers for the Expiry based Caching Portlet.
expirycache_portlet.pkb: Logic behind Expiry based Caching Portlet.
validcache_portlet.pks: Contains detailed comments and headers for the Validation based Caching Portlet.
validcache_portlet.pks: Logic behind Validation based Caching Portlet.
cache_provider.pks: Contains detailed comments and headers for the Cache Provider.
cache_provider.pkb: Logic behind Cache Provider.
cache_install.sql: Script that compiles the portlet and provider packages. Called internally by install.sql.
cache_register.sql : Called internally by install.sql for registering the cache provider. This needs to be run in the Portal schema only.
install.sql: Main installation script that installs this sample. Prompts the user for 4 parameters - Portal schema, Portal password, Provider schema and Provider schema password.
Documentation
installing.cache.html: This document.
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
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.
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:
January, 25 2001. Version 1.0.