Oracle Application Server Portal PL/SQL API Reference - 10.1.4

Package wwctx_api

This package contains APIs that allow access to a session context. The wwctx_api session context API package provides the methods necessary to manage a session context for a specific user.

A session is established when a user accesses the Portal from a browser. A public session is created upon initial access from the browser. It is converted to an authenticated session after the user logs in and exists until the user logs out. Old sessions are also cleaned up periodically by the Portal.

Scope:
Public


Exception Summary
AUTHENTICATION_EXCEPTION
Authentication failed.
GENERAL_CONTEXT_EXCEPTION
Deprecated. As of 9.0.2
An unknown error occurred.
INACCESSIBLE_API_EXCEPTION
Deprecated. As of 9.0.2
API is undefined.
INACTIVE_SESSION_EXCEPTION
Session marked as inactive.
INVALID_COOKIE_EXCEPTION
The cookie could not be validated.
INVALID_SESSION_TYPE_EXCEPTION
The type of the current portal session is invalid.
NO_LOCAL_NODE_EXCEPTION
Deprecated. As of 9.0.2.
Local node information is missing.
NO_REMOTE_SESSION_EXCEPTION
Deprecated. As of 9.0.2
Remote session is missing.
NO_SESSION_EXCEPTION
No session was found for the current user.
NULL_PAPP_EXCEPTION
The login url is invalid.
NULL_SCHEMA_EXCEPTION
The SSO schema is null.
SSO_CONFIG_EXCEPTION
Deprecated. As of 9.0.2
Single sign-on configuration is not correct.
SYSTEM_VAR_NAME_EXCEPTION
System variable not found.
UNAUTHORIZED_ACCESS_EXCEPTION
Not a valid portal user.
UNSYNCED_SESSION_EXCEPTION
Session context and cookie do not match.

Type Summary
system_var_name_type
 subtype
system_var_names_type
 table
system_var_value_type
 subtype

Constant Summary
NO_AUTHENTICATION
 number
PUBLIC_AUTHENTICATION
 number
REQUIRED_AUTHENTICATION_LEVEL
 number
STRONG_AUTHENTICATION
 number
SYSTEM_VAR_COMPANY_NAME
 system_var_name_type
SYSTEM_VAR_NLS_LANG
 system_var_name_type
SYSTEM_VAR_NLS_TERRITORY
 system_var_name_type
SYSTEM_VAR_SUBSCRIBER_ID
 system_var_name_type
SYSTEM_VAR_USER_ID
 system_var_name_type
SYSTEM_VAR_USER_NAME
 system_var_name_type
WEAK_AUTHENTICATION
 number

Function/Procedure Summary
clear_context
Clear the session context.
 
get_authentication_level
Get the authentication level of the user.
 number
get_base_url
Return the base URL, also known as the URL prefix.
 varchar2
get_bidi_imagename
This function returns the image name appropriate for the selected language.
 varchar2
get_company_name
Returns the company name associated with an Oracle Portal user.
 varchar2
get_dad_name
Get the value of the DAD_NAME cgi variable.
 varchar2
get_db_user
Get the name of the database schema corresponding to the current user of the system (as determined by the session context).
 varchar2
get_direct_doc_path
Returns the path to a file stored in the Oracle Portal repository.
 varchar2
get_doc_access_path
Get the value of the DOC_ACCESS_PATH cgi variable.
 varchar2
get_flex_proc_path
Generate a fully qualified URL for flexible parameter passing from a relative URL.
 varchar2
get_gateway_iversion
Returns the internal version number of the gateway used to access the repository.
 varchar2
get_host
Get the hostname and port of the server.
 varchar2
get_host_lowercase
Get the hostname and port of the server in lowercase.
 varchar2
get_http_accept
Get the value of the HTTP_ACCEPT cgi variable.
 varchar2
get_http_accept_charset
Get the value of the HTTP_ACCEPT_CHARSET cgi variable.
 varchar2
get_http_accept_encoding
Get the value of the HTTP_ACCEPT_ENCODING cgi variable.
 varchar2
get_http_accept_language
Get the value of the HTTP_ACCEPT_LANGUAGE cgi variable.
 varchar2
get_http_language
Returns the HTTP language used by the current Oracle Portal user.
 varchar2
get_http_oracle_ecid
Get the value of the HTTP_ORACLE_ECID cgi variable.
 varchar2
get_http_referer
Returns the HTTP Referer header value.
 varchar2
get_http_user_agent
Get the value of the HTTP_USER_AGENT cgi variable.
 varchar2
get_http_x_oracle_assert_user
Get the value of the HTTP_X_ORACLE_ASSERT_USER cgi variable.
 varchar2
get_image_path
Returns the path to the location of the product images.
 varchar2
get_ip_address
Get the IP address of the client from the session context.
 varchar2
get_last_updated
Get the time the session was last updated.
 date
get_login_time
Returns the time that the current user logged in to Oracle Portal.
 date
get_nls_language
Returns the NLS language used by the current Oracle Portal user.
 varchar2
get_nls_territory
Get the NLS territory used by the current user of the system (as determined by the session context).
 varchar2
get_oracle_cache_version
Get the value of the HTTP_ORACLE_CACHE_VERSION CGI variable.
 varchar2
get_osso_user_guid
Get the value of the OSSO_USER_GUID cgi variable.
 varchar2
get_path_alias
Get the value of the PATH_ALIAS cgi variable.
 varchar2
get_path_info
Get the value of the PATH_INFO cgi variable.
 varchar2
get_proc_path
Generate a fully qualified URL from a relative URL.
 varchar2
get_product_schema
Returns the name of the schema in which Oracle Portal is installed.
 varchar2
get_product_version
Returns the version string for the installation of Oracle Portal.
 varchar2
get_proxy_port
Retrieves the port number of the proxy server.
 integer
get_proxy_server
Returns the name of the proxy server.
 varchar2
get_public_schema
Returns the name of the public schema.
 varchar2
get_public_user
Returns the name of the public user.
 varchar2
get_query_string
Get the value of the QUERY_STRING cgi variable.
 varchar2
get_remote_addr
Get the value of the REMOTE_ADDR cgi variable.
 varchar2
get_request_charset
Get the value of the REQUEST_CHARSET cgi variable.
 varchar2
get_schema_user
Get the name of the schema user as returned by SELECT USER FROM DUAL.
 varchar2
get_script_name
Get the value of the SCRIPT_NAME cgi variable.
 varchar2
get_script_prefix
Get the value of the SCRIPT_PREFIX cgi variable.
 varchar2
get_server_name
Get the value of the SERVER_NAME cgi variable.
 varchar2
get_server_port
Get the value of the SERVER_PORT cgi variable.
 varchar2
get_server_protocol
Get the web server's protocol - http or https.
 varchar2
get_servlet_path
Generate a fully qualified URL to the Parallel Page Engine.
 varchar2
get_session_expire_time
Get the time when the session will expire.
 date
get_session_start_time
Get the time when the session started.
 date
get_sessionid
Get current session id for the session context.
 number
get_sso_proc_path
Generate a fully qualified URL for the Login Server from a relative URL.
 varchar2
get_sso_product_version
Get the SSO product version.
 varchar2
get_sso_query_path
Get the url prefix to use for HTTP queries to the login server.
 varchar2
get_sso_schema
Returns the Single Sign-On schema name.
 varchar2
get_subscriber_id
Determines the subscriber ID of an Oracle Portal user.
 number
get_sysdate
Get the system date as returned by SELECT SYSDATE FROM DUAL.
 date
get_system_var_names
Get the set of external system variable names.
 system_var_names_type
get_system_var_value
Get the value of an external system variable given its name.
 system_var_value_type
get_translation_language
Get the translation language used by the current user of the system.
 varchar2
get_user
Returns the user name of the current Oracle Portal user.
 varchar2
get_user_id
Returns the user ID of the user currently logged in.
 number
get_x_oracle_cache_auth
Get the value of the HTTP_X_ORACLE_CACHE_AUTH CGI variable.
 varchar2
get_x_oracle_cache_device
Get the value of the HTTP_X_ORACLE_CACHE_DEVICE CGI variable.
 varchar2
get_x_oracle_cache_encrypt
Get the value of the HTTP_X_ORACLE_CACHE_ENCRYPT CGI variable.
 varchar2
get_x_oracle_cache_lang
Get the value of the HTTP_X_ORACLE_CACHE_LANG CGI variable.
 varchar2
get_x_oracle_cache_subid
Get the value of the HTTP_X_ORACLE_CACHE_SUBID CGI variable.
 varchar2
get_x_oracle_cache_user
Get the value of the HTTP_X_ORACLE_CACHE_USER CGI variable.
 varchar2
