Oracle® HTML DB
Release 2.0
  Go To Table Of Contents
Contents

Previous
Previous
Next
Next
 

Managing User Preferences

You can use preferences to store values for a specific user across distinct sessions. Once set, these preferences can removed programatically or by an Oracle HTML DB administrator. You can set user preferences by creating a page process, by the calculation of a preference Item Source Value, or programatically using a PL/SQL API.

Topics:

Viewing User Preferences

You view user preferences for a specific user on the Session State Management page.

To view user preferences for a specific user:

  1. Navigate to the Workspace home page.

  2. Click the Administration icon.

  3. Click Manage Service.

  4. Click Session State.

  5. Click Report preferences for users.

  6. Type a username in the field provided and click Go.


See Also:

"Managing Session State and User Preferences" for information about using the Session State Management page

Setting User Preferences

You can set user preferences within your application through the creation of a page process, by creating a preference item, or programatically.

Topics:

Setting User Preferences Using a Page Process

To set user preference values by creating a page process:

  1. Navigate to the appropriate Page Definition:

    1. Navigate to the Workspace home page.

    2. Click the Application Builder icon.

    3. Select an application.

    4. Select a page.

      The Page Definition appears.

  2. Under Page Processes, click the Create icon.

    The Create Page Computation Wizard appears.

  3. Specify a process name, sequence, and processing point.

  4. From Type, select one of the following:

    • Set Preference to value of item

    • Set Preference to value of item if item is not NULL

  5. Specify the preference value in the field provided using the format:

    PreferenceName:Item
    
    
  6. Click Page Items to see a list of available items.

  7. Follow the on-screen instructions

Setting the Source of an Item Based on a User Preference

You can set the source of an item based on a user preference by defining the item source type as Preference.

To define the source of item based on a user preference:

  1. Navigate to the appropriate Page Definition:

    1. Navigate to the Workspace home page.

    2. Click the Application Builder icon.

    3. Select an application.

    4. Select a page.

      The Page Definition appears.

  2. Under Item, click the Create icon.

    The Create Page Computation Wizard appears.

  3. Specify the Item Name and Display Position Attributes and click Next.

  4. Specify the Item Attributes click Next.

  5. From the Item Source list, select Preferences.

  6. In Item Source Value, enter the name of the preference.

  7. Follow the on-screen instructions

Setting User Preferences Programatically

To set or reference user preferences programatically, you must use a PL/SQL API. User level caching is available programmatically. You can use the set_preference function to set a user level preference called NAMED_PREFERENCE. For example:

HTMLDB_UTIL.SET_PREFERENCE(
 p_preference=>'NAMED_PREFERENCE',
 p_value =>:ITEM_NAME);

You can reference the value of a user preference using the function GET_PREFERENCES. For example:

NVL(HTMLDB_UTIL.GET_PREFERENCE('NAMED_PREFERENCE'),15)

In the previous example, the preference would default to the value 15 if the preference contained no value.

Removing User Preferences Programatically

To remove user preferences programatically, you must use a PL/SQL API. You can use the REMOVE_PREFERENCE procedure to remove a user level preference called NAMED_PREFERENCE. For example:

HTMLDB_UTIL.REMOVE_PREFERENCE(
p_preference=>'NAMED_PREFERENCE',
p_value =>:ITEM_NAME);

Resetting User Preferences Manually

You can manually purge user preferences for a specific user.

To manually purge preferences for a specific user:

  1. Navigate to the Workspace home page.

  2. Click the Administration icon.

  3. Click Manage Service.

  4. Click Session State.

  5. Click Purge preferences for a selected user.

  6. Specify a user and follow the on-screen instructions.


See Also:

"Managing Session State and User Preferences" for information about using the Session State Management page

Resetting Preferences Using a Page Process

You can reset user preferences by creating a page process and selecting the process type Reset Preferences.

To reset user preferences using a page process:

  1. Navigate to the appropriate Page Definition:

    1. Navigate to the Workspace home page.

    2. Click the Application Builder icon.

    3. Select an application.

    4. Select a page.

      The Page Definition appears.

  2. Under Page Processes, click the Create icon.

    The Create Page Computation Wizard appears.

  3. Specify a process name, sequence, and processing point.

  4. From Type, select Reset Preferences.

  5. Follow the on-screen instructions