Extending a plug-in with a user configuration

With a user configuration, you can extend a plug-in by storing your own configuration information in WSRR rather than coding it in the plug-in.

The following example discusses a user-written SMS notification plug-in. The SMS server address to which notifications are sent is stored in a user configuration. The notification plug-in obtains the address from the user configuration at runtime. The example is summarized in the following diagram:

User configuration example
The numbered event sequence in the diagram is as follows:
  1. The notification plug-in receives a "document created" notification event from WSRR.
  2. The notification plug-in retrieves the user configuration by using a retrieveConfiguration( “USER_CONFIGURATION”, “mySMSplugin” ); method call on the WSRR MBean.
  3. The user configuration is returned in a byte array. The address is held in a property called "Sms_server_ip".
  4. The plug-in sends a notification to the SMS server at the address obtained from the user configuration.
Your user configuration information is contained in a text file that you create and then load into WSRR. You can load a new user configuration in either of the following ways:
You can replace an existing user configuration in either of the following ways:
You can modify the user configuration directly by using the Web UI. Perform the following actions:
  1. Switch to the Configuration perspective if necessary, by selecting Configuration in the Perspective list.
  2. Click Active Profile > User Configurations.
  3. Click the name of the user configuration you want to modify and select the Content tab.
  4. Make the required modifications to the user configuration file content.
  5. Click OK to save your changes.

You can access a user configuration programmatically by using the WSRR MBean. See the Related link for further information.