Oracle Application Server Portal PL/SQL API Reference - 904

Package wwpre_api_value

This package contains procedures and functions to set, get, and delete preference values.

The procedures and functions are used to store and retrieve the following items:

Preference storage settings are unique to each portlet instance, based on a hierarchical name space and persistence. Different procedures and functions provide access to preference values according to the implementation type: varchar2, date, number, or string.

Preference values associated with preference names are stored in native form. That is, the attribute might have been defined to use the logical type COLOR, which has a native implementation type of varchar2. So the value for this attribute is stored as type COLOR in varchar2.

For a given preference name, values can be set (and scoped) at different levels: user, group, or system-wide. For a user-level or a group-level setting, a valid user name, user ID, group name, or group ID must be specified. For example:

 wwpre_api_value.set_value_as_string
 (
   'ORACLE.TOOLS.PORTAL.STYLE',          -- preference path
   'BGCOLOR',                            -- preference name
   wwpre_api_value.USER_LEVEL_TYPE,      -- level name
   wwctx_api.get_user,                   -- level type constant
   wwnls_api.AMERICAN,       -- language constant used to load the type
   '#FFCCFF'                 -- the actual value to be stored
 );
 

Scope:
Public
Since:
Oracle Portal 3.0.6.6.5


Exception Summary
GENERAL_PREFERENCE_EXCEPTION
An undefined exception has occurred.

Constant Summary
GROUP_LEVEL_TYPE
Indicates that the preference value is set at the group-level.
 varchar2(4)
INHERIT_LEVEL_TYPE
Indicates that the preference level is inherited.
 varchar2(4)
SYSTEM_LEVEL_ID
Indicates the level ID to be used if the level type is system-level.
 integer
SYSTEM_LEVEL_TYPE
Indicates that the preference value is set at the system-level.
 varchar2(4)
USER_LEVEL_TYPE
Indicates that the preference value is set at the user-level.
 varchar2(4)

Function/Procedure Summary
delete_value
Deletes the value of a preference based on its level name.
 
delete_value_by_id
Deletes the value of a preference based on its level ID.
 
get_value_as_date
Returns the preference value as a date using a level name.
 date
get_value_as_date_by_id
Returns the preference value as a date using a level ID.
 date
get_value_as_number
Returns the preference value as a number using a level name.
 number
get_value_as_number_by_id
Returns the preference value as a number using a level ID.
 number
get_value_as_string
Returns the preference value as a string using a level name.
 varchar2
get_value_as_string_by_id
Returns the preference value as a string using a level ID.
 varchar2
get_value_as_varchar2
Returns a preference value as varchar2 using a level name.
 varchar2
get_value_as_varchar2_by_id
Returns a preference value as varchar2 using a level ID.
 varchar2
set_value_as_date
Sets a date value for a preference using a level name.
 
set_value_as_date_by_id
Sets a date value for a preference using a level ID.
 
set_value_as_number
Sets a number value for a preference using a level name.
 
set_value_as_number_by_id
Sets a number value for a preference using a level ID.
 
set_value_as_string
Sets a string value for a preference using a level name.
 
set_value_as_string_by_id
Sets a string value for a preference using a level ID.
 
set_value_as_varchar2
Sets a varchar2 value for a preference using a level name.
 
set_value_as_varchar2_by_id
Sets a varchar2 value for a preference using a level ID.
 

Exception Detail

GENERAL_PREFERENCE_EXCEPTION

GENERAL_PREFERENCE_EXCEPTION exception
An undefined exception has occurred.

Constant Detail

GROUP_LEVEL_TYPE

GROUP_LEVEL_TYPE constant varchar2(4) := 'G'
Indicates that the preference value is set at the group-level.

INHERIT_LEVEL_TYPE

INHERIT_LEVEL_TYPE constant varchar2(4) := 'I'
Indicates that the preference level is inherited.

SYSTEM_LEVEL_ID

SYSTEM_LEVEL_ID constant integer := 0
Indicates the level ID to be used if the level type is system-level.

SYSTEM_LEVEL_TYPE

SYSTEM_LEVEL_TYPE constant varchar2(4) := 'S'
Indicates that the preference value is set at the system-level.

USER_LEVEL_TYPE

USER_LEVEL_TYPE constant varchar2(4) := 'U'
Indicates that the preference value is set at the user-level.

Function/Procedure Detail

delete_value

procedure delete_value(
    p_path in varchar2,
    p_name in varchar2,
    p_level_type in varchar2,
    p_level_name in varchar2
) 
Deletes the value of a preference based on its level name.

Example:

   wwpre_api_value.delete_value
   (
      p_path       => 'ORACLE.TOOLS.PORTAL.STYLE',
      p_name       => 'BGCOLOR',
      p_level_type => wwpre_api_value.USER_LEVEL_TYPE,
      p_level_name => wwctx_api.get_user
   );
 
Parameters:
p_path - the path for the preference name
p_name - the preference name
p_level_type - the level at which the value needs to be deleted.
p_level_name - The user name or group name of the value to be deleted. Note that if the level type is SYSTEM, then level name must be NULL.
Exceptions:
GENERAL_PREFERENCE_EXCEPTION - if the value has not been deleted
Since:
Oracle Portal 3.0.6.6.5

delete_value_by_id

procedure delete_value_by_id(
    p_path in varchar2,
    p_name in varchar2,
    p_level_type in varchar2,
    p_level_id in integer
) 
Deletes the value of a preference based on its level ID.

Example:

   wwpre_api_value.delete_value_by_id
   (
      p_path       => 'ORACLE.TOOLS.PORTAL.STYLE',
      p_name       => 'BGCOLOR',
      p_level_type => wwpre_api_value.USER_LEVEL_TYPE,
      p_level_id   => wwctx_api.get_user_id
   );
 
Parameters:
p_path - the path for the preference name
p_name - the preference name
p_level_type - the level at which the value needs to be deleted
p_level_id - the user ID or group ID for the value to be deleted. If not specified, this procedure searches for a valid value based on path, name, and level type. For user-level or group-level type, the level ID must be specified. For the system level type, the level ID is wwpre_api_value.SYSTEM_LEVEL_ID.
Exceptions:
GENERAL_PREFERENCE_EXCEPTION - if the value has not been deleted
Since:
Oracle Portal 3.0.6.6.5

get_value_as_date

function get_value_as_date(
    p_path in varchar2,
    p_name in varchar2,
    p_level_type in varchar2 default inherit_level_type,
    p_level_name in varchar2 default null
) return date
Returns the preference value as a date using a level name.

If a value is not specified for p_level_type, this function attempts to inherit the value, moving to each step if a value is not found:

  1. Get the value for the user currently logged in.
  2. Get the default group value for the user currently logged in.
  3. Get the value for the system level type.
  4. Return null if no value is found.

Example:

     l_modified_date := wwpre_api_value.get_value_as_date
     (
         p_path       => 'company.portal.portlet.'||l_portlet_id',
         p_name       => 'modified_date',
         p_level_type => wwpre_api_value.USER_LEVEL_TYPE,
         p_level_name => wwctx_api.get_user
     );
 
Parameters:
p_path - the path for the preference name
p_name - the preference name
p_level_type - the level at which the value is retrieved.
p_level_name - the user name or group name for which the value will be retrieved. If not specified, this function searches for a valid value based on path, name, and level type. For user-level or group-level type, the level name or level ID must be specified.
Returns:
the date value of a specified preference. It returns null if there is no value or if the preference name is not found.
Since:
Oracle Portal 3.0.6.6.5

get_value_as_date_by_id

function get_value_as_date_by_id(
    p_path in varchar2,
    p_name in varchar2,
    p_level_type in varchar2 default inherit_level_type,
    p_level_id in integer default null
) return date
Returns the preference value as a date using a level ID.

If a value is not specified for p_level_type, this function attempts to inherit the value, moving to each step if a value is not found:

  1. Get the value for the user currently logged in.
  2. Get the default group value for the user currently logged in.
  3. Get the value for the system level type.
  4. Return null if no value is found.

Example:

     l_modified_date := wwpre_api_value.get_value_as_date_by_id
     (
         p_path        => 'company.portal.portlet.'||l_portlet_id',
         p_name        => 'modified_date',
         p_level_type  => wwpre_api_value.USER_LEVEL_TYPE,
         p_level_id    => wwctx_api.get_user_id
     );
 
Parameters:
p_path - the path for the preference name
p_name - the preference name
p_level_type - the level at which the value is retrieved
p_level_id - the user ID or group ID for which the value is to be retrieved. If not specified, this function searches for a valid value based on path, name, and level type. For user-level or group-level type, the level ID must be specified. For the system level type, the level ID is wwpre_api_value.SYSTEM_LEVEL_ID.
Returns:
the date value of a specified preference. It returns null if there is no value or if the preference name is not found.
Since:
Oracle Portal 3.0.6.6.5

