GenericConfig - a utility lib to create <configurable> dialogs

mbergmann
Crownpeak employee
Crownpeak employee
10 1 2,618

GenericConfiguration - Google Docs - Google Chrome.jpg

As you might know, you can create configuration dialogs to FirstSpirit module components like ProjectApps. This is done by implementing a class that implements the Configuration interface and adding this class as <configurable> to the component's module.xml declaration.

If you ever implemented such a dialog, you know it's not that easy because you have to implement some swing code and handle loading / saving the values. For each additional parameter you usually have to add code at multiple places what makes it hard to maintain. But basically, it's the same story again and again. All this when you just need some text entries and/or checkboxes.

Therefore, a while ago I created a small utility lib to make this task much easier. You only need one line of code for each configuration value (supported: text and checkboxes). The code shown in the screenshot is indeed all you have to implement in order to define a dialog with 5 configuration parameters (including loading/saving etc.). For a ProjectApp there are even some static utility methods to read the values from inside your module.

You can use this lib to make your life easier too when it comes to creating configuration dialogs für ProjectApps, Services, WebApps etc.

Important: If you use this lib, please only use it as resource in the module scope and never in the server scope (see the documentation why that's a very bad idea):

<resource name="com.espirit.ps.psci.module:generic-configuration" version="2.8.0" scope="module">lib/generic-configuration-2.8.0.jar</resource>

The attached zip contains the jar and a brief documentation. They are provided "as is" without any warranty concerning functionality or maintenance.

Michael

1 Comment
Version history
Last update:
‎06-07-2016 03:58 AM
Updated by: