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:
You view user preferences for a specific user on the Session State Management page.
To view user preferences for a specific user:
Navigate to the Workspace home page.
Click the Administration icon.
Click Manage Service.
Click Session State.
Click Report preferences for users.
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 |
You can set user preferences within your application through the creation of a page process, by creating a preference item, or programatically.
Topics:
To set user preference values by creating a page process:
Navigate to the appropriate Page Definition:
Navigate to the Workspace home page.
Click the Application Builder icon.
Select an application.
Select a page.
The Page Definition appears.
Under Page Processes, click the Create icon.
The Create Page Computation Wizard appears.
Specify a process name, sequence, and processing point.
From Type, select one of the following:
Set Preference to value of item
Set Preference to value of item if item is not NULL
Specify the preference value in the field provided using the format:
PreferenceName:Item
Click Page Items to see a list of available items.
Follow the on-screen instructions
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:
Navigate to the appropriate Page Definition:
Navigate to the Workspace home page.
Click the Application Builder icon.
Select an application.
Select a page.
The Page Definition appears.
Under Item, click the Create icon.
The Create Page Computation Wizard appears.
Specify the Item Name and Display Position Attributes and click Next.
Specify the Item Attributes click Next.
From the Item Source list, select Preferences.
In Item Source Value, enter the name of the preference.
Follow the on-screen instructions
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.
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);
You can manually purge user preferences for a specific user.
To manually purge preferences for a specific user:
Navigate to the Workspace home page.
Click the Administration icon.
Click Manage Service.
Click Session State.
Click Purge preferences for a selected user.
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 |
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:
Navigate to the appropriate Page Definition:
Navigate to the Workspace home page.
Click the Application Builder icon.
Select an application.
Select a page.
The Page Definition appears.
Under Page Processes, click the Create icon.
The Create Page Computation Wizard appears.
Specify a process name, sequence, and processing point.
From Type, select Reset Preferences.
Follow the on-screen instructions