get_value_as_number

function get_value_as_number(
    p_path in varchar2,
    p_name in varchar2,
    p_level_type in varchar2 default inherit_level_type,
    p_level_name in varchar2 default null
) return number
Returns the preference value as a number using a level name.

If a value is not specified for p_level_type, this function attempts to inherit the value, moving to each step if a value is not found:

  1. Get the value for the user currently logged in.
  2. Get the default group value for the user currently logged in.
  3. Get the value for the system level type.
  4. Return null if no value is found.

Example:

     l_number_value := wwpre_api_value.get_value_as_number
     (
         p_path       => 'ORACLE.PORTAL.TEST.STYLE.DEFAULT',
         p_name       => 'FONT_SIZE',
         p_level_type => wwpre_api_value.GROUP_LEVEL_TYPE,
         p_level_name => 'TEST_GROUP'
     );
 
Parameters:
p_path - the path for the preference name
p_name - the preference name
p_level_type - the level at which the value is retrieved
p_level_name - the user name or group name for which the value will be retrieved. If not specified, this function searches for a valid value based on path, name, and level type. For user-level or group-level type, the level name or level ID must be specified.
Returns:
the number value of a specified preference. It returns null if there is no value, or if the preference name is not found.
Since:
Oracle Portal 3.0.6.6.5

get_value_as_number_by_id

function get_value_as_number_by_id(
    p_path in varchar2,
    p_name in varchar2,
    p_level_type in varchar2 default inherit_level_type,
    p_level_id in integer default null
) return number
Returns the preference value as a number using a level ID.

If a value is not specified for p_level_type, this function attempts to inherit the value, moving to each step if a value is not found:

  1. Get the value for the user currently logged in.
  2. Get the default group value for the user currently logged in.
  3. Get the value for the system level type.
  4. Return null if no value is found.

Example:

     l_number_value := wwpre_api_value.get_value_as_number_by_id
     (
         p_path       => 'ORACLE.TOOLS.PORTAL.STYLE',
         p_name       => 'BGCOLOR',
         p_level_type => wwpre_api_value.USER_LEVEL_TYPE,
         p_level_id   => wwctx_api.get_user_id
     );
 
Parameters:
p_path - the path for the preference name
p_name - the preference name
p_level_type - the level at which the value is retrieved
p_level_id - the user ID or group ID for which the value is to be retrieved. If not specified, this function searches for a valid value based on path, name, and level type. For user-level or group-level type, the level ID must be specified. For the system level type, the level ID is wwpre_api_value.SYSTEM_LEVEL_ID.
Returns:
the number value of a specified preference. It returns null if there is no value or if the preference name was not found.
Since:
Oracle Portal 3.0.6.6.5

get_value_as_string

function get_value_as_string(
    p_path in varchar2,
    p_name in varchar2,
    p_level_type in varchar2 default inherit_level_type,
    p_level_name in varchar2 default null,
    p_language in varchar2
) return varchar2
Returns the preference value as a string using a level name.

This function returns the value of the preference as a text string. It gets the text string by calling the preference's type handling object to convert the value from its native form into string form.

If a value is not specified for p_level_type, this function attempts to inherit the value, moving to each step if a value is not found:

  1. Get the value for the user currently logged in.
  2. Get the default group value for the user currently logged in.
  3. Get the value for the system level type.
  4. Return null if no value is found.

Example:

     l_varchar2_value := wwpre_api_value.get_value_as_string
     (
         p_path       => 'ORACLE.PORTAL.TEST.STYLE.DEFAULT',
         p_name       => 'FONT_COLOR',
         p_level_type => wwpre_api_value.USER_LEVEL_TYPE,
         p_level_name => 'TEST_GROUP',
         p_language   => wwctx_api.get_nls_language,
     );
 
Parameters:
p_path - the path for the preference name
p_name - the preference name
p_level_type - the level at which the value is retrieved
p_level_name - the user name or group name for which the value will be retrieved. If not specified, this function searches for a valid value based on path, name, and level type. For user-level or group-level type, the level name or level ID must be specified.
p_language - the language to load the type for the preference value
Returns:
the string value of a specified preference. It returns null if there is no value or if the preference name was not found.
Exceptions:
VALUE_ERROR - if the type specified for the value is invalid.
Since:
Oracle Portal 3.0.6.6.5

get_value_as_string_by_id

function get_value_as_string_by_id(
    p_path in varchar2,
    p_name in varchar2,
    p_level_type in varchar2 default inherit_level_type,
    p_level_id in integer default null,
    p_language in varchar2
) return varchar2
Returns the preference value as a string using a level ID.

This function returns the value of the preference as a text string. It gets the text string by calling the preference's type handling object to convert the value from its native form into string form.

If a value is not specified for p_level_type, this function attempts to inherit the value, moving to each step if a value is not found:

  1. Get the value for the user currently logged in.
  2. Get the default group value for the user currently logged in.
  3. Get the value for the system level type.
  4. Return null if no value is found.

Example:

     l_varchar2_value := wwpre_api_value.get_value_as_string_by_id
     (
         p_path       => 'ORACLE.PORTAL.TEST.STYLE.DEFAULT',
         p_name       => 'FONT_COLOR',
         p_level_type => wwpre_api_value.USER_LEVEL_TYPE,
         p_level_id   => wwctx_api.get_user_id,
         p_language   => wwctx_api.get_nls_language,
     );
 
Parameters:
p_path - the path for the preference name
p_name - the preference name
p_level_type - the level at which the value is retrieved
p_level_id - the user ID or group ID for which the value is to be retrieved. If not specified, this function searches for a valid value based on path, name, and level type. For user-level or group-level type, the level ID must be specified. For the system level type, the level ID is wwpre_api_value.SYSTEM_LEVEL_ID.
p_language - the language to load the type for the preference value
Returns:
the string value of a specified preference. It returns null if there is no value or if the preference name was not found
Exceptions:
VALUE_ERROR - if the type specified for the value is invalid.
Since:
Oracle Portal 3.0.6.6.5

get_value_as_varchar2

function get_value_as_varchar2(
    p_path in varchar2,
    p_name in varchar2,
    p_level_type in varchar2 default inherit_level_type,
    p_level_name in varchar2 default null
) return varchar2
Returns a preference value as varchar2 using a level name.

If a value is not specified for p_level_type, this function attempts to inherit the value, moving to each step if a value is not found:

  1. Get the value for the user currently logged in.
  2. Get the default group value for the user currently logged in.
  3. Get the value for the system level type.
  4. Return null if no value is found.

Example:

     l_varchar2_value := wwpre_api_value.get_value_as_varchar2
     (
         p_path       => 'ORACLE.PORTAL.TEST.STYLE.DEFAULT',
         p_name       => 'FONT_NAME',
         p_level_type => wwpre_api_value.GROUP_LEVEL_TYPE,
         p_level_name => 'TEST_GROUP'
     );
 
Parameters:
p_path - the path for the preference name
p_name - the preference name
p_level_type - the level at which the value is retrieved
p_level_name - the user name or group name for which the value will be retrieved. If not specified, this function searches for a valid value based on path, name, and level type. For user-level or group -level type, the level name or ID must be specified.
Returns:
This function returns the preference value as varchar2. It returns null if there is no value or if the preference name was not found.
Since:
Oracle Portal 3.0.6.6.5

get_value_as_varchar2_by_id

function get_value_as_varchar2_by_id(
    p_path in varchar2,
    p_name in varchar2,
    p_level_type in varchar2 default inherit_level_type,
    p_level_id in integer default null
) return varchar2
Returns a preference value as varchar2 using a level ID.

If a value is not specified for p_level_type, this function attempts to inherit the value, moving to each step if a value is not found:

  1. Get the value for the user currently logged in.
  2. Get the default group value for the user currently logged in.
  3. Get the value for the system level type.
  4. Return null if no value is found.

Example:

     l_varchar2_value := wwpre_api_value.get_value_as_varchar2_by_id
     (
         p_path     => 'ORACLE.TOOLS.PORTAL.STYLE',
         p_name     => 'BGCOLOR';
         level_type =>wwpre_api_value.USER_LEVEL_TYPE,
         level_id   => wwctx_api.get_user_id
     );
 
Parameters:
p_path - the path for the preference name
p_name - the preference name
p_level_type - the level at which the value is retrieved
p_level_id - the user ID or group ID for which the value is to be retrieved. If not specified, this function searches for a valid value based on path, name, and level type. For user-level or group-level type, the level ID must be specified. For the system level type, the level ID is wwpre_api_value.SYSTEM_LEVEL_ID.
Returns:
the varchar2 value of the p reference. It returns null if there is no value or if the preference name was not found.
Since:
Oracle Portal 3.0.6.6.5

set_value_as_date

procedure set_value_as_date(
    p_path in varchar2,
    p_name in varchar2,
    p_level_type in varchar2,
    p_level_name in varchar2,
    p_value in date,
    p_commit in boolean default false
) 
Sets a date value for a preference using a level name.

Example:
This example sets the default expiry date to 1st Jan 2002 at the user level.

     declare
         l_varchar2_value varchar2(4000) := null;
         l_number_value number := null;
     begin
         wwpre_api_value.set_value_as_date(
              p_path       => 'ORACLE.PORTAL.TEST.STYLE.DEFAULT',
              p_name       => 'EXPIRE_DATE',
              p_level_type => wwpre_api_value.USER_LEVEL_TYPE,
              p_level_name => 'JDOE',
              p_value      => to_date('01-JAN-2002')
         );
     exception
         when VALUE_ERROR then
         dbms_output.put_line(
              'Invalid date'
         );
     end;
 
Parameters:
p_path - the path for the preference name
p_name - the preference name
p_level_type - the level at which the value is stored
p_level_name - the user name or group name for the value to be stored. Note that if the level type is SYSTEM, then level name must be NULL.
p_value - the date value to be stored
p_commit - this parameter is now obsolete. It is left here only to ensure that when older code is used, it still compiles.
Exceptions:
VALUE_ERROR - if the value specified is not a date
GENERAL_PREFERENCE_EXCEPTION - if the value has not been stored
Since:
Oracle Portal 3.0.6.6.5

set_value_as_date_by_id

procedure set_value_as_date_by_id(
    p_path in varchar2,
    p_name in varchar2,
    p_level_type in varchar2,
    p_level_id in integer,
    p_value in date,
    p_commit in boolean default false
) 
Sets a date value for a preference using a level ID.

Example:
This example sets the default expiry date to 1st Jan 2002 at the user level.

    declare
        l_varchar2_value varchar2(4000) := null;
        l_number_value number := null;
    begin
        wwpre_api_value.set_value_as_date_by_id(
            p_path       => 'ORACLE.PORTAL.TEST.STYLE.DEFAULT',
            p_name       => 'EXPIRE_DATE',
            p_level_type => wwpre_api_value.USER_LEVEL_TYPE,
            p_level_id   => wwctx_api.get_user_id,
            p_value      => to_date('01-JAN-2002')
        );
    exception
        when VALUE_ERROR then
        dbms_output.put_line(
            'Invalid date'
        );
    end;
 
Parameters:
p_path - the path for the preference name
p_name - the preference name
p_level_type - the level at which the value is retrieved
p_level_id - the user ID or group ID for which the value is to be set. If not specified, this procedure searches for a valid value based on path, name, and level type. For user-level or group-level type, the level ID must be specified. For the system level type, the level ID is wwpre_api_value.SYSTEM_LEVEL_ID.
p_value - the date value to be stored
p_commit - this parameter is now obsolete. It is left here only to ensure that when older code is used, it still compiles.
Exceptions:
VALUE_ERROR - if the value specified is not a date
GENERAL_PREFERENCE_EXCEPTION - if the value has not been stored
Since:
Oracle Portal 3.0.6.6.5

set_value_as_number

procedure set_value_as_number(
    p_path in varchar2,
    p_name in varchar2,
    p_level_type in varchar2,
    p_level_name in varchar2,
    p_value in number,
    p_commit in boolean default false
) 
Sets a number value for a preference using a level name.

Example:
This example sets the font size to 10 at the system level.

     wwpre_api_value.set_value_as_number
     (
         p_path       => 'ORACLE.PORTAL.TEST.STYLE.DEFAULT',
         p_name       => 'FONT_SIZE',
         p_level_type => wwpre_api_value.SYSTEM_LEVEL_TYPE,
         p_level_name => null,
         p_value      => 10
     );
     exception
         when VALUE_ERROR then
         dbms_output.put_line
         (
              'Trying to set invalid value'
         );
     end;
 
