Versions Compared

Key

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

...

2. ความคิดของคุณในการแก้ปัญหาคืออะไร?

We can develop a เราสามารถพัฒนา ปลั๊กอินตัวจัดรูปแบบคอลัมน์ข้อมูล (Datalist Column Formatter Plugin) to convert the value to a link. เพื่อแปลงค่าเป็นลิงค์

3. อินพุตที่จำเป็นสำหรับปลั๊กอินของคุณคืออะไร?

The file download link format of รูปแบบลิงค์ดาวน์โหลดไฟล์ของ Joget Workflow isคือ

/jw/web/client/app/{appId}/{appVersion}/form/download/{formId}/{recordId}/{fileName}.?attachment=true

Sampleตัวอย่าง:

http://localhost:8080/jw/web/client/app/test/1/form/download/testFile/f6946830-c0a80070-48cad9b7-8b971682/CHANGES.txt.?attachment=true

From the link format, we need to get the following information from admin user.จากรูปแบบลิงก์เราต้องได้รับข้อมูลต่อไปนี้จากผู้ใช้งาน admin

  1. Form Id : the form that contains the File Upload field. แบบฟอร์มที่มีฟิลด์อัพโหลดไฟล์
  2. Download as Attachment: Whether or not to add "?attachedment=true" in link.

4.

...

ผลลัพธ์และผลลัพธ์ที่คาดหวังจากปลั๊กอินของคุณคืออะไร?

ชื่อไฟล์จะปรากฏเป็นลิงค์ใน DatalistThe file name is displayed as a link in Datalist.

5.

...

มีทรัพยากร / API

...

ใด ๆ ที่สามารถนำมาใช้ซ้ำได้?

We can refer to the คุณสามารถอ้างอิงถึง File Upload Field on how to generate the download link of the file. เกี่ยวกับวิธีสร้างลิงค์ดาวน์โหลดของไฟล์

6.

...

เตรียม environment ของคุณเพื่อการพัฒนา

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 แนวทางสำหรับการพัฒนาปลั๊กอิน for other platform command.

Let said our folder directory as following. 

Code Block
- 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.

Code Block
languagebash
cd joget/plugins/
~/joget/jw-community/5.0.0/wflow-plugin-archetype/create-plugin.sh org.joget.tutorial file_link_datalist_formatter 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: : 5.0.0
[INFO] Using property: package = org.joget.tutorial
Confirm properties configuration:
groupId: org.joget.tutorial
artifactId: file_link_datalist_formatter
version: 5.0.0
package: org.joget.tutorial
Y: : y

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

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

...