
內容簡介
這個外掛啟用 driveworks_embed 短碼,以快速在任何內容中嵌入 DriveWorks 專案或 DriveApp。
它使用預先編寫的 DriveWorks Client SDK 功能自動創建客戶端,登錄,開始特定 / DriveApp,並渲染表單。
注意:此外掛需要配置和運行外部的DriveWorks Live Integration Server,允許從您的 WordPress 網域進行連接。
為了嵌入一個表單,只需提供以下內容:
server_url - Integration Theme 伺服器的 URL。用於載入客戶端庫並建立客戶端連接。
group_alias - 所連接的組的別名。
其中一個:
project_name - 要渲染的項目名稱
drive_app_alias - 要渲染的 DriveApp 的名稱
可選設置:
ping_interval - 自動發送請求給伺服器的間隔時間(以秒為單位)。如果需要在沒有手動交互的情況下保持連接,則非常有用。輸入 0 或刪除此設置即可禁用。
height - 渲染表單的容器高度,包括單位。如果表單沒有固定高度,這將非常有用。範例: 800px , 10em , 75vh 。
範例
渲染專案:
[driveworks_embed server_url="https://api.my-server.com" group_alias="MyGroupAlias" project_name="MyProject"]
渲染 DriveApp,固定高度,每 60 秒 ping 一次:
[driveworks_embed server_url="https://api.my-server.com" group_alias="MyGroupAlias" drive_app_alias="MyDriveApp" height="700px" ping_interval="60"]
如何操作?
短碼將被替換為嵌入並渲染 DriveWorks 表單所需的標記。
在您自己的伺服器上運行使用標準方法從 DriveWorks Live Client SDK 寫的腳本,執行登錄並渲染配置的表單。
該腳本在登錄時不會發送任何憑據,因此必須在 DriveWorksConfigUser.xml 中指定默認用戶。
如果沒有在伺服器端設置默認用戶,則不會授權連接。
確保您的 DriveWorks Integration Theme 伺服器正確運行非常重要。
您可以通過在瀏覽器中訪問配置的 server_url 來檢查此操作。
如果在配置或連接期間發生任何錯誤,將顯示明確的警告。
有關如何渲染 DriveWorks 表單的替代範例,請參見我們的公共Client SDK Examples和我們的Official GitHub。
外掛標籤
開發者團隊
② 後台搜尋「DriveWorks Shortcode – Form Embed」→ 直接安裝(推薦)
原文外掛簡介
This plugin enables the shortcode driveworks_embed, to quickly embed either a DriveWorks Project or DriveApp into any content.
It uses pre-written DriveWorks Client SDK functions to automatically create a client, login, start a Specification / DriveApp and render the Form.
Note: this plugin requires an external DriveWorks Live Integration Server to be configured and running, which allows connections from your WordPress domain.
To embed a Form, simply provide the following:
server_url – The URL of your Integration Theme server. Used to load the client library, and create a client connection.
group_alias – The alias of the Group to connect to.
Either:
project_name – The name of the Project to render
drive_app_alias – The name of the DriveApp to render
Optionally provide:
ping_interval – The interval (in seconds) at which the server is automatically sent a request. Useful to keep a session alive without manual interaction. Disable by setting to 0, or excluding this setting.
height – The height of the container that Form is rendered into, including the unit. Useful if the Form does not have a natural height. Examples: 800px, 10em, 75vh.
Examples
Render a Project:
[driveworks_embed server_url="https://api.my-server.com" group_alias="MyGroupAlias" project_name="MyProject"]
Render a DriveApp, with a fixed height, that pings every 60 seconds:
[driveworks_embed server_url="https://api.my-server.com" group_alias="MyGroupAlias" drive_app_alias="MyDriveApp" height="700px" ping_interval="60"]
How it works?
The shortcode is replaced with the markup required to embed and render a DriveWorks Form.
A pre-written script using standard methods from the DriveWorks Live Client SDK, running on your own server, performs a login and renders the configured Form.
The script will not send any credentials during login, so a default user must be specified in DriveWorksConfigUser.xml.
If a default user is not set server-side, the connection will not be authorized.
It is important to ensure that your DriveWorks Integration Theme server is running correctly.
You can check this by accessing the configured server_url in a browser.
Clear warnings will be shown if any errors are made in the config or during connection.
For alternative examples on how to render a DriveWorks Form, see our public Client SDK Examples and our Official GitHub.
