Join us on May 14-15, 2019 at Forrester Digital Transformation & Innovation 2019 in Chicago, USA.

Versions Compared

Key

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

Table of Contents

Create service account for the project

...

为项目创建服务帐户

  1. 转到  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).
    Image Removed
  3. Click on Create Service Account.选择一个项目。如果还没有,也可以创建一个新的(例如jogetsample).
    Image Added
  4. 单击“  创建服务帐户”
     
  5. 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.
    Image Removed 
  6. A .json file will be downloaded. Open up the file in your favorite text editor.

Enable Google Drive API for the project

  1. Go to 命名服务帐户(例如jogetsample)。
    请记得检查  提供新的私钥, 以及  启用Google Apps域范围的委派。按创建。
    Image Added
  2. 将下载.json文件。在您喜欢的文本编辑器中打开文件。

为项目启用Google Drive API

  1. 转到  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.
     
  4. Enable it.

Delegate Google Drive access to the project service account

  1. Go to 启用它。

委派Google云端硬盘访问项目服务帐户

  1. 转到  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.
    Image Removed 
  3. In the field 
  4. 从之前下载的JSON文件中,复制“client_id”并将其放入“  客户端名称”字段中。
    Image Added 
  5. 在“  ”字段中  

    Code Block
    https://www.googleapis.com/auth/drive.file
  6. Click Authorize.

...

  1. 单击“  授权”

配置Joget Workflow App

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

  2. In your Joget app, select Google API Configuration in 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.

    Image Removed

Google Drive Form Element

  1. With the steps above done, you are now ready to use the Google Drive File form element.
  2. Just configure on which user's Google Drive you want to store to and name the folder accordingly.
    Image Removed
  3. Files uploaded will follow the same folder structure as the native File Upload element. Here's the sample screenshot in Google Drive.

    从之前下载的JSON文件中,复制“client_email”和“private_key”值。

  4. 在您的Joget应用中,选择属性和导出中的 Google API配置- >设置默认插件属性

  5. 将“client_email”值的值键入OAuth 2.0客户端ID,将“private_key”的值键入OAuth 2.0 Client Secret,然后提交

  6. Image Added

Google云端硬盘表单元素

  1. 完成上述步骤后,您就可以使用  Google Drive File f orm元素了。
  2. 只需配置要存储到哪个用户的Google云端硬盘,并相应地命名该文件夹。
  3. Image Added
  4. 上传的文件将遵循与本机“ 文件上载”元素相同的文件夹结构。以下是Google云端硬盘中的示例屏幕截图。