| Last Update: | Aug 04, 2003 |
| Status: | Production |
| Version: | Any PDK Release |
Oracle9iAS Portal provides a set of APIs for extracting miscellaneous session related information. The session context includes information about the portal user including username, current session ID, IP address, and language preference. It also includes supporting information such as the Portal schema currently being used.
For an introductory overview of Session Context Services, please refer to the Primer on Session Context.
Session context services are available through the wwctx_api package.
This article describes how the Session Context services are implemented using the Services Example. It provides a guideline for adding the Session Context service to your portlet functionality.
CREATE OR REPLACE
package body SERVICES_PORTLET
is
...
function get_portlet_info
(
p_provider_id in integer
,p_language in varchar2
)
return wwpro_api_provider.portlet_record
is
l_portlet wwpro_api_provider.portlet_record;
begin
...
l_portlet.id := services_provider.SERVICES_PORTLET_ID;
l_portlet.provider_id := p_provider_id;
...
l_portlet.created_by := wwctx_api.get_user;
l_portlet.last_updated_by := wwctx_api.get_user;
...
end get_portlet_info;
...
end SERVICES_PORTLET;
/
CREATE OR REPLACE
package body SERVICES_PORTLET
is
...
function is_runnable
(
p_provider_id in integer
,p_reference_path in varchar2
)
return boolean
is
begin
/*
Portlet security check. It allows the portlet to be visible
if the user is logged on, i.e. the current session is not a
public session.
*/
return wwctx_api.is_logged_on;
end is_runnable;
...
procedure register
(
p_portlet_instance in wwpro_api_provider.portlet_instance_record
)
is
begin
...
/*
Create the names to store the portlet preferences.
*/
wwpre_api_name.create_name( p_path => PORTLET_PATH
|| p_portlet_instance.reference_path,
p_name => PREFNAME_STRING,
p_description => 'Single custom row in '
|| 'Introductory Example portlet.',
p_type_name => 'NLSID'
p_language => wwctx_api.get_nls_language);
...
end register;
...
end SERVICES_PORTLET;
/
| Revision History: |
|
| Oracle Corporation World Headquarters 500 Oracle Parkway Redwood Shores, CA 94065, USA http://www.oracle.com/ |
Worldwide Inquiries: 1-800-ORACLE1 Fax 650.506.7200 |
Copyright and Corporate Info |