Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
Table of Contents |
---|
English |
---|
In this tutorial, we will following the guideline of developing a plugin to develop our multi store binders plugin. Please also refer to the very first tutorial How to develop a Bean Shell Hash Variable and also the following store binder related plugin for more detailed steps. |
...
The following of this tutorial is prepared with Joget Source Code version 7.0.0. Please refer to Guideline for developing Developing a pluginPlugin for other platform commands.
...
Code Block |
---|
- Home
- joget
- plugins
- jw-community
-7.0.0 |
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 is stored.
Run the following command to create a maven project in the "plugins" directory.
Code Block | ||
---|---|---|
| ||
cd joget/plugins/ ~/joget/jw-community/7.0.0/wflow-plugin-archetype/create-plugin.sh org.joget.marketplace multi_store_binder 78.0.0 |
Then, the shell script will ask us to key in a version for your plugin and ask us for confirmation before generate generating the maven project.
Code Block | ||
---|---|---|
| ||
Define value for property 'version': 1.0-SNAPSHOT: : 78.0.0 [INFO] Using property: package = org.joget.marketplace Confirm properties configuration: groupId: org.joget.marketplace artifactId: multi_store_binder version: 7.0.0 package: org.joget.marketplace Y: : y |
...
Open the maven project with your favorite favourite IDE. We will be using using NetBeans.
...
As usual, we have to implement all the abstract methods. We will be using use the AppPluginUtil.getMessage method to support i18n and using the constant variable MESSAGE_PATH for the message resource bundle directory.
...
Then, we have to do a UI for the admin user to provide inputs for our plugin. In getPropertyOptions In getPropertyOptions method, we already specify our Plugin Properties Options definition file is located at "/properties/multiStoreBinders.json". Let us create a directory "resources/properties" under "multi_store_binder/src/main" directory. After creating the directory, create a file named "multiStoreBinders.json" in the "properties" folder.
...
Then, let upload the plugin jar to Manage Plugins. After upload, the jar file, double-check the plugin is uploaded and activated correctly.
Let create a form to create and update the user to dir_user table.
Then, configure the store binder of the section to Default Form Binder and JDBC Binderand Database SQL Query.
Code Block | ||||
---|---|---|---|---|
| ||||
select username from dir_user where username = {id} |
...
Code Block | ||||
---|---|---|---|---|
| ||||
delete from TABLE_NAME where id = {id} |
Now, let test to add a user.
Check the user is created in dir_user table.
It works! Please remember to test the other features of the plugin as well.
...
You can download the source code from multi_store_binderJogetOSS.zip
To download the ready-to-use plugin jar, please find it at find Multi Store Binder at http://marketplace.joget.org/.
...