Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
We will get our JSON definition of the category as following. Please note that the queries used in the 2 SQL Chart menus are dependent on MySQL database.
After that, we can utilize the GeneratorUtil to add the category JSON definition to our selected userview JSON definition.
We need to always have our Joget Workflow Source Code ready and builded by following this guideline.
The following of this tutorial is prepared with a Macbook Pro and Joget Source Code version 5.0.0. Please refer to Guideline for Developing a Plugin for other platform command.
Let said our folder directory as following.
The "plugins" directory is the folder we will create and store all our plugins and the "jw-community" directory is where the Joget Workflow Source code stored.
Run the following command to create a maven project in "plugins" directory.
Then, the shell script will ask us to key in a version for your plugin and ask us for confirmation before generate the maven project.
We should get "BUILD SUCCESS" message shown in our terminal and a "form_submission_statistics_generator" folder created in "plugins" folder.
Open the maven project with your favour IDE. I will be using NetBeans.
Then, we have to do a UI for admin user to provide inputs for our plugin. In getPropertyOptions method, we already specify our Plugin Properties Options definition file is locate at "/properties/formSubmissionStatisticsGenerator.json". Let us create a directory "resources/properties" under "form_submission_statistics_generator/src/main" directory. After create the directory, create a file named "formSubmissionStatisticsGenerator.json" in the "properties" folder.
In the properties definition options file, we will need to provide options as below. Please note that we can use "@@message.key@@" syntax to support i18n in our properties options.
Once we done the properties option to collect input, we can work on the main method of the plugin which is format method.
In the getCategoryJson method, we will retrieve the category JSON definition form "/resources/category.json" file. Let us create a directory "resources/resources" under "form_submission_statistics_generator/src/main" directory. After create the directory, create a file named "category.json" in the "resources" folder. Then, copy the category JSON definition we created previously and paste it inside this file. We will need to replace some of the hardcoded value as variable and remember to escape those existing "%" to "%%" as the AppUtil.readPluginResource using String.format for injects value into the file.
Then, let upload the plugin jar to Manage Plugins. After upload the jar file, double check the plugin is uploaded and activated correctly.
Let us check the properties page for "Advanced Generator".
After the generation process is done.
A new category is added to our userview.
The SQL chart menus will shown as following.