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: 8 additions & 16 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
MIT License

Copyright (c) 2021 DriveWorks
Copyright (C) 2020 DriveWorks Ltd

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of this example and associated documentation files (the "Example"), to deal in the Example without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Example, and to permit persons to whom the Example is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Example.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
THE EXAMPLE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE EXAMPLE OR THE USE OR OTHER DEALINGS IN THE EXAMPLE.

Any third party software used is covered under their own license agreements.

GeoJS (https://www.geojs.io/) https://github.com/jloh/geojs/blob/master/LICENCE
84 changes: 82 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,82 @@
# IntegrationThemeExample-Dashboard
A web dashboard combining data sources from the Integration Theme Web API & Live Licensing endpoints
# DriveWorks Live - Integration Theme Example - Dashboard
### Version: 1.4.6
#### Minimum DriveWorks Version: 18.0

An example web dashboard combining data sources from the DriveWorks Integration Theme Web API & Live License Server endpoints.

Please note: DriveWorks are not accepting pull requests for this example.
Join our [online community](https://my.driveworks.co.uk) for discussion, resources and to suggest other examples.

### Features

- **License Session Data**
- Centralized, OnDemand and Total Entitlement
- Current Connections
- Current Usage
- Peak Usage

- **Group Data**
- Projects
- Specifications (Generated and Queued)
- Documents (Generated and Queued)

- **Live Sessions**
- Server Name
- Country of Origin [optional]
- Unique Address
- Session Length
- Browser

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

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 data to render - as configured in DriveWorksConfigUser.xml.
* This connection is used to access API data, such as Project/Specification/Document counts.
* See [Integration Theme Settings](https://docs.driveworkspro.com/Topic/IntegrationThemeSettings) for additional guidance.
* `credentials` - [optional] The username and password of the Group user to login.
* For publicly hosted content, it is advised that default credentials are instead stored within the XML config file (DriveWorksConfigUser.xml).
* See [Integration Theme Connection Settings](https://docs.driveworkspro.com/Topic/IntegrationThemeSettings#Connection-Settings) for additional guidance.
* Credentials could also be collected via a login form on-demand. See the related [Simple Login Example](https://github.com/DriveWorks/IntegrationThemeExample-SimpleLogin) for additional guidance.
* `licenseDataUrl` - Address and port of a valid DriveWorks Live Floating License Server, from which to access usage data.
* Example: http://YOUR-LICENCE-SERVER:27080
* See [DriveWorks Live Licensing API Help](https://docs.driveworkspro.com/topic/LicenseManagerDriveWorksLive#driveworks-live-licensing-api) for additional guidance.
* `driveWorksMajorVersion` - Major version of DriveWorks to display data from (multiple may be available) e.g. '18'

3. [optional] Configure additional settings
* `statusRefreshInterval` - The interval (in seconds) to request status data (version major/minor)
* `infoRefreshInterval` - The interval (in seconds) to request license info data (max sessions, on-demand cap, peak usage etc.)
* `sessionRefreshInterval` - The interval (in seconds) to request live session data (server name, hostname/address, browser, start time etc.)
* `apiRefreshInterval` - The interval (in seconds) to request DriveWorks Live API data (Projects/Specifications/Documents)
* `dateLocale` - ISO 639-1 standard language code (e.g. en-US). Used to format dates displayed.
* `defaultTheme` - (light/dark) Color theme for dashboard.
* `ipAddressLookup` - (true/false) Map session user address to country of origin.
* Uses [GeoJS](https://github.com/jloh/geojs) for user address lookup - please refer to it's [Third Party Licensing](https://github.com/jloh/geojs/blob/master/LICENCE)
* `knownAddresses` - Provide a list of known addresses to skip address lookup and provide custom location identification.
* Example: 1.1.1.1 - "HQ", "Main Office"
* See commented format.

4. In `index.html`, replace "YOUR-DRIVEWORKS-LIVE-SERVER-URL" 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.

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

6. If encountering any issues, check the browser's console for error messages (F12)

### Potential Issues:
* When serving this example for a domain different to your DriveWorks Live server, e.g. api.my-site.com from company.com, 'SameSite' cookie warnings may be thrown when the Client SDK attempts to store the current session id.
* 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, HTTPS is enabled in DriveWorks Live's settings and a valid SSL certificate has been configured via DriveWorksConfigUser.xml.
* See [Integration Theme Settings](https://docs.driveworkspro.com/Topic/IntegrationThemeSettings) for additional guidance.

---

This source code has been made available to demonstrate how you can integrate with DriveWorks using the DriveWorks Live API.
This code is provided under the MIT license, for more details see LICENSE.md.

The example requires that you have the latest DriveWorks Live SDK installed, operational and remotely accessible.
34 changes: 34 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Update these values to match those of your Server URL, DriveWorks Group Alias (optional: Credentials)
// and Licensing Data URL

// You can also enter any known IP addresses to:
// - Skip the IP lookup for these addresses
// - Override the country information displayed
// - Example: you could mark your internal IP as "Internal"/"INT", to distinguish internal traffic.

const config = {
serverUrl: "",
groupAlias: "",
credentials: {
username: "",
password: "",
},
licenseDataUrl: "", // Example: http://YOUR-LICENCE-SERVER:27080 - See https://docs.driveworkspro.com/topic/LicenseManagerDriveWorksLive#driveworks-live-licensing-api
driveWorksMajorVersion: 18, // Major version of DriveWorks to display data from (multiple may be available)
statusRefreshInterval: 120, // seconds
infoRefreshInterval: 10, // seconds
sessionRefreshInterval: 10, // seconds
apiRefreshInterval: 30, // seconds
dateLocale: "en-US", // ISO 639-1 standard language code (e.g. en-US)
defaultTheme: "light", // light/dark
ipAddressLookup: false, // Enable reverse lookup for session IP country of origin
knownAddresses: [ // List of known IP addresses, to override IP address lookup e.g. Main Office IP Address = "HQ"
// [
// "123.123.123.123",
// {
// "country": "Location Name", // Written name for the location e.g. "United States", "United Kingdom"
// "countryCode": "CO", // The short-code for the location e.g. "US", "GB" (ISO 3166-1 alpha-2)
// }
// ],
],
};
Loading