has_idle_timeout_exceeded
Check if idle timeout has occurred.
 boolean
is_context_set
Check whether a session context is set.
 boolean
is_in_login_server
Check if the current request is executing in the SSO server.
 boolean
is_logged_on
Returns a boolean indicator showing if the user is logged on.
 boolean
is_proxy_required
Check if a proxy is required to contact the specified URL.
 boolean
is_session_authenticated
Check if the session id represents an authenticated session.
 boolean
logged_on
Indicates whether the user is logged in, and returns a number instead of a Boolean value so the value returned can be used as a condition for creating a view.
 number
set_context
Set the session context for a lightweight user.
 
set_nls_language
Set the NLS language and territory of the current SQL*Plus created portal session.
 
validate_system_var_name
Validate the given system variable name.
 

Exception Detail

AUTHENTICATION_EXCEPTION

AUTHENTICATION_EXCEPTION exception
Authentication failed. This exception indicates that the authentication of a user for setting the session context has failed. This is typically due to bad credentials, resulting in an authentication failure from the OID server. However, it may also be due to inability to contact the OID server.

GENERAL_CONTEXT_EXCEPTION

GENERAL_CONTEXT_EXCEPTION exception
Deprecated. As of 9.0.2
An unknown error occurred.

INACCESSIBLE_API_EXCEPTION

INACCESSIBLE_API_EXCEPTION exception
Deprecated. As of 9.0.2
API is undefined.

INACTIVE_SESSION_EXCEPTION

INACTIVE_SESSION_EXCEPTION exception
Session marked as inactive. This exception indicates that the session row specified by the session cookie is marked as inactive. This indicates that the user has logged out of this session, and the cookie on the browser did not get updated, but the session row has not yet been cleaned up.

INVALID_COOKIE_EXCEPTION

INVALID_COOKIE_EXCEPTION exception
The cookie could not be validated. This exception indicates that the cookie could not be properly decrypted, indicating that it is corrupt, or not otherwise a valid Portal session cookie.

INVALID_SESSION_TYPE_EXCEPTION

INVALID_SESSION_TYPE_EXCEPTION exception
The type of the current portal session is invalid. The types of portal sessions are WEB and SQL*Plus. Some portal APIs are only supported in only one of these portal sessions. This exception is raised if such an API call is made from a non-supported portal session type.

NO_LOCAL_NODE_EXCEPTION

NO_LOCAL_NODE_EXCEPTION exception
Deprecated. As of 9.0.2.
Local node information is missing. This exception would occur in 3.0.9 if a portal was configured for distributed portal functionality, but a misconfiguration caused the identifier of the local node to be missing.

NO_REMOTE_SESSION_EXCEPTION

NO_REMOTE_SESSION_EXCEPTION exception
Deprecated. As of 9.0.2
Remote session is missing.

NO_SESSION_EXCEPTION

NO_SESSION_EXCEPTION exception
No session was found for the current user. This exception indicates that there is no session row in the Portal repository corresponding to the session cookie sent with the request. This exception indicates that the session most probably has been cleaned up.

NULL_PAPP_EXCEPTION

NULL_PAPP_EXCEPTION exception
The login url is invalid. This exception indicates that the login URL stored in the SSO-SDK enabler configuration table is not a valid URL, which prevents this API from using it to construct a URL to the SSO server.

NULL_SCHEMA_EXCEPTION

NULL_SCHEMA_EXCEPTION exception
The SSO schema is null. This exception indicates that the schema name of the SSO server could not be obtained from the system level preference store.

SSO_CONFIG_EXCEPTION

SSO_CONFIG_EXCEPTION exception
Deprecated. As of 9.0.2
Single sign-on configuration is not correct.

SYSTEM_VAR_NAME_EXCEPTION

SYSTEM_VAR_NAME_EXCEPTION exception
System variable not found. This exception indicates that the specified system variable name does not exist.

UNAUTHORIZED_ACCESS_EXCEPTION

UNAUTHORIZED_ACCESS_EXCEPTION exception
Not a valid portal user. This exception indicates that unauthorized access was attempted.

UNSYNCED_SESSION_EXCEPTION

UNSYNCED_SESSION_EXCEPTION exception
Session context and cookie do not match. This exception indicates that the session cookie sent by the browser does not match the session cookie stored with the session row in the repository. This is most likely due to a problem encountered in the routine that would have otherwise updated the session cookie resulting in the database update getting committed, but the session cookie not making it to the browser.

Type Detail

system_var_name_type

subtype system_var_name_type is varchar2(50)

system_var_names_type

type system_var_names_type is table of system_var_name_type index by binary_integer

system_var_value_type

subtype system_var_value_type is varchar2(2000)

Constant Detail

NO_AUTHENTICATION

NO_AUTHENTICATION constant number := 0

PUBLIC_AUTHENTICATION

PUBLIC_AUTHENTICATION constant number := 7

REQUIRED_AUTHENTICATION_LEVEL

REQUIRED_AUTHENTICATION_LEVEL constant number := PUBLIC_AUTHENTICATION

STRONG_AUTHENTICATION

STRONG_AUTHENTICATION constant number := 10

SYSTEM_VAR_COMPANY_NAME

SYSTEM_VAR_COMPANY_NAME constant system_var_name_type := 'COMPANY_NAME'

SYSTEM_VAR_NLS_LANG

SYSTEM_VAR_NLS_LANG constant system_var_name_type := 'NLS_LANG'

SYSTEM_VAR_NLS_TERRITORY

SYSTEM_VAR_NLS_TERRITORY constant system_var_name_type := 'NLS_TERRITORY'

SYSTEM_VAR_SUBSCRIBER_ID

SYSTEM_VAR_SUBSCRIBER_ID constant system_var_name_type := 'SUBSCRIBER_ID'

SYSTEM_VAR_USER_ID

SYSTEM_VAR_USER_ID constant system_var_name_type := 'USER_ID'

SYSTEM_VAR_USER_NAME

SYSTEM_VAR_USER_NAME constant system_var_name_type := 'USER_NAME'

WEAK_AUTHENTICATION

WEAK_AUTHENTICATION constant number := 5

Function/Procedure Detail

clear_context

procedure clear_context
Clear the session context.

This procedure clears the context of the session established by a previous call to wwctx_api.set_context.

Example:

     wwctx_api.clear_context;
 
Since:
Oracle Portal 3.0.6.6.5
See Also:
wwctx_api.set_context

get_authentication_level

function get_authentication_level
return number
Get the authentication level of the user.

This function returns the authentication level of the user based on whether the user has not been authenticated by the system at all, has been identified based on a persistent cookie, has been authenticated as a PUBLIC user, or has been authenticated as a user whose identity is known to the system.

Returns:
the authentication level of the user. It will have one of the following values:
  • NO_AUTHENTICATION constant number := 0;
  • WEAK_AUTHENTICATION constant number := 5;
  • PUBLIC_AUTHENTICATION constant number := 7;
  • STRONG_AUTHENTICATION constant number := 10;
Exceptions:
NO_SESSION_EXCEPTION - raised when a session cannot be restored because the session data is not found
INVALID_COOKIE_EXCEPTION - raised when a session cannot be restored because the the session cookie is corrupt
INACTIVE_SESSION_EXCEPTION - raised when a session cannot be restored because it is marked inactive
UNSYNCED_SESSION_EXCEPTION - raised when a session cannot be restored because the cookie value does not match the value stored in the session repository
Since:
Oracle Portal 3.0.9.8.2

get_base_url

function get_base_url
return varchar2
Return the base URL, also known as the URL prefix.

This routine will return the base URL, which might look something like this:

http://myhost.us.oracle.com:3000/pls/portal/

Example:

     v_ret := wwctx_api.get_base_url;
 
Returns:
the base URL for the current DAD.
Purity:
WNDS
Since:
Oracle Portal 9.0.2.6

get_bidi_imagename

function get_bidi_imagename(
    imagename in varchar2,
    current_suffix in varchar2 default null,
    new_suffix in varchar2 default null
) return varchar2
This function returns the image name appropriate for the selected language.

Some images used in the product are not appropriate for use when the selected NLS language is one that is typically read from right to left, such as Arabic or Hebrew. This function allows the correct image name to be constructed that is appropriate for the current language.

Parameters:
imagename - the image name
current_suffix - to be replaced
new_suffix - to be added
Returns:
correct image for the language
Since:
Oracle Portal 9.0.2

get_company_name

function get_company_name
return varchar2
Returns the company name associated with an Oracle Portal user. If the portal is deployed in a multi-company scenario then it will return the company (subscriber) name that the user entered upon successful authentication.

If the portal is deployed in a single company scenario then it will get the name from the user profile table.

Note:

A subscriber is also referred to as an Identity Management Realm.

