In the Configuration Manager dialog “Customization” you can specify a wide range of custom sorts for reporting. If these methods are not enough then you can write a plugin with a very specific sort order and set the server to use it instead.
This sample configures the server to do all collation and text sorting according to DIN 5007-2, a German standard.
A compiled version of the plugin is made available as
collation.zip. In order to test this plugin, you need to copy the file into the plugins folder of your installation. Afterwards the server needs to be restarted. Note: This will override (and hide) all former collation server settings in the Configuration Manager dialog “Customization”.
If you want to write your own sorting plugin then you need to create an instance of java.text.Collator and register it in the ServerPluginManager. For more information please see the source files of this sample and the chapter
Platform Programming Guide | Plugins in the Help of the SDK.
The following steps need to be taken if changes are made to the plugin code.
plugin.properties and server plugin class are preconfigured to be used without modifications. If the sample is the basis for a custom plugin or just needs some adaptions, please refer to the platform programming guide for detailed instructions.
In order to build this plugin the following jar files are required at minimum:
You can copy these to the current sample directory or link them into the project of your IDE.
The plugin must be compiled into a jar file that is named like the id of the plugin. In this example it is
collation.jar. It also must contain the compiled sources as well as required language resources and images.
The target plugin is a zip file, named
collation.zip in this example. It contains the compiled jar file and the
plugin.properties which configures the custom plugin.
build.gradle in the sample can be used to build the plugin as well as any other build system.
Copy the ZIP file of the plugin into the plugins directory of the server and restart it. If there are problems, then check the log file of the server for more details. The “Config” logger is used to log plugin registration issues.