Parameters:
p_path - the path for the preference name
p_name - the preference name
p_level_type - the level at which the value is stored
p_level_name - the user name or group name for the value to be stored. Note that if the level type is SYSTEM, then level name must be NULL.
p_value - the number value to be stored
p_commit - this parameter is now obsolete. It is left here only to ensure that when older code is used, it still compiles.
Exceptions:
VALUE_ERROR - if the value specified is not a number
GENERAL_PREFERENCE_EXCEPTION - if the value has not been stored
Since:
Oracle Portal 3.0.6.6.5

set_value_as_number_by_id

procedure set_value_as_number_by_id(
    p_path in varchar2,
    p_name in varchar2,
    p_level_type in varchar2,
    p_level_id in integer,
    p_value in number,
    p_commit in boolean default false
) 
Sets a number value for a preference using a level ID.

Example:
This example sets the default font size to 3, at the system level.

   declare
      l_varchar2_value varchar2(4000) := null;
      l_number_value number := null;
   begin
      wwpre_api_value.set_value_as_number_by_id
      (
        p_path       => 'ORACLE.PORTAL.TEST.STYLE.DEFAULT',
        p_name       => 'FONT_SIZE',
        p_level_type => wwpre_api_value.SYSTEM_LEVEL_TYPE,
        p_level_id   => wwpre_api_value.SYSTEM_LEVEL_ID,
        p_value      => 3
      );
      exception
        when VALUE_ERROR then
        dbms_output.put_line
        (
             'Trying to set invalid value'
         );
   end;
 
Parameters:
p_path - the path for the preference name
p_name - the preference name
p_level_type - the level at which the value is retrieved.
p_level_id - the user ID or group ID for which the value is to be set. If not specified, this procedure searches for a valid value based on path, name, and level type. For user-level or group-level type, the level ID must be specified. For the system level type, the level ID is wwpre_api_value.SYSTEM_LEVEL_ID.
p_value - the number value to be stored
p_commit - this parameter is now obsolete. It is left here only to ensure that when older code is used, it still compiles.
Exceptions:
VALUE_ERROR - if the value specified is not a number
GENERAL_PREFERENCE_EXCEPTION - if the value has not been stored
Since:
Oracle Portal 3.0.6.6.5

set_value_as_string

procedure set_value_as_string(
    p_path in varchar2,
    p_name in varchar2,
    p_level_type in varchar2,
    p_level_name in varchar2,
    p_value in varchar2,
    p_language in varchar2,
    p_commit in boolean default false
) 
Sets a string value for a preference using a level name. This function stores the value of the preference as a text string. The text string is transformed into the native form, and the native form is stored.

Example:
This example sets the default font color for the current user to #FF0000.

    wwpre_api_value.set_value_as_string
    (
        p_path       => 'ORACLE.PORTAL.TEST.STYLE.DEFAULT',
        p_name       => 'FONT_COLOR',
        p_level_type => wwpre_api_value.USER_LEVEL_TYPE,
        p_level_name => wwctx_api.get_user,
        p_value      => '#FF0000',
        p_language   => wwctx_api.get_nls_language
    );
    exception
         when VALUE_ERROR then
         dbms_output.put_line
         (
              'Invalid value for font_color at user level'
         );
     end;
 
Parameters:
p_path - the path for the preference name
p_name - the preference name
p_level_type - the level at which the value is stored
p_level_name - the user name or group name for the value to be stored. Note that if the level type is SYSTEM, then level name must be NULL.
p_value - the string value to be stored
p_language - The language to load the type for the preference value
p_commit - this parameter is now obsolete It is left here only to ensure that when older code is used, it still compiles.
Exceptions:
VALUE_ERROR - if the string value does not conform to its type
GENERAL_PREFERENCE_EXCEPTION - if the value has not been stored
Since:
Oracle Portal 3.0.6.6.5

set_value_as_string_by_id

procedure set_value_as_string_by_id(
    p_path in varchar2,
    p_name in varchar2,
    p_level_type in varchar2,
    p_level_id in integer,
    p_value in varchar2,
    p_language in varchar2,
    p_commit in boolean default false
) 
Sets a string value for a preference using a level ID. This function stores the value of the preference as a text string. The text string is transformed into the native form, and the native form is stored.