Returns:
the name of the company (or Identity Management Realm) that the user is associated with.
Exceptions:
NO_SESSION_EXCEPTION - raised when a session cannot be restored because the session data is not found
INVALID_COOKIE_EXCEPTION - raised when a session cannot be restored because the the session cookie is corrupt
INACTIVE_SESSION_EXCEPTION - raised when a session cannot be restored because it is marked inactive
UNSYNCED_SESSION_EXCEPTION - raised when a session cannot be restored because the cookie value does not match the value stored in the session repository
Since:
Oracle Portal 3.0.9.8.2

get_dad_name

function get_dad_name
return varchar2
Get the value of the DAD_NAME cgi variable.

This API obtains the value of the DAD_NAME cgi environment variable. The DAD used to make the current request is the DAD name returned.

This API calls OWA_UTIL to get the referenced environment variable and caches the result in package global variables so that subsequent calls don't need to invoke OWA_UTIL again.

Example:

     declare
         l_dad_name varchar2;
     begin
         l_dad_name := wwctx_api.get_dad_name;
     end;
 
Returns:
the value of the DAD_NAME cgi variable.
Since:
Oracle Portal 3.0.7.7.2

get_db_user

function get_db_user
return varchar2
Get the name of the database schema corresponding to the current user of the system (as determined by the session context).

Note: This is the database schema under which the PL/SQL code is executed for the current user.

Example:

This example returns the database user_id for the database schema with which the current Oracle Portal user is associated.

 declare
     v_userid number;
 begin
     select user_id into v_userid
     from all_users
     where user_name = wwctx_api.get_db_user;

     return v_userid;
 end;
 
Returns:
the database schema for the user that is logged into the system
Exceptions:
NO_SESSION_EXCEPTION - raised when a session cannot be restored because the session data is not found
INVALID_COOKIE_EXCEPTION - raised when a session cannot be restored because the the session cookie is corrupt
INACTIVE_SESSION_EXCEPTION - raised when a session cannot be restored because it is marked inactive
UNSYNCED_SESSION_EXCEPTION - raised when a session cannot be restored because the cookie value does not match the value stored in the session repository
Since:
Oracle Portal 3.0.6.6.5

get_direct_doc_path

function get_direct_doc_path(
    p_name in varchar2 default null
) return varchar2
Returns the path to a file stored in the Oracle Portal repository.

If no path name is provided, the function returns the Oracle Portal repository path (during installation this defaults to /docs).

Use this function to construct URLs to documents stored in wwdoc_document$. For example, if the filename specified is '123.GIF' the function returns a path such as 'docs/1/123.GIF'.

The primary use of this function is to retrieve image documents. It does not retrieve the direct access URL that is needed for documents such as HTML files, which may have relative URLs in the file itself, e.g. docs/page/A/B/C/MYPAGE.HTML.

Example:

 declare
     l_path varchar2(256);
 begin
     l_path := wwctx_api.get_direct_doc_path(
         p_name => '123.GIF');
 end;
 
Parameters:
p_name - the name of the file in the portal repository to which the path is requested
Returns:
virtual path to the image repository directory or file
Since:
Oracle Portal 9.0.2

get_doc_access_path

function get_doc_access_path
return varchar2
Get the value of the DOC_ACCESS_PATH cgi variable.

This API obtains the value of the DOC_ACCESS_PATH cgi environment variable.

This API calls OWA_UTIL to get the referenced environment variable and caches the result in package global variables so that subsequent calls don't need to invoke OWA_UTIL again.

Example:

     declare
         l_doc_access_path varchar2;
     begin
         l_doc_access_path := wwctx_api.get_doc_access_path;
     end;
 
Returns:
the value of the DOC_ACCESS_PATH cgi variable.
Since:
Oracle Portal 9.0.2

get_flex_proc_path

function get_flex_proc_path(
    p_url in varchar2,
    p_schema in varchar2 default get_product_schema
) return varchar2
Generate a fully qualified URL for flexible parameter passing from a relative URL.

This routine will generate a fully qualified URL from a partial, or relative, URL that is suitable for calling via Listener's Flexible parameter passing convention.

Example:

     v_ret := wwctx_api.get_flex_proc_path(
         'wwptl_app_favorites?p_arg1=10');
 
Parameters:
p_url - the relative URL.
p_schema - the schema to prefix the URL.
Returns:
fully qualified URL to the relative URL parameter.
Purity:
WNDS
Since:
Oracle Portal 3.0.6.6.5

get_gateway_iversion

function get_gateway_iversion
return varchar2
Returns the internal version number of the gateway used to access the repository.

Example:

 declare
     l_gateway_iversion varchar2(40);
 begin
     l_gateway_iversion := wwctx_api.get_gateway_iversion;
     ...
 end;
 
Since:
Oracle Portal 10.1.4.0.0

get_host

function get_host
return varchar2
Get the hostname and port of the server.

This function returns the server and port for the host as provided by the SERVER_NAME and SERVER_PORT CGI environment variables. If the port is the default port for the current protocol, then it is not included in the returned value. Otherwise it will return server:port.

Example:

     v_ret := wwctx_api.get_host;
 
Returns:
server_name[:server_port]
Since:
Oracle Portal 3.0.7.7.2

get_host_lowercase

function get_host_lowercase
return varchar2
Get the hostname and port of the server in lowercase.

This function returns the server and port for the host as provided by the SERVER_NAME and SERVER_PORT CGI environment variables. If the port is the default port for the current protocol, then it is not included in the returned value. Otherwise it will return server:port. It converts the return value to lowercase.

Example:

     v_ret := wwctx_api.get_host_lowercase;
 
Returns:
server_name[:server_port]
Since:
Oracle Portal 3.0.9.8.2

get_http_accept

function get_http_accept
return varchar2
Get the value of the HTTP_ACCEPT cgi variable.

This API obtains the value of the HTTP_ACCEPT cgi environment variable.

This API calls OWA_UTIL to get the referenced environment variable and caches the result in package global variables so that subsequent calls don't need to invoke OWA_UTIL again.

Example:

     declare
         l_http_accept varchar2;
     begin
         l_http_accept := wwctx_api.get_http_accept;
     end;
 
Returns:
the value of the HTTP_ACCEPT cgi variable.
Since:
Oracle Portal 3.0.7.7.2

get_http_accept_charset

function get_http_accept_charset
return varchar2
Get the value of the HTTP_ACCEPT_CHARSET cgi variable.

This API obtains the value of the HTTP_ACCEPT_CHARSET cgi environment variable.

This API calls OWA_UTIL to get the referenced environment variable and caches the result in package global variables so that subsequent calls don't need to invoke OWA_UTIL again.

Example:

     declare
         l_http_accept_charset varchar2;
     begin
         l_http_accept_charset := wwctx_api.get_http_accept_charset;
     end;
 
Returns:
the value of the HTTP_ACCEPT_CHARSET cgi variable.
Since:
Oracle Portal 3.0.7.7.2

get_http_accept_encoding

function get_http_accept_encoding
return varchar2
Get the value of the HTTP_ACCEPT_ENCODING cgi variable.

This API obtains the value of the HTTP_ACCEPT_ENCODING cgi environment variable, which is obtained from the Apache configuration as the Port parameter.

This API calls OWA_UTIL to get the referenced environment variable and caches the result in package global variables so that subsequent calls don't need to invoke OWA_UTIL again.

Example:

     declare
         l_http_accept_encoding varchar2;
     begin
         l_http_accept_encoding := wwctx_api.get_http_accept_encoding;
     end;
 
Returns:
the value of the HTTP_ACCEPT_ENCODING cgi variable.
Since:
Oracle Portal 3.0.7.7.2

get_http_accept_language

function get_http_accept_language
return varchar2
Get the value of the HTTP_ACCEPT_LANGUAGE cgi variable.

This API obtains the value of the HTTP_ACCEPT_LANGUAGE cgi environment variable.

This API calls OWA_UTIL to get the referenced environment variable and caches the result in package global variables so that subsequent calls don't need to invoke OWA_UTIL again.

Example:

     declare
         l_cgi_variable varchar2;
     begin
         l_cgi_variable := wwctx_api.get_server_port;
     end;
 
Returns:
the value of the HTTP_ACCEPT_LANGUAGE cgi variable.
Since:
Oracle Portal 3.0.7.7.2

get_http_language

function get_http_language
return varchar2
Returns the HTTP language used by the current Oracle Portal user.

Get the HTTP language used by the current user of the system (as determined by mapping the NLS language stored in the session context to its corresponding HTTP abbreviation (IANA Language code)), such as 'en-us' (English), 'fr-fr' (French), 'de-de' (German).

Example:

 declare
     l_http_language varchar2(30);
 begin
     l_http_language := wwctx_api.get_http_language;
     ...
 end;
 
