The bundle properties offer the plug-in developer the possibility to configure plug-ins externally and thus control the runtime behaviour of the developed plug-ins.
The bundle properties can be used, for example, to make addresses and access information of web service endpoints configurable.
They are suitable for externally influencing certain plugin types, such as the IPluginFormPreRender plugin or the IPluginServletAction plugin, which themselves do not have their own configuration interface in FORMCYCLE.
Definition of bundle properties by the plugin developer
The interface of FORMCYCLE offers the possibility to store new properties with name and value at the respective plug-in bundle. In most cases, however, it is useful if the name (access key, must be unique within the bundle properties) and, if necessary, a default value for a property are stored. and, if applicable, a default value for a property, are already defined by the plug-in developer.
On the one hand, this eliminates typing errors when the access key is created by the plug-in user, and on the other hand on the other hand, the plug-in user receives a view of all configuration values supported by the plug-in developer.
Interface IBundleProperties
The interface provides the following method signatures:
Map getConfigProperties(IPluginResourceHelper resHelper, Locale currentLocale) The getConfigProperties method is used to configure property values that should be available to all Java classes within the plugin bundle. Transfer values:
Return values:
|
Implementation example
The following code example shows a possible implementation:
Access to bundle properties within the plugin logic
Access to bundle properties within individual plugin implementations is provided via the IFCPlugin interface and its provided plugin lifecycle methods. All Plugin Types inherit from this interface, allowing access to bundle properties in all plugin implementations.
Examples for reading bundle properties
The following example shows how to access the bundle properties within a IPluginFormPreRender implementation.
By default, a PreRender plugin is executed on all form calls in the scope of the client in which it was registered.
For example, if you want the PreRenderer to be executed only when certain forms are called, you can make this configurable using Bundle-Properties.
The following example reads in the execute method reads the value of the Bundle-Property activate.form.alias, which contains the names of forms (separated by commas). Then these names are compared with the name of the current form in whose scope the PreRenderer is currently running. If the name of the current form does not match a name from the configured list, further processing of the PreRenderer is aborted.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article