Example:
This example sets the page color to #FF0000 for user SCOTT, at the user level.

   wwpre_api_value.set_value_as_string_by_id
    (
      p_path       => 'ORACLE.PORTAL.TEST.STYLE',
      p_name       => 'PAGECOLOR',
      p_level_type => wwpre_api_value.USER_LEVEL_TYPE,
      p_level_id   => wwctx_api.id('SCOTT'),
      p_value      => '#FF0000',
      p_language   => wwctx_api.get_nls_language
    );
 
Parameters:
p_path - the path for the preference name
p_name - the preference name
p_level_type - the level at which the value is retrieved
p_level_id - the user ID or group ID for which the value is to be set. If not specified, this procedure searches for a valid value based on path, name, and level type. For user-level or group-level type, the level ID must be specified. For the system level type, the level ID is wwpre_api_value.SYSTEM_LEVEL_ID.
p_value - the string value to be stored
p_language - the language to load the type for the preference value
p_commit - this parameter is now obsolete. It is left here only to ensure that when older code is used, it still compiles.
Exceptions:
VALUE_ERROR - if the string value does not conform to its type
GENERAL_PREFERENCE_EXCEPTION - if the value has not been stored
Since:
Oracle Portal 3.0.6.6.5

set_value_as_varchar2

procedure set_value_as_varchar2(
    p_path in varchar2,
    p_name in varchar2,
    p_level_type in varchar2,
    p_level_name in varchar2,
    p_value in varchar2,
    p_commit in boolean default false
) 
Sets a varchar2 value for a preference using a level name.

Example:
This example sets 'Tahoma' as the value for the font_name parameter at the user level.

     begin
     wwpre_api_value.set_value_as_varchar2
     (
         p_path       => 'ORACLE.PORTAL.TEST.STYLE.DEFAULT',
         p_name       => 'FONT_NAME',
         p_level_type => wwpre_api_value.USER_LEVEL_TYPE,
         p_level_name => wwctx_api.get_user,
         p_value      => 'Tahoma'
     );

     exception
         when VALUE_ERROR then
             dbms_output.put_line
             (
                 'Invalid value for font_name at user level'
             );
     end;
 
Parameters:
p_path - the path for the preference name
p_name - the preference name
p_level_type - the level at which the value is stored
p_level_name - the user name or group name for the value to be stored. Note that if the level type is SYSTEM, then level name must be NULL.
p_value - the varchar2 value to be stored
p_commit - this parameter is now obsolete. It is left here only to ensure that when older code is used, it still compiles.
Exceptions:
VALUE_ERROR - if the value specified is not varchar2
GENERAL_PREFERENCE_EXCEPTION - if the value has not been stored
Since:
Oracle Portal 3.0.6.6.5

set_value_as_varchar2_by_id

procedure set_value_as_varchar2_by_id(
    p_path in varchar2,
    p_name in varchar2,
    p_level_type in varchar2,
    p_level_id in integer,
    p_value in varchar2,
    p_commit in boolean default false
) 
Sets a varchar2 value for a preference using a level ID.

Example:
This example sets the default Font_Name to 'Tahoma' at the user level.

    declare
        l_varchar2_value varchar2(4000) := null;
        l_number_value number := null;
    begin
        wwpre_api_value.set_value_as_varchar2_by_id
        (
            p_path       => 'ORACLE.PORTAL.TEST.STYLE.DEFAULT',
            p_name       => 'FONT_NAME',
            p_level_type => wwpre_api_value.USER_LEVEL_TYPE,
            p_level_id   => wwctx_api.get_user_id,
            p_value      => 'Tahoma'
        );
    exception
        when VALUE_ERROR then
        dbms_output.put_line
        (
            'Invalid value for font_name at user level'
        );
    end;
 
Parameters:
p_path - the path for the preference name
p_name - the preference name
p_level_type - the level at which the value is retrieved
p_level_id - the user ID or group ID for which the value is to be set. If not specified, this procedure searches for a valid value based on path, name, and level type. For user-level or group-level type, the level ID must be specified. For the system level type, the level ID is wwpre_api_value.SYSTEM_LEVEL_ID.
p_value - the varchar2 value to be stored
p_commit - this parameter is now obsolete. It is left here only to ensure that when older code is used, it still compiles.
Exceptions:
VALUE_ERROR - if the value specified is not varchar2
GENERAL_PREFERENCE_EXCEPTION - if the value has not been stored
Since:
Oracle Portal 3.0.6.6.5

Oracle Application Server Portal PL/SQL API Reference - 904