Since:
Oracle Portal 3.0.6.6.5

get_http_oracle_ecid

function get_http_oracle_ecid
return varchar2
Get the value of the HTTP_ORACLE_ECID cgi variable.

This API obtains the value of the HTTP_ORACLE_ECID cgi environment variable. This value is the unique ID for the request passed from mod_plsql.

This API calls OWA_UTIL to get the referenced environment variable and caches the result in package global variables so that subsequent calls don't need to invoke OWA_UTIL again.

Example:

     declare
         l_request_ecid varchar2(30);
     begin
         l_request_ecid := wwctx_api.get_http_oracle_ecid;
     end;
 
Returns:
the value of the HTTP_ORACLE_ECID cgi variable.
Since:
Oracle Portal 9.0.2

get_http_referer

function get_http_referer
return varchar2
Returns the HTTP Referer header value.

Example:

 declare
     l_http_referer varchar2(30);
 begin
     l_http_referer := wwctx_api.get_http_referer;
     ...
 end;
 
Since:
Oracle Portal 10.1.4

get_http_user_agent

function get_http_user_agent
return varchar2
Get the value of the HTTP_USER_AGENT cgi variable.

This API obtains the value of the HTTP_USER_AGENT cgi environment variable. This cgi environment variable specifies the type of browser that is making the request.

This API calls OWA_UTIL to get the referenced environment variable and caches the result in package global variables so that subsequent calls don't need to invoke OWA_UTIL again.

Example:

     declare
         l_http_user_agent varchar2;
     begin
         l_http_user_agent := wwctx_api.get_http_user_agent;
     end;
 
Returns:
the value of the HTTP_USER_AGENT cgi variable.
Since:
Oracle Portal 3.0.7.7.2

get_http_x_oracle_assert_user

function get_http_x_oracle_assert_user
return varchar2
Get the value of the HTTP_X_ORACLE_ASSERT_USER cgi variable.

This API obtains the value of the HTTP_X_ORACLE_ASSERT_USER cgi environment variable, which the PPE sends to modplsql as the x-oracle-assert-user HTTP header. This header is used for controlling portlet cache behavior.

This API calls OWA_UTIL to get the referenced environment variable and caches the result in package global variables so that subsequent calls don't need to invoke OWA_UTIL again.

Example:

     declare
         l_assert_user varchar2(256);
     begin
         l_assert_user := wwctx_api.get_http_x_oracle_assert_user;
     end;
 
Returns:
the value of the HTTP_X_ORACLE_ASSERT_USER cgi variable, or null if it is undefined.
Since:
Oracle Portal 9.0.2

get_image_path

function get_image_path(
    p_filename in varchar2 default null
) return varchar2
Returns the path to the location of the product images. This function constructs the path to the specified image file. It does not include the host name, just the path relative to the root.

If no filename is provided then the function simply returns the path to the directory where the static images are located.

Notes:

Example:

 declare
     l_image varchar2(200);
 begin
     l_image := wwctx_api.get_image_path
     (
         p_filename => 'DIVISION_LOGO'
     );
 end;
 
Parameters:
p_filename - the filename of the image file to which the path is requested
Returns:
virtual path to the image directory or file
Since:
Oracle Portal 3.0.6.6.5

get_ip_address

function get_ip_address
return varchar2
Get the IP address of the client from the session context.

This function returns the IP address of the client that initiated the current session context.

This may not always be the same as the IP address of the current request. A session context can be initiated by a request from the browser, or from the middle tier Parallel Page Engine (PPE).

Also, the IP address seen may be that of the machine which is hosting web cache.

Example:

This example returns the IP address of the user who is currently logged in to Oracle Portal. It returns "unknown" if there is no existing Oracle Portal session.

 begin
     return wwctx_api.get_ip_address;
 exception
     when wwctx_api.NO_SESSION_EXCEPTION then
         return 'unknown';
 end;
 
Exceptions:
NO_SESSION_EXCEPTION - raised when a session cannot be restored because the session data is not found
INVALID_COOKIE_EXCEPTION - raised when a session cannot be restored because the the session cookie is corrupt
INACTIVE_SESSION_EXCEPTION - raised when a session cannot be restored because it is marked inactive
UNSYNCED_SESSION_EXCEPTION - raised when a session cannot be restored because the cookie value does not match the value stored in the session repository
Since:
Oracle Portal 3.0.6.6.5
See Also:
wwctx_api.get_remote_addr

get_last_updated

function get_last_updated
return date
Get the time the session was last updated.
Returns:
the date that the session context was last updated
Purity:
WNDS
Exceptions:
NO_SESSION_EXCEPTION - raised when a session cannot be restored because the session data is not found
INVALID_COOKIE_EXCEPTION - raised when a session cannot be restored because the the session cookie is corrupt
INACTIVE_SESSION_EXCEPTION - raised when a session cannot be restored because it is marked inactive
UNSYNCED_SESSION_EXCEPTION - raised when a session cannot be restored because the cookie value does not match the value stored in the session repository
Since:
Oracle Portal 3.0.6.6.5

get_login_time

function get_login_time
return date
Returns the time that the current user logged in to Oracle Portal.

Example:

This example returns TRUE if the current Oracle Portal user logged in more than one day ago. It returns FALSE otherwise.

 begin
     if sysdate - wwctx_api.get_login_time > 1 then
         return TRUE;
     else
         return FALSE;
     end if;
 end;
 
Exceptions:
NO_SESSION_EXCEPTION - raised when a session cannot be restored because the session data is not found
INVALID_COOKIE_EXCEPTION - raised when a session cannot be restored because the the session cookie is corrupt
INACTIVE_SESSION_EXCEPTION - raised when a session cannot be restored because it is marked inactive
UNSYNCED_SESSION_EXCEPTION - raised when a session cannot be restored because the cookie value does not match the value stored in the session repository
Since:
Oracle Portal 3.0.6.6.5

get_nls_language

function get_nls_language
return varchar2
Returns the NLS language used by the current Oracle Portal user.

Get the NLS language used by the current user of the system (as determined by the session context), such as 'us' (English), 'f' (French), 'd' (German), etc.

Example:

This example returns unexpected error in the language being used by the user currently logged in.

 begin
     return wwnls_api.get_string
     (
         p_domain => wwnls_api.DOMAIN_WWC,
         p_subdomain => 'ctx',
         p_name => 'unexpected_error',
         p_language => wwctx_api.get_nls_language
     )
 end;
 
Exceptions:
NO_SESSION_EXCEPTION - raised when a session cannot be restored because the session data is not found
INVALID_COOKIE_EXCEPTION - raised when a session cannot be restored because the the session cookie is corrupt
INACTIVE_SESSION_EXCEPTION - raised when a session cannot be restored because it is marked inactive
UNSYNCED_SESSION_EXCEPTION - raised when a session cannot be restored because the cookie value does not match the value stored in the session repository
Since:
Oracle Portal 3.0.6.6.5

get_nls_territory

function get_nls_territory
return varchar2
Get the NLS territory used by the current user of the system (as determined by the session context).

The territory value is the territory code that the database associates with a particular NLS language. The territory values are such as 'AMERICA', 'FRANCE', 'GERMANY'.

Example:

 declare
     l_territory varchar2(30);
 begin
     l_territory := wwctx_api.get_nls_territory;
     ...
 end;
 
Exceptions:
NO_SESSION_EXCEPTION - raised when a session cannot be restored because the session data is not found
INVALID_COOKIE_EXCEPTION - raised when a session cannot be restored because the the session cookie is corrupt
INACTIVE_SESSION_EXCEPTION - raised when a session cannot be restored because it is marked inactive
UNSYNCED_SESSION_EXCEPTION - raised when a session cannot be restored because the cookie value does not match the value stored in the session repository
Since:
Oracle Portal 3.0.9.8.2

get_oracle_cache_version

function get_oracle_cache_version
return varchar2
Get the value of the HTTP_ORACLE_CACHE_VERSION CGI variable.

This API obtains the value of the HTTP_ORACLE_CACHE_VERSION CGI environment variable. This value represents the Webcache version.

This API calls OWA_UTIL to get the referenced environment variable and caches the result in package global variables so that subsequent calls don't need to invoke OWA_UTIL again.

Example:

     declare
         l_oracle_cache_version varchar2(30);
     begin
         l_oracle_cache_version := wwctx_api.get_oracle_cache_version;
     end;
 
Returns:
the value of the HTTP_ORACLE_CACHE_VERSION CGI variable
Since:
Oracle Portal 9.0.2.6

get_osso_user_guid

function get_osso_user_guid
return varchar2
Get the value of the OSSO_USER_GUID cgi variable.

