Overview | Package | Object Type | Deprecated | Index | Help
| Oracle Application Server Portal PL/SQL API Reference - 904
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES
SUMMARY: EXCEPTION | TYPE | CONSTANT | VARIABLE | FUNCTION/PROCEDURE | DETAIL: EXCEPTION | TYPE | CONSTANT | VARIABLE | FUNCTION/PROCEDURE

## Package wwpre_api_name

This package contains procedures and functions to create a naming system for storing user-specified application preferences. These preference values can be stored at different levels: user, group, and system-wide. They can also be of different data types for the same name.

The naming system consists of a preference path and a preference name. The preference path denotes hierarchy, for example: ORACLE.TOOLS.PORTAL.PAGE

To create preference paths and names, create the path first, then create names under the path. Once created, paths and names can be deleted but they cannot be modified. For example, if the path ORACLE.TOOLS.PORTAL.STYLE exists, and a call is made to create the path ORACLE.TOOLS.PORTAL.PAGE, only the name PAGE is created.

If you delete a name from a preference path, all values associated with the name and all subordinate names and values are deleted. Deleting a preference path deletes all names and values associated with the path. You can delete partial paths. The last name in a specified path is the name that is deleted. For example,

- If PORTAL is deleted from the path, all names and values associated with or subordinate to PORTAL and STYLE are deleted. The path becomes ORACLE.TOOLS.
- If ORACLE is deleted, the entire path and all names and values associated with this path are deleted.

Notes: Names in a preference path must be delimited by a period "." No preference path name may exceed 255 characters.

Scope:
  Public
Since:
  Oracle Portal 3.0.6.6.5

Exception Summary
`DUPLICATE_NAME_EXCEPTION` A duplicate preference name exists for the specified path.
`DUPLICATE_PATH_EXCEPTION` A duplicate preference path exists.
`GENERAL_PREFERENCE_EXCEPTION` An undefined exception has occurred.
`NAME_NOT_FOUND_EXCEPTION` The specified preference name is not found.
`PATH_NOT_FOUND_EXCEPTION` The specified preference path is not found.

Function/Procedure Summary
`create_name` Creates a preference name used to store preference values. | ``
`create_path` Creates a hierarchical naming system for the storage of preferences. | ``
`delete_name` Deletes a preference name. | ``
`delete_path` Deletes a preference path. | ``

Exception Detail

### DUPLICATE_NAME_EXCEPTION

    DUPLICATE_NAME_EXCEPTION exception

  A duplicate preference name exists for the specified path.

### DUPLICATE_PATH_EXCEPTION

    DUPLICATE_PATH_EXCEPTION exception

  A duplicate preference path exists.

### GENERAL_PREFERENCE_EXCEPTION

    GENERAL_PREFERENCE_EXCEPTION exception

  An undefined exception has occurred.

### NAME_NOT_FOUND_EXCEPTION

    NAME_NOT_FOUND_EXCEPTION exception

  The specified preference name is not found.

### PATH_NOT_FOUND_EXCEPTION

    PATH_NOT_FOUND_EXCEPTION exception

  The specified preference path is not found.

Function/Procedure Detail

### create_name

    procedure create_name(
        p_path in varchar2,
        p_name in varchar2,
        p_description in varchar2,
        p_type_name in varchar2,
        p_language in varchar2
    )

  Creates a preference name used to store preference values.

  Constraints:

  - The preference path under which this name is being created must exist.
  - The preference name must be unique for the preference path.
  - The names in the path must be delimited with a period ".".
  - The length of each name in a preference path may not exceed 255 characters.
  - The type associated with the preference should be one of the logical datatypes: NUMBER, INTEGER, CURRENCY, DATE and STRING.

  Note: If the path does not exist, create it with the wwpre_api_name.create_path procedure.

  Example:

          wwpre_api_name.create_name
          (
             p_path        => 'ORACLE.PORTAL.TEST.STYLE.DEFAULT',
             p_name        => 'FONT_SIZE',
             p_type_name   => 'NUMBER',
             p_description => 'Font Size for the Style',
             p_language    => wwctx_api.get_nls_language
           );

  Parameters:
    `p_path` - the preference path under which the name is created
    `p_name` - the preference name to be create
    `p_description` - a description or explanation of the preference name
    `p_type_name` - the name of the type associated with this preference
    `p_language` - the language in which the description should be stored
  Exceptions:
    `DUPLICATE_NAME_EXCEPTION` - if the name already exists
    `VALUE_ERROR` - if the type is not valid
    `GENERAL_PREFERENCE_EXCEPTION` - if the name is not created
  Since:
    Oracle Portal 3.0.6.6.5

