Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
In this tutorial, we will following the guideline of developing a plugin to develop our Download PDF Datalist Action plugin.
We need to provide a PDF download feature when user click on a link/button on a datalist. The downloaded PDF file should be a form with data populated.
We can develop a Datalist Action Plugin to display a button for generate a form PDF file.
To develop a PDF Download Datalist Action plugin, we can consider to provide the following as input.
When PDF Download Datalist Action is used as datalist row action or column action, a normal user will see a link to download the PDF file in every rows of a datalist. Once the link is clicked, a PDF will be prompt to download.
When the plugin is used as whole datalist action, a zip file containing all the generated PDF of every selected rows will be prompt to download when the button is clicked.
To develop the PDF Download Datalist Action plugin, we can reuse the methods in FormPdfUtil to generate a form as PDF. We can also refer to the source code of the Datalist Form Data Delete Action plugin as well. Other than that, we can refer to the Export Form Email Tool on what kind of plugin properties options we can provide in the plugin as the Export Form Email Tool are using the methods in FormPdfUtil as well.
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 of developing a plugin for other platform command.
Let said our folder directory as following.
- Home - joget - plugins - jw-community -5.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 "plugins" directory.
cd joget/plugins/ ~/joget/jw-community/5.0.0/wflow-plugin-archetype/create-plugin.sh org.joget.tutorial download_pdf_datalist_action 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.
Define value for property 'version': 1.0-SNAPSHOT: : 5.0.0 [INFO] Using property: package = org.joget.tutorial Confirm properties configuration: groupId: org.joget.tutorial artifactId: download_pdf_datalist_action version: 5.0.0 package: org.joget.tutorial Y: : y
We should get "BUILD SUCCESS" message shown in our terminal and a "download_pdf_datalist_action" folder created in "plugins" folder.
Open the maven project with your favour IDE. I will be using NetBeans.
Create a "DownloadPdfDatalistAction" class under "org.joget.tutorial" package.