This API obtains the value of the OSSO_USER_GUID cgi environment variable, which the mod_osso sends to modplsql as the Osso-User-Guid header. This header is set by mod_osso only if mod_osso either has the Global Inactivity Timeout cookie or the mod_osso cookie. The user's GUID from these cookies is included in the header. This value is not available when the session is not authenticated.

This API calls OWA_UTIL to get the referenced environment variable and caches the result in package global variables so that subsequent calls don't need to invoke OWA_UTIL again.

Example:

     declare
         l_osso_user_guid varchar2(32);
     begin
         l_osso_user_guid := wwctx_api.get_osso_user_guid;
     end;
 
Returns:
the value of the OSSO_USER_GUID cgi variable, or null if it is undefined.
Since:
Oracle AS Portal 10.1.2

get_path_alias

function get_path_alias
return varchar2
Get the value of the PATH_ALIAS cgi variable.

This API obtains the value of the PATH_ALIAS cgi environment variable.

This API calls OWA_UTIL to get the referenced environment variable and caches the result in package global variables so that subsequent calls don't need to invoke OWA_UTIL again.

Example:

     declare
         l_path_alias varchar2;
     begin
         l_path_alias := wwctx_api.get_path_alias;
     end;
 
Returns:
the value of the PATH_ALIAS cgi variable.
Since:
Oracle Portal 3.0.7.7.2

get_path_info

function get_path_info
return varchar2
Get the value of the PATH_INFO cgi variable.

The PATH_INFO cgi environment variable is obtained from the requested url. It is the portion of the url between the last slash (including it) and the question mark for the query string.

For example, taking the following URL,

 http://server.domain.com/pls/dad/schema.pkg.proc?param1=x
 
the PATH_INFO is "/schema.pkg.proc".

This API calls OWA_UTIL to get the referenced environment variable and caches the result in package global variables so that subsequent calls don't need to invoke OWA_UTIL again.

Example:

     declare
         l_path_info varchar2;
     begin
         l_path_info := wwctx_api.get_path_info;
     end;
 
Returns:
the value of the PATH_INFO cgi variable.
Since:
Oracle Portal 3.0.7.7.2

get_proc_path

function get_proc_path(
    p_url in varchar2,
    p_schema in varchar2 default get_product_schema
) return varchar2
Generate a fully qualified URL from a relative URL.

This routine will generate a fully qualified URL from a partial, or relative, URL.

Example:

     v_ret := wwctx_api.get_proc_path('wwptl_app_favorites?p_arg1=10');
 
Parameters:
p_url - the relative URL.
p_schema - the schema to prefix the URL.
Returns:
fully qualified URL to the relative URL parameter.
Purity:
WNDS
Since:
Oracle Portal 3.0.6.6.5

get_product_schema

function get_product_schema
return varchar2
Returns the name of the schema in which Oracle Portal is installed.

Example:

This example returns TRUE if the current Oracle Portal user is the Portal schema owner. It returns FALSE otherwise.

 begin
     if wwctx_api.get_user = wwctx_api.get_product_schema then
         return TRUE;
     else
         return FALSE;
     end if;
 end;
 
Returns:
the name of the schema in which the product is installed.
Since:
Oracle Portal 3.0.6.6.5

get_product_version

function get_product_version
return varchar2
Returns the version string for the installation of Oracle Portal.

Example:

 declare
     l_version varchar2(80);
 begin
     l_version := wwctx_api.get_product_version;
     ...
 end;
 
Returns:
the version string for the product.
Since:
Oracle Portal 3.0.6.6.5

get_proxy_port

function get_proxy_port
return integer
Retrieves the port number of the proxy server.

This function returns the default proxy port in the proxy settings. This function will be obsoleted and exists currently for backwards compatibility. wwctx_api_proxy.get_default_proxy should be called to get the default proxy information.

Example:

 declare
     l_proxy_server_port varchar2(80);
 begin
     l_proxy_server_port := wwctx_api.get_proxy_port;
     ...
 end;
 
Returns:
the port number of the proxy server
Since:
Oracle Portal 3.0.6.6.5
See Also:
get_proxy_server

get_proxy_server

function get_proxy_server
return varchar2
Returns the name of the proxy server.

This function returns the default proxy host in the proxy settings. This function will be obsoleted and exists currently for backwards compatibility. wwctx_api_proxy.get_default_proxy should be called to get the default proxy information.

Note:

A proxy server provides access to servers outside of a firewall. This proxy server setting is used by Portal when making HTTP requests to other servers from within the database.

Example:

 declare
     l_proxy_server varchar2(80);
 begin
     l_proxy_server := wwctx_api.get_proxy_server;
     ...
 end;
 
Returns:
the name of the proxy server
Since:
Oracle Portal 3.0.6.6.5

get_public_schema

function get_public_schema
return varchar2
Returns the name of the public schema.

The "public" schema is the default schema to which all lightweight users are mapped. This is the database schema which executes the procedures in the database upon requests from the web.

Example:

 declare
     l_public_schema varchar2(30);
 begin
     l_public_schema := wwctx_api.get_public_schema;
     ...
 end;
 
Returns:
the name of the public schema.
Since:
Oracle Portal 3.0.6.6.5

get_public_user

function get_public_user
return varchar2
Returns the name of the public user.

Before a user logs on to the system, he is unauthenticated, however, an identity is associated with him in order to assess his privileges (of any unauthenticated user). This function returns the identity that is associated with the unauthenticated user. By default, this value is always 'PUBLIC', however, this function should be called rather than hardcoding PUBLIC, in order to protect against future changes.

Example:

 declare
     l_public_user varchar2(30);
 begin
     l_public_user := wwctx_api.get_public_user;
     ...
 end;
 
Returns:
the name of the public lightweight user.
Since:
Oracle Portal 3.0.6.6.5

get_query_string

function get_query_string
return varchar2
Get the value of the QUERY_STRING cgi variable.

This API obtains the value of the QUERY_STRING cgi environment variable, which is obtained from the requested url. The query string is the portion of the url which follows the question mark "?".

This API calls OWA_UTIL to get the referenced environment variable and caches the result in package global variables so that subsequent calls don't need to invoke OWA_UTIL again.

Example:

     declare
         l_query_string varchar2;
     begin
         l_query_string := wwctx_api.get_query_string;
     end;
 
Returns:
the value of the QUERY_STRING cgi variable.
Since:
Oracle Portal 3.0.7.7.2

get_remote_addr

function get_remote_addr
return varchar2
Get the value of the REMOTE_ADDR cgi variable.

This API obtains the value of the REMOTE_ADDR cgi environment variable, which contains the IP address of the client making the HTTP request.

This function gets the IP address from the environment of the current request, in contrast to the wwctx_api.get_ip_address which returns the IP address that was logged when the user's session was initially created.

This API calls OWA_UTIL to get the referenced environment variable and caches the result in package global variables so that subsequent calls don't need to invoke OWA_UTIL again.

Example:

     declare
         l_ip_addr varchar2(23);
     begin
         l_ip_addr := wwctx_api.get_remote_addr;
     end;
 
Returns:
the value of the REMOTE_ADDR cgi variable, which is the client's IP address
Since:
Oracle Portal 9.0.2.6
See Also:
wwctx_api.get_ip_address

get_request_charset

function get_request_charset
return varchar2
Get the value of the REQUEST_CHARSET cgi variable.

This API obtains the value of the REQUEST_CHARSET cgi environment variable, which is obtained from the Apache configuration as the Port parameter.

This API calls OWA_UTIL to get the referenced environment variable and caches the result in package global variables so that subsequent calls don't need to invoke OWA_UTIL again.

Example:

     declare
         l_request_charset varchar2;
     begin
         l_request_charset := wwctx_api.get_request_charset;
     end;
 
Returns:
the value of the REQUEST_CHARSET cgi variable.
Since:
Oracle Portal 3.0.7.7.2

get_schema_user

function get_schema_user
return varchar2
Get the name of the schema user as returned by SELECT USER FROM DUAL.

This API gets the name of the schema user and saves it in the package cache. Any subsequent calls to this API in the same databse session do not require database access and thus result in improved performance.

This API is not secure and can be called by any portal user.

Example:

     declare
         l_user all_users.username%type;
     begin
         l_user := wwctx_api.get_schema_user;
         dbms_output.put_line('The schema user is ' || l_user);
     end;
 
Returns:
the name of the schema user.
Purity:
WNDS
Since:
Oracle Portal 3.0.6.6.5

get_script_name

function get_script_name
return varchar2
Get the value of the SCRIPT_NAME cgi variable.

This API obtains the value of the SCRIPT_NAME cgi environment variable. For calls through modplsql, the SCRIPT_NAME is the modplsql path and the DAD, e.g., "/pls/portal".

