Using the Managed Settings frameworkAdded by IBM on October 5, 2011 | Version 1 (Original)
|This framework allows an administrator to initialize, and optionally control, settings values in the Eclipse preference store.
This framework allows an administrator to initialize, and optionally control, settings values in the Eclipse preference store.
They do this by defining policy and preference settings, or any other name and value pairs, on the back-end system of their choice. Updates run periodically to populate the designated scopes and qualifiers in the Eclipse preference store with any new settings or settings changes specified by the administrator. The administrator may also designate a setting as being read-only. If this is the case, any user changes to the value will be disallowed.
Administrators can use the managed settings framework to populate both the standard Eclipse scopes and a custom scope called the ManagedSettingScope
. You may use either one to access your application’s settings. However, there are two advantages to using the ManagedSettingsScope
- The ManagedSettingScope allows you to determine if the administrator has designated a particular setting as read-only. If so, you can disable any user interface that would allow the user to change it. If you do not do this, and allow the end user to change the value using the standard Eclipse Scopes, the Managed Settings framework will revert the change, causing confusion and frustration for the end user. Also, if there are any plug-ins monitoring settings changes, they will get two events, one for the users change and one for the managed settings reversion. Not only could this cause flicker in the UI, but the reversion could come too late to stop an action that the administrator meant to prevent. If you do use the ManagedSettingScope to set the value, but forget to check first if it was read-only, the change will be prevented entirely instead of being reverted after the fact. While this does not improve the end-user experience, it does prevent any side-effects from having two change events, and more importantly, enforces the administrator's intent.
- The standard Eclipse preference scopes use text files to store their data, allowing end users to easily change the values even if there is no UI in the application to do so. If they do edit a read-only value, the managed settings framework will revert the value in as timely a manner as possible, but there could be short periods where the administrator’s value is not the one being used. The ManagedSettingScope obfuscates its data as a deterrent to end-user tampering. If you retrieve the settings from the ManagedSettingsScope, you will always be getting the administrator value and not the user value.
The Portlet Container uses the Managed Settings Framework to implement the Portal Policy API on the client. If you have an existing applications that uses the Portal Policy API to retrieve values from the Portal Policy Manager, it can use the same code to retrieve Managed Settings from the Eclipse Preference store.
Parent topic: Creating preference pages