Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# DriveWorks Live - Integration Theme Example - Simple Embedded Form
# DriveWorks Live - Integration Theme Example - Embedded Form
### Release: 21.1
#### Minimum DriveWorks Version: 18.0

A distributable template that renders a predefined project into an embedded section of the page - set via a config file.
A distributable template that renders a predefined Project into an embedded section of the page - set via a config file.

---

Expand All @@ -12,31 +12,31 @@ Join our [online community](https://my.driveworks.co.uk) for discussion, resourc
---

### Overview:
- Dynamically injects the DriveWorks Live Client library script using the configured server url (see config.js).
- Dynamically injects the DriveWorks Live Client library script using the configured server url (see `config.js`).
- Provides an example of loading from a static URL, if preferred.
- Connects to the DriveWorks Live Integration Theme API.
- Renders a DriveWorks Form embedded within placeholder page content.
- Uses basic HTML/CSS/JS.
- Optional loading state - to avoid an initial empty output.

### To use:
1. Clone this repository, or download as a .zip
1. Clone this repository, or download as a `.zip` file.

2. Enter your Integration Theme details into `config.js`
2. Enter your Integration Theme details into `config.js`.
* `serverUrl` - The URL that hosts your Integration Theme, including any ports.
* `groupAlias` - The public alias created for the Group containing the project to render - as configured in DriveWorksConfigUser.xml.
* `groupAlias` - The public alias created for the Group containing the Project to render - as configured in `DriveWorksConfigUser.xml`.
* This *must* be specified for each Group you wish to use.
* This allows you to mask the true Group name publicly, if desired.
* See [Integration Theme Settings](https://docs.driveworkspro.com/Topic/IntegrationThemeSettings) for additional guidance.
* `projectName` - The name of the Project to render.
* `specificationPingInterval` - [optional] The interval at which to 'ping' the server automatically
* `specificationPingInterval` - [optional] The interval at which to 'ping' the server automatically.
* This ensures a session is kept alive during inactivity, if desired.

3. Ensure that the Integration Theme server is running, using any of the available methods (e.g. Personal Web Edition, DriveWorks Live, IIS).
* For more information, see [Selecting the Integration Theme](https://docs.driveworkspro.com/Topic/IntegrationThemeSelect).

4. Host the example locally or on a remote server.
* Ensure `<corsOrigins>` in DriveWorksConfigUser.xml permits requests from this location.
* Ensure `<corsOrigins>` in `DriveWorksConfigUser.xml` permits requests from this location.
See [Integration Theme Settings](https://docs.driveworkspro.com/Topic/IntegrationThemeSettings) for additional guidance.

### Troubleshooting:
Expand All @@ -46,17 +46,17 @@ If encountering any issues, please check the browser's console for error message
If you are unable to use the dynamic library loading demonstrated in this example:
1. In `index.html`, uncomment "Option A" & replace "YOUR-DRIVEWORKS-LIVE-SERVER-URL.COM" with the URL of your own DriveWorks Live server that is serving `DriveWorksLiveIntegrationClient.min.js` - including any ports.
* This should be the URL that hosts the Integration Theme, and serves it's landing page.
* To check that this URL is correct, attempt to load DriveWorksLiveIntegrationClient.min.js in a browser. It should return a minified code library.
* To check that this URL is correct, attempt to load `DriveWorksLiveIntegrationClient.min.js` in a browser. It should return a minified code library.
2. Remove the "Option B" `<script>` tag.

### Potential Issues:

* When serving this example for a domain different to your DriveWorks Live server, e.g. api.my-site.com from www.company.com, 'SameSite' cookie warnings may be thrown when the Client SDK attempts to store the current session id in a cookie.
* This appears as "Error: 401 Unauthorized" in the browser console, even with the correct configuration set.
* To resolve:
* Ensure you are running DriveWorks 18.2 or above
* Ensure HTTPS is enabled in DriveWorks Live's settings
* Ensure a valid SSL certificate has been configured via DriveWorksConfigUser.xml.
* Ensure you are running DriveWorks 18.2 or above.
* Ensure HTTPS is enabled in DriveWorks Live's settings.
* Ensure a valid SSL certificate has been configured via `DriveWorksConfigUser.xml`.
* Ensure if using an incognito/private window, third-party cookies are not blocked (see browser settings).
* See [Integration Theme Settings](https://docs.driveworkspro.com/Topic/IntegrationThemeSettings) for additional guidance.

Expand Down
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
Expand Down Expand Up @@ -122,8 +122,8 @@ <h1>Engage customers with a configurator embedded on your website.</h1>
*/
function pingSpecification(specification) {

// Disable ping if interval is 0
if (config.specificationPingInterval === 0) {
// Disable ping if interval is 0, or not a number
if (typeof config.specificationPingInterval !== "number" || config.specificationPingInterval === 0) {
return;
}

Expand Down