### create_path

    procedure create_path(
        p_path in varchar2
    )

  Creates a hierarchical naming system for the storage of preferences.

  Call this procedure to create a new hierarchical path or to add a name to an existing hierarchical path. After creating or extending a path, call the create_name procedure to associate a preference name with the path.

  Notes:

  - The length of each name in a preference path may not exceed 255 characters.
  - The names in the path must be delimited with a period ".".

  Example:

          begin
             wwpre_api_name.create_path
             (
               p_path => 'ORACLE.PORTAL.TEST'
             );
          end;

  Parameters:
    `p_path` - the preference path to be created
  Exceptions:
    `DUPLICATE_PATH_EXCEPTION` - if a duplicate path exists
    `GENERAL_PREFERENCE_EXCEPTION` - if the path is not created
  Since:
    Oracle Portal 3.0.6.6.5

### delete_name

    procedure delete_name(
        p_path in varchar2,
        p_name in varchar2
    )

  Deletes a preference name.

  Call this procedure to delete a specified preference name under a given path.

  Note: This API deletes a name and all values associated with the name.

  Example:

          wwpre_api_name.delete_name
          (
                p_path => 'ORACLE.TOOLS.PORTAL.STYLE',
                p_name => 'BGCOLOR'
           );

  Parameters:
    `p_path` - the preference path of the name to be deleted
    `p_name` - the preference name to be deleted
  Exceptions:
    `PATH_NOT_FOUND_EXCEPTION` - if the path to be deleted is not found
    `NAME_NOT_FOUND_EXCEPTION` - if the name to be deleted is not found
    `GENERAL_PREFERENCE_EXCEPTION` - if the name is not deleted
  Since:
    Oracle Portal 3.0.6.6.5

### delete_path

    procedure delete_path(
        p_path in varchar2
    )

  Deletes a preference path.

  Call this procedure to delete a preference path. The delete_path procedure deletes the specified path, the specified name and all values associated with it, and all subordinate names and values. Note that the last name specified in p_path is deleted and that names in the path must be delimited with a period ".".

  For example:
  - If the path to be deleted is ORACLE.PORTAL.STYLE, and if the names associated with STYLE are BGCOLOR, BANNERCOLOR, and PAGE_IMAGE, and if each name has a number of values associated with it, then delete_path deletes BGCOLOR, BANNERCOLOR, and PAGE_IMAGE and all values associated with each name. Then it deletes STYLE from the path.
  - If the preference path to be deleted is ORACLE, delete_path removes the entire path.

  Example:

          wwpre_api_name.delete_path
          (
                p_path => 'ORACLE.TOOLS.PORTAL.STYLE'
           );

  Parameters:
    `p_path` - the preference path to be deleted
  Exceptions:
    `PATH_NOT_FOUND_EXCEPTION` - if the path to be deleted is not found
    `GENERAL_PREFERENCE_EXCEPTION` - if the path is not deleted
  Since:
    Oracle Portal 3.0.6.6.5

Overview | Package | Object Type | Deprecated | Index | Help
| Oracle Application Server Portal PL/SQL API Reference - 904
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES
SUMMARY: EXCEPTION | TYPE | CONSTANT | VARIABLE | FUNCTION/PROCEDURE | DETAIL: EXCEPTION | TYPE | CONSTANT | VARIABLE | FUNCTION/PROCEDURE