This API calls OWA_UTIL to get the referenced environment variable and caches the result in package global variables so that subsequent calls don't need to invoke OWA_UTIL again.

Example:

     declare
         l_script_name varchar2;
     begin
         l_script_name := wwctx_api.get_script_name;
     end;
 
Returns:
the value of the SCRIPT_NAME cgi variable.
Since:
Oracle Portal 3.0.7.7.2

get_script_prefix

function get_script_prefix
return varchar2
Get the value of the SCRIPT_PREFIX cgi variable.

This API obtains the value of the SCRIPT_PREFIX cgi environment variable. For calls through modplsql, the SCRIPT_PREFIX is the modplsql path component, e.g., "/pls".

This API calls OWA_UTIL to get the referenced environment variable and caches the result in package global variables so that subsequent calls don't need to invoke OWA_UTIL again.

Example:

     declare
         l_script_prefix varchar2;
     begin
         l_script_prefix := wwctx_api.get_script_prefix;
     end;
 
Returns:
the value of the SCRIPT_PREFIX cgi variable.
Since:
Oracle Portal 3.0.7.7.2

get_server_name

function get_server_name
return varchar2
Get the value of the SERVER_NAME cgi variable.

This API obtains the value of the SERVER_NAME cgi environment variable, which is obtained from the Apache configuration as the ServerName parameter when UseCanonicalNames is On.

This API calls OWA_UTIL to get the referenced environment variable and caches the result in package global variables so that subsequent calls don't need to invoke OWA_UTIL again.

Example:

     declare
         l_server_name varchar2(256);
     begin
         l_server_name := wwctx_api.get_server_name;
     end;
 
Returns:
the value of the SERVER_NAME cgi variable, or null if it is undefined.
Since:
Oracle Portal 3.0.7.7.2
See Also:
wwctx_api.get_server_port

get_server_port

function get_server_port
return varchar2
Get the value of the SERVER_PORT cgi variable.

This API obtains the value of the SERVER_PORT cgi environment variable, which is obtained from the Apache configuration as the Port parameter.

This API calls OWA_UTIL to get the referenced environment variable and caches the result in package global variables so that subsequent calls don't need to invoke OWA_UTIL again.

Example:

     declare
         l_port number;
     begin
         l_port := to_number(wwctx_api.get_server_port);
     end;
 
Returns:
the value of the SERVER_PORT cgi variable.
Since:
Oracle Portal 3.0.7.7.2
See Also:
wwctx_api.get_server_name

get_server_protocol

function get_server_protocol
return varchar2
Get the web server's protocol - http or https.

This function returns the string "http" or "https" depending on which protocol was used for the current page request. If not in the context of a web session, then "http" is returned.

Example:

     v_ret := wwctx_api.get_server_protocol;
 
Returns:
'http' or 'https'
Purity:
WNDS
Since:
Oracle Portal 3.0.6.6.5

get_servlet_path

function get_servlet_path(
    p_url in varchar2 default null
) return varchar2
Generate a fully qualified URL to the Parallel Page Engine.

This routine will generate a full path, to the configured Parallel Page Engine (PPE), from a partial, or relative, URL.

Example:


     v_ret := wwctx_api.get_servlet_path('page?_pageid=1');
 
would return the following:
/portal/page?_pageid=1
Parameters:
p_url - the relative URL.
Returns:
full path to the specified URL parameter.
Since:
Oracle Portal 3.0.6.6.5

get_session_expire_time

function get_session_expire_time
return date
Get the time when the session will expire.

Note:This function is defined for future use.

Returns:
The date and time when the session is due to expire.
Purity:
WNDS
Exceptions:
NO_SESSION_EXCEPTION - raised when a session cannot be restored because the session data is not found
INVALID_COOKIE_EXCEPTION - raised when a session cannot be restored because the the session cookie is corrupt
INACTIVE_SESSION_EXCEPTION - raised when a session cannot be restored because it is marked inactive
UNSYNCED_SESSION_EXCEPTION - raised when a session cannot be restored because the cookie value does not match the value stored in the session repository
Since:
Oracle Portal 3.0.9.8.2

get_session_start_time

function get_session_start_time
return date
Get the time when the session started.
Returns:
The date and time when the session began.
Purity:
WNDS
Exceptions:
NO_SESSION_EXCEPTION - raised when a session cannot be restored because the session data is not found
INVALID_COOKIE_EXCEPTION - raised when a session cannot be restored because the the session cookie is corrupt
INACTIVE_SESSION_EXCEPTION - raised when a session cannot be restored because it is marked inactive
UNSYNCED_SESSION_EXCEPTION - raised when a session cannot be restored because the cookie value does not match the value stored in the session repository
Since:
Oracle Portal 3.0.9.8.2

get_sessionid

function get_sessionid
return number
Get current session id for the session context.

This function returns the identifier for the session established for the browser connection. Also, a session may be established by a set_context procedure call. A session defines such things as the logged in user, the associated database account under which this user is executing, the nls_language, etc.

Example:

This example returns the session ID of the current Portal session.

 declare
     l_sessionid number;
 begin
     l_sessionid := wwctx_api.get_sessionid;
 end;
 
Returns:
the session id
Purity:
WNDS
Exceptions:
NO_SESSION_EXCEPTION - raised when a session cannot be restored because the session data is not found
INVALID_COOKIE_EXCEPTION - raised when a session cannot be restored because the the session cookie is corrupt
INACTIVE_SESSION_EXCEPTION - raised when a session cannot be restored because it is marked inactive
UNSYNCED_SESSION_EXCEPTION - raised when a session cannot be restored because the cookie value does not match the value stored in the session repository
Since:
Oracle Portal 3.0.6.6.5

get_sso_proc_path

function get_sso_proc_path(
    p_url in varchar2,
    p_schema in varchar2 default get_sso_schema
) return varchar2
Generate a fully qualified URL for the Login Server from a relative URL.

This routine will generate a fully qualified URL for the Login Server from a partial, or relative, URL. The Login Server may reside on a different host machine.

Example:

     v_ret := wwctx_api.get_sso_proc_path('wwptl_app_favorites?p_arg1=10');
 
Parameters:
p_url - the relative URL.
p_schema - the schema to prefix the URL.
Returns:
fully qualified URL to the relative URL parameter.
Since:
Oracle Portal 3.0.6.6.5

get_sso_product_version

function get_sso_product_version
return varchar2
Get the SSO product version.

This function retrieves the SSO product version.

Example:

     l_version := wwctx_api.get_sso_product_version;
 
Returns:
product version of the Login Server returns null if version is prior to 3.0.9
Purity:
WNDS
Since:
Oracle Portal 3.0.9.8.2

get_sso_query_path

function get_sso_query_path(
    p_url in varchar2,
    p_schema in varchar2 default get_sso_schema
) return varchar2
Get the url prefix to use for HTTP queries to the login server.

This function returns the configured 'query path' for the login server which needs to be an HTTP URL since the connections are made using UTL_HTTP which doesn't support HTTPS in the current release.

Example:

     v_ret := wwctx_api.get_sso_query_path
     (
         p_url => 'wwsso_app_admin.external_apps_list'
     );
 
Parameters:
p_url - the relative URL.
p_schema - the schema to prefix the URL.
Returns:
fully qualified URL to the relative URL parameter.
Since:
Oracle Portal 3.0.6.6.5

get_sso_schema

function get_sso_schema
return varchar2
Returns the Single Sign-On schema name.

This function returns the name of the schema of the SSO Server associated with this application.

Example:

     declare
         l_sso_schema varchar2(30);
     begin
         l_sso_schema := wwctx_api.get_sso_schema;
         dbms_output.put_line('The SSO schema name is '|| l_sso_schema);
     end;
 
Returns:
the name of the sso schema
Since:
Oracle Portal 3.0.6.6.5

get_subscriber_id

function get_subscriber_id
return number
Determines the subscriber ID of an Oracle Portal user. This function returns the subscriber ID to which the user belongs based on the browser cookie information.

Note:

This function should not be used from non-web sessions, like SQL*Plus sessions, or DBMS jobs.

Returns:
the subscriber id to which the user belongs
Since:
Oracle Portal 3.0.9.8.2

get_sysdate

function get_sysdate
return date
Get the system date as returned by SELECT SYSDATE FROM DUAL.

This API gets the system date from the database server and saves it in the package cache. Any subsequent calls to this API in the same databse session do not require database access and thus result in improved performance.

This API is not secure and can be called by any portal user.

Example:

     declare
         l_sysdate date;
     begin
         l_sysdate := wwctx_api.get_sysdate;
         dbms_output.put_line('The system time is ' ||
             to_char(l_sysdate, 'MM/DD/YYYY HH24:MI:SS'));
     end;
 
