Create service account for the project

สร้างบัญชีบริการสำหรับโครงการ

  1. Go to https://console.developers.google.com/projectselector/permissions/serviceaccounts

    ไปที่ https://console.developers.google.com/projectselector/permissions/serviceaccounts

  2. Select a project. You can create a new one too if you do not have one yet (e.g. jogetsample).

    เลือกโครงการ คุณสามารถสร้างใหม่ได้เช่นกันหากคุณยังไม่มี (เช่น jogetsample)


  3. Click on Create Service Account.

    คลิกที่ Create Service Account


     

  4. Name the service account (e.g. jogetsample).
    Remember to check Furnish a new private key and also Enable Google Apps Domain-wide Delegation. Press Create.

    ตั้งชื่อบัญชีบริการ (เช่น jogetsample)
    อย่าลืมตรวจสอบการสร้างคีย์ส่วนตัวใหม่และเปิดใช้งานการมอบหมายทั่วโดเมนของ Google Apps กดสร้าง


     

  5. A .json file will be downloaded. Open up the file in your favorite text editor.

    ไฟล์. json จะถูกดาวน์โหลด เปิดไฟล์ในโปรแกรมแก้ไขข้อความที่คุณชื่นชอบ

Enable Google Drive API for the project

เปิดใช้งาน Google Drive API สำหรับโครงการ

  1. Go to https://console.developers.google.com/apis/library

    ไปที่ https://console.developers.google.com/apis/library

  2. Make sure that your current project is selected (e.g. jogetsample).

    ตรวจสอบให้แน่ใจว่าได้เลือกโครงการปัจจุบันของคุณ (เช่น jogetsample)


     

  3. Click on Google Drive API.

    คลิกที่ Google Drive API


     

  4. Enable it.

    เปิดใช้งาน

Delegate Google Drive access to the project service account

มอบสิทธิ์ให้ Google Drive เข้าถึงบัญชีบริการโครงการ

  1. Go to https://admin.google.com/AdminHome?chromeless=1#OGX:ManageOauthClients.

    ไปที่  https://admin.google.com/AdminHome?chromeless=1#OGX:ManageOauthClients.

  2. From the downloaded JSON file earlier, copy the "client_id" and put into the Client Name field.

    จากไฟล์ JSON ที่ดาวน์โหลดมาก่อนหน้านี้ให้คัดลอก "client_id" และใส่ลงในฟิลด์ชื่อลูกค้า


     

  3. In the field 

    ในฟิลด์ อย่างน้อยหนึ่งขอบเขตให้ป้อนค่าต่อไปนี้

    https://www.googleapis.com/auth/drive.file
  4. Click Authorize.

    คลิกอนุญาต

Configure Joget Workflow App

กำหนดค่า Joget Workflow App

  1. From the downloaded JSON file earlier, copy the "client_email" and "private_key" values.

    จากไฟล์ JSON ที่ดาวน์โหลดมาก่อนหน้านี้ให้คัดลอกค่า "client_email" และ "private_key"

  2. In your Joget app, select Google API Configuration in Properties & Export -> Set Default Plugin Properties

    ในแอป Joget ของคุณเลือกการกำหนดค่า Google API ใน Properties & Export -> Set Default Plugin Properties

  3. Key in the value of "client_email" value into OAuth 2.0 Client ID, and value of "private_key" into OAuth 2.0 Client Secret, then Submit.

    ป้อนค่าของ "client_email" ค่าลงใน OAuth 2.0 รหัสลูกค้าและค่าของ "private_key" ลงใน OAuth 2.0 ไคลเอนต์ลับแล้วส่ง Submit

Google Drive Form Element

องค์ประกอบของฟอร์ม Google Drive

  1. With the steps above done, you are now ready to use the Google Drive File form element.

    เมื่อทำตามขั้นตอนข้างต้นเสร็จแล้วคุณก็พร้อมที่จะใช้องค์ประกอบของไฟล์ในรูปแบบ Google Drive File

  2. Just configure on which user's Google Drive you want to store to and name the folder accordingly.

    เพียงกำหนดค่าไดรฟ์ Google ของผู้ใช้ที่คุณต้องการจัดเก็บและตั้งชื่อโฟลเดอร์ตามนั้น


  3. Files uploaded will follow the same folder structure as the native File Upload element. Here's the sample screenshot in Google Drive.

    ไฟล์ที่อัปโหลดจะเป็นไปตามโครงสร้างโฟลเดอร์เดียวกับองค์ประกอบก File Upload ดั้งเดิม นี่คือภาพตัวอย่างใน Google Drive