Versions Compared

Key

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

...

All submitted data will store accordingly based on the multiple selection selections of store binders.

5. Is there any resources/API that can be reuse?

We can refer to the implementation of other available Form Store Binder plugins. Joget default datasource can be retrieve with AppUtil.getApplicationContext().getBean("setupDataSource"). We can also refer to how Multi Tools plugin for the design: 

https://github.com/jogetworkflow/jw-community/blob/7.0-SNAPSHOT/wflow-core/src/main/java/org/joget/apps/app/lib/MultiTools.java

https://github.com/jogetworkflow/jw-community/blob/7.0-SNAPSHOT/wflow-core/src/main/resources/properties/app/multiTools.json

6. Prepare your development environment

We need to always have our Joget Workflow Source Code ready and builded built by following this guideline

The following of this tutorial is prepared with a Macbook Pro and Joget Source Code version 57.0.0. Please refer to Guideline for developing a plugin for other platform commandcommands.

Let said our folder directory as following. 

...

Code Block
- Home
  - joget
    - plugins
    - jw-community
      -57.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 stored.

Run the following command to create a maven project in the "plugins" directory.


Code Block
languagebash
cd joget/plugins/
~/joget/jw-community/5.0.0/wflow-plugin-archetype/create-plugin.sh org.joget.tutorial jdbcmulti_store_binder 5.0.0

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.

...

Code Block
languagebash
Define value for property 'version':  1.0-SNAPSHOT: : 57.0.0
[INFO] Using property: package = org.joget.tutorial
Confirm properties configuration:
groupId: org.joget.tutorial
artifactId: jdbcmulti_store_binder
version: 57.0.0
package: org.joget.tutorial
Y: : y

We should get the "BUILD SUCCESS" message shown in our terminal and a "jdbcmulti_store_binder" folder created in the "plugins" folder.

Open the maven project with your favour favor IDE. I will be using NetBeans.  

...

a. Extending the abstract class of a plugin type

Create a "JdbcStoreBinderMultiStoreBinder" class under "org.joget.tutorial" package. Then, extend the class with org.joget.apps.form.model.FormBinder abstract class.

...

As usual, we have to implement all the abstract methods. We will be using the AppPluginUtil.getMessage method to support i18n and using constant using the constant variable MESSAGE_PATH for the message resource bundle directory.

...