Returns:
the system date and time in seconds.
Purity:
WNDS
Since:
Oracle Portal 9.0.2.6

get_system_var_names

function get_system_var_names
return system_var_names_type
Get the set of external system variable names.

These are used, for example, when a page is being edited: the Parameters tab allows the user to assign a public portlet parameter to any one of the known external system variables. The names of these known system variables is retrieved in the UI by calling this routine.

Example:

     l_system_var_names  wwctx_api.system_var_names_type;
     l_system_var_name   wwctx_api.system_var_name_type;

     l_system_var_names := wwctx_api.get_system_var_names;
     for i in 1..l_system_var_names.count loop
         l_system_var_name := l_system_var_names(i);
         ...
     end loop;
 
Since:
Oracle Portal 9.0.2

get_system_var_value

function get_system_var_value(
    p_system_var_name in system_var_name_type
) return system_var_value_type
Get the value of an external system variable given its name.

This is used during the portion of page and flow metadata generation to convert a system variable name into its value. For example, a public portlet parameter may have been wired up to get its value from the system variable 'USER_NAME'. During metadata generation, this variable will be converted into its actual value, so the portlet can render different information on the same page, for different users. Note: this routine always returns the same set of names, so the "deterministic" compiler hint is used.

Example:

     l_system_var_names  wwctx_api.system_var_names_type;
     l_system_var_name   wwctx_api.system_var_name_type;
     l_system_var_value  wwctx_api.system_var_value_type;

     l_system_var_names := wwctx_api.get_system_var_names;
     for i in 1..l_system_var_names.count loop
         l_system_var_name := l_system_var_names(i);
         l_system_var_value := wwctx_api.get_system_var_value;
         ...
     end loop;
 
Parameters:
p_system_var_name - IN the system variable name. Valid names include the SYSTEM_VAR_* constants defined above, as well as any name in the set returned by get_system_var_names. Note that case does does not matter though.
Exceptions:
SYSTEM_VAR_NAME_EXCEPTION - raised when the given system variable name isn't recognized.
Since:
Oracle Portal 9.0.2

get_translation_language

function get_translation_language
return varchar2
Get the translation language used by the current user of the system.

Not all languages are available for translations. Whether or not a language is made available for translations is set when the language is installed. If all languages are available for translation, the get_translation_language should match the get_nls_language. However, if a certain language is not available for translation, then its corresponding get_translation_language will be 'us'.

Example:

 declare
     l_translation_language varchar2(30);
 begin
     l_translation_language := wwctx_api.get_translation_language;
     ...
 end;
 
Exceptions:
NO_SESSION_EXCEPTION - raised if specified session is not found
INVALID_COOKIE_EXCEPTION - raised if the cookie is corrupt
INACTIVE_SESSION_EXCEPTION - raised when a session cannot be restored because it is marked inactive
UNSYNCED_SESSION_EXCEPTION - raised when a session cannot be restored because the cookie value does not match the value stored in the session repository
Since:
Oracle Portal 3.0.9.8.2

get_user

function get_user
return varchar2
Returns the user name of the current Oracle Portal user. This function returns the name of the user that is currently logged into the system. This user may not represent a database user, but should be used to perform actions such as logging, authorizations, etc.

Note: When a user is not authenticated, the get_user function returns the user name that was identified when creating the session. For an unauthenticated, but identified user, this is the actual lightweight name of the user. If the user has not been identified, this function returns 'PUBLIC'.

Example:

 begin
     if wwctx_api.get_user = wwctx_api.get_product_schema then
         return TRUE;
     else
         return FALSE;
     end if;
 end;
 
Returns:
the name of the user that is logged into the system.
Exceptions:
NO_SESSION_EXCEPTION - raised when a session cannot be restored because the session data is not found
INVALID_COOKIE_EXCEPTION - raised when a session cannot be restored because the the session cookie is corrupt
INACTIVE_SESSION_EXCEPTION - raised when a session cannot be restored because it is marked inactive
UNSYNCED_SESSION_EXCEPTION - raised when a session cannot be restored because the cookie value does not match the value stored in the session repository
Since:
Oracle Portal 3.0.6.6.5

get_user_id

function get_user_id
return number
Returns the user ID of the user currently logged in. This function is like wwctx_api.get_user but returns the Portal's local identifier (id) for the user rather than the user name.

The local identifier for the user is required for certain API calls that require a number parameter instead of the user name.

Example:

 declare
     l_id number;
 begin
     l_id := wwctx_api.get_user_id;
     ...
 end;
 
Purity:
WNDS
Exceptions:
NO_SESSION_EXCEPTION - raised when a session cannot be restored because the session data is not found
INVALID_COOKIE_EXCEPTION - raised when a session cannot be restored because the the session cookie is corrupt
INACTIVE_SESSION_EXCEPTION - raised when a session cannot be restored because it is marked inactive
UNSYNCED_SESSION_EXCEPTION - raised when a session cannot be restored because the cookie value does not match the value stored in the session repository
Since:
Oracle Portal 3.0.6.6.5

get_x_oracle_cache_auth

function get_x_oracle_cache_auth
return varchar2
Get the value of the HTTP_X_ORACLE_CACHE_AUTH CGI variable.

This API obtains the value of the HTTP_X_ORACLE_CACHE_AUTH CGI environment variable. This value represents the user's authentication level.

This API calls OWA_UTIL to get the referenced environment variable and caches the result in package global variables so that subsequent calls don't need to invoke OWA_UTIL again.

Example:

     declare
         l_x_oracle_cache_auth varchar2(30);
     begin
         l_x_oracle_cache_auth := wwctx_api.get_x_oracle_cache_auth;
     end;
 
Returns:
the value of the HTTP_X_ORACLE_CACHE_AUTH CGI variable
Since:
Oracle Portal 10.1.2.5

get_x_oracle_cache_device

function get_x_oracle_cache_device
return varchar2
Get the value of the HTTP_X_ORACLE_CACHE_DEVICE CGI variable.

This API obtains the value of the HTTP_X_ORACLE_CACHE_DEVICE CGI environment variable. This value represents the client device

This API calls OWA_UTIL to get the referenced environment variable and caches the result in package global variables so that subsequent calls don't need to invoke OWA_UTIL again.

Example:

     declare
         l_x_oracle_cache_device varchar2(30);
     begin
         l_x_oracle_cache_device := wwctx_api.get_x_oracle_cache_device;
     end;
 
Returns:
the value of the HTTP_X_ORACLE_CACHE_DEVICE CGI variable
Since:
Oracle Portal 10.1.2.5

get_x_oracle_cache_encrypt

function get_x_oracle_cache_encrypt
return varchar2
Get the value of the HTTP_X_ORACLE_CACHE_ENCRYPT CGI variable.

This API obtains the value of the HTTP_X_ORACLE_CACHE_ENCRYPT CGI environment variable. This value represents the encrypted user name etc. which is used as the secure cache key.

This API calls OWA_UTIL to get the referenced environment variable and caches the result in package global variables so that subsequent calls don't need to invoke OWA_UTIL again.

Example:

     declare
         l_x_oracle_cache_encrypt varchar2(30);
     begin
         l_x_oracle_cache_encrypt := wwctx_api.get_x_oracle_cache_encrypt;
     end;
 
Returns:
the value of the HTTP_X_ORACLE_CACHE_ENCRYPT CGI variable
Since:
Oracle Portal 10.1.2.5

get_x_oracle_cache_lang

function get_x_oracle_cache_lang
return varchar2
Get the value of the HTTP_X_ORACLE_CACHE_LANG CGI variable.

This API obtains the value of the HTTP_X_ORACLE_CACHE_LANG CGI environment variable. This value represents the session language

This API calls OWA_UTIL to get the referenced environment variable and caches the result in package global variables so that subsequent calls don't need to invoke OWA_UTIL again.

Example:

     declare
         l_x_oracle_cache_lang varchar2(30);
     begin
         l_x_oracle_cache_lang := wwctx_api.get_x_oracle_cache_lang;
     end;
 
Returns:
the value of the HTTP_X_ORACLE_CACHE_LANG CGI variable
Since:
Oracle Portal 10.1.2.5

get_x_oracle_cache_subid

function get_x_oracle_cache_subid
return varchar2
Get the value of the HTTP_X_ORACLE_CACHE_SUBID CGI variable.

This API obtains the value of the HTTP_X_ORACLE_CACHE_SUBID CGI environment variable. This value represents the subscriber id.

This API calls OWA_UTIL to get the referenced environment variable and caches the result in package global variables so that subsequent calls don't need to invoke OWA_UTIL again.

Example:

     declare
         l_x_oracle_cache_subid varchar2(30);
     begin
         l_x_oracle_cache_subid := wwctx_api.get_x_oracle_cache_subid;
     end;
 
