Chapter 10. Preference Management

10.1. Overview

All enterprise applications have some kind of configurable application preferences or settings, nevertheless whether they come from a file, a database or somewhere else. In OpenWMS.org we call these setting parameters Preferences. A Preference is always in a certain scope, valid for a particular part of the application. So far, we have defined four different types of Preferences:

An authorized User is able to create new Preferences, modify or delete existing ones. The Grants in Table 10.1, “Table of Grants regarding Preferences Management” determine the actions an User can perform. All Grants are stored in the secured-objects.xml file of the main Flex Application Module.

Table 10.1. Table of Grants regarding Preferences Management

Grant KeyDescription
APP_PreferencesPermission to open the Preferences Management Screen and manage all Preferences.
APP_add_preference_buttonAbility to add new Preferences.
APP_delete_preference_buttonAbility to remove Preferences.
APP_save_preference_buttonAbility to save changes made on a Preference.

10.2. Preference Management Screen

From the main application actions bar click Application->Preferences to open the Preference Management view. On the left-hand side of the sreen all Preferences are grouped by their type in an accordion container. Details of a selected Preference are shown right beside.

Preference Management View

Figure 10.1. Preference Management View


Table 10.2. Actions bar of the Preference Management View

IconDescription
Open a dialogue to create a new Preference with all the required information like the preference key, a value and an owner (like Application, Module, Role or User).
Delete an existing Preference.
Save changes you did on the currently chosen Preference.
Reload and refresh all Preferences from the persistent storage.

Each Preference must have at least a key and a type assigned. Preferences of type ModulePreference, RolePreference and UserPreference additionally need to have an owner. The key and owner fields are unique along all defined Preferences and cannot declared twice - be aware of that. For example, it is not allowed to define two Preferences with a key 'defaultLanguage' within the same Module 'CORE', but it is still allowed to have this Preference defined for two separate Modules 'CORE' and 'Common'.

Table 10.3. Description of Preference Details

Input fieldDescription
KeyUnique identifier of the Preference within the type of Preference.
DescriptionDescription text of the Preference.
OwnerAn owner where the Preference belongs to.
String ValueAn alphanumeric value.
Float ValueA numeric value.
Minimum ValueA possible minimum value. Used to define a range.
Maximum ValueA possible maximum value. Used to define a range.
From FileIndicates, whether the Preference is defined in a file or created by the User.

10.3. Create a new Preference

Clicking the button to create a new Preference () opens the dialogue shown in Figure 10.2, “Create a Preference” to add a Preference and store it in the database. Actually the same fields can be set like in the details page of the overview screen Figure 10.1, “Preference Management View”.

Create a Preference

Figure 10.2. Create a Preference


10.4. Modify an existing Preference

To make changes on an existing Preference, select that one from list on the left side of the screen. On the details page you can modify the values of the selected Preference. Notice that the key of an existing Preference cannot be changed after it is created. To save your work back to the system click on the 'Save' button () in the upper actions bar.

10.5. Delete an existing Preference

Removing an existing Preference is simple as well. Just select the Preference to remove and click on the 'Remove' button (). No confirmaton will be shown, hence be careful with deletion of existing entries.