Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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
languagebash
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
languagebash
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.

7. Just code it!

...

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.

Image RemovedImage Added

Let create a form to create and update the user to dir_user table.

Image RemovedImage Added

Then, configure the store binder of the section to Default Form Binder and JDBC Binderand Database SQL Query.

Image RemovedImage Added

Code Block
languagesql
titleCheck Select Query
select username from dir_user where username = {id}

...

Code Block
languagesql
titleDelete Query
delete from TABLE_NAME where id = {id}


Image RemovedImage Added

Now, let test to add a user.

Image RemovedImage Added

Check the user is created in dir_user table.

Image RemovedImage Added

It works! Please remember to test the other features of the plugin as well. (big grin)

...

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/.

...