Returns:
the value of the HTTP_X_ORACLE_CACHE_SUBID CGI variable
Since:
Oracle Portal 10.1.2.5

get_x_oracle_cache_user

function get_x_oracle_cache_user
return varchar2
Get the value of the HTTP_X_ORACLE_CACHE_USER CGI variable.

This API obtains the value of the HTTP_X_ORACLE_CACHE_USER CGI environment variable. This value represents the user name.

This API calls OWA_UTIL to get the referenced environment variable and caches the result in package global variables so that subsequent calls don't need to invoke OWA_UTIL again.

Example:

     declare
         l_x_oracle_cache_user varchar2(30);
     begin
         l_x_oracle_cache_user := wwctx_api.get_x_oracle_cache_user;
     end;
 
Returns:
the value of the HTTP_X_ORACLE_CACHE_USER CGI variable
Since:
Oracle Portal 10.1.2.5

has_idle_timeout_exceeded

function has_idle_timeout_exceeded
return boolean
Check if idle timeout has occurred.

It indicates whether or not global inactivity timeout has occurred. This is determined based on the value of the CGI environment variable Osso-Idle-Timeout-Exceeded.

Example:

     l_timedout := wwctx_api.has_idle_timeout_exceeded;
 
Returns:
TRUE: timeout occurred, FALSE: timeout did not occur
Purity:
WNDS
Since:
Oracle AS Portal 9.0.4.1

is_context_set

function is_context_set
return boolean
Check whether a session context is set.

This function checks whether a session context is set for the current session. This can be used to check whether a session context has been set with set_context before attempting some things that require the session context to be set.

Since:
Oracle Portal 3.0.6.6.5

is_in_login_server

function is_in_login_server
return boolean
Check if the current request is executing in the SSO server.

This function indicates whether the current product schema is the SSO schema.

Example:

     if wwctx_api.is_in_login_server then
         --
     end if;
 
Returns:
TRUE if executing from the Login Server, FALSE otherwise
Purity:
WNDS
Since:
Oracle Portal 3.0.9.8.2

is_logged_on

function is_logged_on
return boolean
Returns a boolean indicator showing if the user is logged on.

This function indicates whether the user in the current session, is logged on, or is just accessing the portal through an unauthenticated PUBLIC account. This function returns FALSE for an unauthenticated but identified user.

Note:This function is similar to the logged_on function. The logged_on function returns a number instead of a boolean value, so the returned value can be used as a condition for creating a view.

Example:

     if wwctx_api.is_logged_on then
         --
     end if;
 
Returns:
TRUE if user is logged on, FALSE otherwise
Purity:
WNDS
Exceptions:
NO_SESSION_EXCEPTION - raised when a session cannot be restored because the session data is not found
INVALID_COOKIE_EXCEPTION - raised when a session cannot be restored because the the session cookie is corrupt
INACTIVE_SESSION_EXCEPTION - raised when a session cannot be restored because it is marked inactive
UNSYNCED_SESSION_EXCEPTION - raised when a session cannot be restored because the cookie value does not match the value stored in the session repository
Since:
Oracle Portal 3.0.6.6.5
See Also:
wwctx_api.logged_on

is_proxy_required

function is_proxy_required(
    p_url in varchar2
) return boolean
Check if a proxy is required to contact the specified URL.

This function indicates whether or not the specified url requires a proxy. It returns FALSE if no proxies have been added in the Portal. It also returns FALSE if proxies have been added but the host name contained in the specified url is also included in the "no proxy" list. This function returns TRUE if proxies exist and the host name is not in the "no proxy" list. A proxy server is required and passed to utl_http.request in this case.

Example:

     v_required := wwctx_api.is_proxy_required
     (
         p_url => 'http://portal.us.oracle.com:3000/pls/portal30'
     );
 
Returns:
TRUE if required, FALSE if not required
Since:
Oracle Portal 3.0.9.8.2

is_session_authenticated

function is_session_authenticated(
    p_sessionid in number
) return boolean
Check if the session id represents an authenticated session.

This function indicates whether or not the specified session is a current valid authenticated session. It returns FALSE for an unauthenticated session, whether the user is identified or not.

Example:

     v_valid := wwctx_api.is_session_authenticated
     (
         p_sessionid => 5339237590
     );
 
Returns:
TRUE if valid, FALSE if not valid
Purity:
WNDS
Since:
Oracle Portal 3.0.6.6.5

logged_on

function logged_on
return number
Indicates whether the user is logged in, and returns a number instead of a Boolean value so the value returned can be used as a condition for creating a view.

Example:

     select ...
     where  wwctx_api.logged_on = 1;
 
Returns:
1 if user is logged on, 0 otherwise
Purity:
WNDS
Exceptions:
NO_SESSION_EXCEPTION - raised when a session cannot be restored because the session data is not found
INVALID_COOKIE_EXCEPTION - raised when a session cannot be restored because the the session cookie is corrupt
INACTIVE_SESSION_EXCEPTION - raised when a session cannot be restored because it is marked inactive
UNSYNCED_SESSION_EXCEPTION - raised when a session cannot be restored because the cookie value does not match the value stored in the session repository
Since:
Oracle Portal 3.0.6.6.5
See Also:
wwctx_api.is_logged_on

set_context

procedure set_context(
    p_user_name in varchar2,
    p_password in varchar2 default null,
    p_company in varchar2 default null
) 
Set the session context for a lightweight user.

This procedure can be used to set the session context for a lightweight user for use in a context that is not in a web session through modplsql.

When making Portal API calls, some operations do authorization checks. In order for these checks to be done properly, the user needs to be authenticated. The standard method of authentication, which is through the login server, is not possible from a SQL*Plus session, or from a non-partner PLSQL application that doesn't have access to the Portal session in the Portal schema.

To address these cases, this API is provided. It allows an application to assert an identity, by providing a username and password, which the Portal will verify with the login server before establishing a session for the asserted user.

If the assertion fails, due to a bad password, for example, an exception will be raised.

Example:

     wwctx_api.set_context
         p_user_name => 'PORTAL30'
        ,p_password  => 'secretpassword'
        ,p_company   => 'Oracle'
     );
 
Parameters:
p_user_name - IN name of the user to be asserted
p_password - IN password of the user
Exceptions:
AUTHENTICATION_EXCEPTION - when the authentication fails
UNAUTHORIZED_ACCESS_EXCEPTION - raised when a session context is being set for an unauthorized user.
Since:
Oracle Portal 3.0.6.6.5
See Also:
wwctx_api.clear_context

set_nls_language

procedure set_nls_language(
    p_nls_language in varchar2 default null,
    p_nls_territory in varchar2 default null
) 
Set the NLS language and territory of the current SQL*Plus created portal session.

Note: This API can only be used for portal sessions that have been created via SQL*Plus. It is not intended to be used in browser sessions for setting the NLS language and territory. The Set Language portlet should be used in that case.

Example:

 begin

     wwctx_api.set_nls_language(
         p_nls_language => wwnls_api.GREEK,
         p_nls_territory => wwnls_api.TER_GREECE
     );

 exception
     when wwnls_api.NLS_VALIDATION_EXCEPTION then
         dbms_output.put_line('Error: an invalid language or territory '
              || 'value was passed in');
     when wwctx_api.INVALID_SESSION_TYPE_EXCEPTION then
         dbms_output.put_line('Error: this API is only allowed for '
              || 'SQL*Plus sessions');
 end;
 
Parameters:
p_nls_language - the NLS language abbreviation of the language to set. Valid values are listed in the constant group NLS language constants. If this parameter is null then the portal default NLS language is used.
p_nls_territory - the NLS territory abbreviation of the territory to set. Valid values are listed in the constant group NLS territory constants. If this parameter is null then the default territory for the given NLS language is used.
Exceptions:
INVALID_SESSION_TYPE_EXCEPTION - raised when this API is called from a non SQL*Plus portal session.
wwnls_api.NLS_VALIDATION_EXCEPTION - raised if the language or territory code passed is not valid
Since:
Oracle Portal 9.0.2.6

validate_system_var_name

procedure validate_system_var_name(
    p_system_var_name in system_var_name_type
) 
Validate the given system variable name.

If the given name isn't valid, an exception will be raised.

Parameters:
p_system_var_name - IN the system variable name. Valid names include the SYSTEM_VAR_* constants defined above, as well as any name in the set returned by get_system_var_names. Note that case does does not matter though.
Exceptions:
SYSTEM_VAR_NAME_EXCEPTION - raised when the given system variable name isn't recognized.
Since:
Oracle Portal 9.0.2

Oracle Application Server Portal PL/SQL API Reference - 10.1.4