Add invalidation logic to your portlet where needed for example, when the

Creating PLSQL Portlets 8-35 p_portlet_record.caching_key := MY_INITIAL_CACHE_KEY; end if; 8. Optionally, if you want to see this portlet on a page and it is not already in the Portlet Repository, refer to the instructions in Section 8.3.2, Implementing the Provider Package for information on how to add it. 9. Once your portlet appears in the repository, you can add it to a page to test it. To add your portlet to a page, follow the instructions in Oracle Fusion Middleware Users Guide for Oracle Portal.

8.8.4 Implementing Expiry-Based Caching

The caching example, located in ..\pdkplsql\pdk\plsql\cache in PDK-PLSQL pdkplsql.zip, illustrates how you can implement expiry-based caching. You can browse through this example as follows to see how the expiry-based functions are implemented in a portlet: 1. Open the expirycache_portlet.pkb file in an editor. 2. At the very top of the file, notice the aliases for the caching level constants. CREATE OR REPLACE package body VALIDCACHE_PORTLET is -- Caching Constants CACHE_LEVEL_SYSTEM constant varchar210 := SYSTEM; CACHE_LEVEL_USER constant varchar210 := USER; 3. Find the show procedure. Notice first that the p_portlet_record is an in and out parameter for this procedure. procedure show p_portlet_record in out wwpro_api_provider.portlet_runtime_record 4. In the procedures security check, the caching fields of p_portlet_record are set to null if the security check fails. begin if not is_runnable p_provider_id = p_portlet_record.provider_id ,p_reference_path = p_portlet_record.reference_path then -- Set it to null so that cache does not get used even if exists p_portlet_record.caching_level := null; p_portlet_record.caching_key := null; raise wwpro_api_provider.PORTLET_SECURITY_EXCEPTION; end if; 5. After that, the procedure sets the value of the caching period in minutes in a temporary variable: -- Set the Caching Period to one minute l_cache_period := 1; 6. Next, notice how the code checks your portlet_runtime_record parameter for the current values of the caching_period and sets the caching_period accordingly. This same piece of code can compare your caching_period values. if p_portlet_record.caching_level = CACHE_LEVEL_SYSTEM then