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 ApplicationPreference is in global application scope. It is visible from all parts of the application and valid for all entities until it is overruled by a more particular Preference
A ModulePreference is only visible and valid for the Module it is assigned to.
This kind of Preference is only valid for a certain Role. Each Role can have a set of RolePreferences defined.
An User can have her own Preferences, too. This type of Preference which is assigned to a particular User is a so called UserPreference.
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 Key | Description |
---|---|
APP_Preferences | Permission to open the Preferences Management Screen and manage all Preferences. |
APP_add_preference_button | Ability to add new Preferences. |
APP_delete_preference_button | Ability to remove Preferences. |
APP_save_preference_button | Ability to save changes made on a Preference. |
From the main application actions bar click
-> 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.Table 10.2. Actions bar of the Preference Management View
Icon | Description |
---|---|
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 field | Description |
---|---|
Key | Unique identifier of the Preference within the type of Preference. |
Description | Description text of the Preference. |
Owner | An owner where the Preference belongs to. |
String Value | An alphanumeric value. |
Float Value | A numeric value. |
Minimum Value | A possible minimum value. Used to define a range. |
Maximum Value | A possible maximum value. Used to define a range. |
From File | Indicates, whether the Preference is defined in a file or created by the User. |
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”.
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.
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.