Oracle Application Server Portal PL/SQL API Reference - 10.1.4

Package wwpre_api_util

This package contains a set of procedures and functions that can be used to resove preference paths, retrieve preference path IDs and retrieve the preference name record.

Scope:
Public
Since:
Oracle Portal 3.0.8


Type Summary
name_record
A record structure containing details of a preference name.
 subtype
names_table
A table of preference names.
 subtype
value_record
A record structure containing details of a preference value.
 subtype
values_table
A table of preference values.
 subtype

Constant Summary
PRE_PATH_DELIMITER
The delimiter used to separate path hierarchy in the preference path.
 varchar2(10)

Function/Procedure Summary
copy
Copies all the names and values for a given path.
 
get_name
Returns the preference name record.
 name_record
get_names_table
Returns the table of preference name records.
 names_table
get_path_id
Returns the preference path ID.
 integer
get_values_table
Returns the table of preference value records.
 values_table

Type Detail

name_record

subtype name_record is wwpre_utl.name_record
A record structure containing details of a preference name.
 type name_record is record (
     id             number,        --ID of preference name
     path_id        number,        --ID of path associated with preference name
     name           varchar2(255), --preference name
     description    long,          --description of preference name
     description_id number,        --NLS string ID for the description
     type_name      varchar2(200)  --type associated with this preference
 );
 
Since:
Oracle Portal 3.0.8

names_table

subtype names_table is wwpre_utl.names_table
A table of preference names.

value_record

subtype value_record is wwpre_utl.value_record
A record structure containing details of a preference value.
 type value_record is record (
     name_id         number,         --preference name ID of value record
     level_type      varchar2(4),    --USER_LEVEL_TYPE, GROUP_LEVEL_TYPE,
                                     --or SYSTEM_LEVEL_TYPE
     level_id        number,         --User ID or Group ID
     varchar2_value  varchar2(4000), --varchar2 value
     number_value    number,         --number value
     date_value      date            --date value
 );
 
Since:
Oracle Portal 3.0.8

values_table

subtype values_table is wwpre_utl.values_table
A table of preference values.

Constant Detail

PRE_PATH_DELIMITER

PRE_PATH_DELIMITER constant varchar2(10) := wwpre_utl . PRE_PATH_DELIMITER
The delimiter used to separate path hierarchy in the preference path.

Function/Procedure Detail

copy

procedure copy(
    p_source_path in varchar2,
    p_destination_path in varchar2 default null
) 
Copies all the names and values for a given path.

Note: For database providers, this function can be used by the provider's copy_portlet procedure to copy preferences related to a portlet. For example, when a page is copied the copy_portlet function is called. The provider can use this function to copy the preferences associated with the portlet.

Example:

    wwpre_api_util.copy
    (
      p_source_path => 'company.portal.portlet.'||l_source_portlet_id,
      p_destination_path => 'company.portal.portlet.'||l_destination_portlet_id
    );
 
Parameters:
p_source_path - the path name to be exported
p_destination_path - the new path name to be used when importing
Since:
Oracle Portal 3.0.8

get_name

function get_name(
    p_path in varchar2,
    p_name in varchar2
) return name_record
Returns the preference name record.

The function returns the record for the preference name based on the path.

Example:

    declare
       l_name_record wwpre_api_util.name_record;
    begin
       l_name_record := wwpre_api_util.get_name
       (
         p_path => 'ORACLE.TOOLS.PORTAL.STYLE',
         p_name => 'BGCOLOR'
       );
    end;
 
Parameters:
p_path - the path for the preference name
p_name - the preference name
Returns:
the preference name record
Exceptions:
NAME_NOT_FOUND_EXCEPTION - if the path is not found
DUPLICATE_NAME_EXCEPTION - if a duplicate path is found
Since:
Oracle Portal 3.0.8

get_names_table

function get_names_table(
    p_path in varchar2
) return names_table
Returns the table of preference name records.

This function returns the table of all the records for a given preference path.

Example:

    declare
       l_names_table wwpre_api_util.names_table;
    begin
       l_names_table := wwpre_api_util.get_names_table
       (
         p_path => 'ORACLE.TOOLS.PORTAL.STYLE'
       );
    end;
 
Parameters:
p_path - the path for the preference name
Returns:
the preference name table
Exceptions:
NAME_NOT_FOUND_EXCEPTION - if the name is not found
PATH_NOT_FOUND_EXCEPTION - if the path is not found
Since:
Oracle Portal 3.0.8

get_path_id

function get_path_id(
    p_path in varchar2
) return integer
Returns the preference path ID.

The ID corresponds to the last name in the preference path, e.g. if the preference path is 'Oracle.Tools.Portal.Style', then the ID for the name 'Style' is returned.

Example:

     l_path_id := wwpre_api_util.get_path_id
     (
          p_path => 'ORACLE.TOOLS.PORTAL.STYLE'
     );
 
Parameters:
p_path - the path for the preference name
Returns:
the ID of the preference path
Exceptions:
PATH_NOT_FOUND_EXCEPTION - if the path is not found
DUPLICATE_PATH_EXCEPTION - if a duplicate path is found
Since:
Oracle Portal 3.0.8

get_values_table

function get_values_table(
    p_name_id in number
) return values_table
Returns the table of preference value records.

This function returns a table of all the records for a given name ID.

Example:

    declare
       l_name_record wwpre_api_util.name_record;
       l_values_table wwpre_api_util.values_table;
    begin
       l_name_record := wwpre_api_util.get_name
       (
          p_path => 'ORACLE.TOOLS.PORTAL.STYLE',
          p_name => 'BGCOLOR'
       );
       l_values_table := wwpre_api_util.get_values_table
       (
          p_name_id => l_name_record.id
       );
    end;
 
Parameters:
p_name_id - the name ID
Returns:
the preference value table
Since:
Oracle Portal 3.0.8

Oracle Application Server Portal PL/SQL API Reference - 10.1.4