Skip to content

Commit

Permalink
Merge pull request #1 from DriveWorks/develop
Browse files Browse the repository at this point in the history
Initial public Github release (2.1.2) with setup guide
  • Loading branch information
ConnorDriveWorks authored Mar 22, 2021
2 parents abb99a0 + 1981ea9 commit 54f1758
Show file tree
Hide file tree
Showing 35 changed files with 6,425 additions and 18 deletions.
20 changes: 4 additions & 16 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
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.
71 changes: 69 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,69 @@
# IntegrationThemeExample-CorporateWebsite
A replication of the DriveWorks Live Web Theme "Corporate Skin" - using the Integration Theme API.
# DriveWorks Live - Integration Theme Example - Corporate Website
### Version: 2.1.2
#### Minimum DriveWorks Version: 18.1

An example of a full Corporate Website built upon the DriveWorks Live Integration Theme API.
It's features are based on the Web Theme's "Corporate Skin".

This template is designed to be configured and used as is, or the starting point for a larger application.

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:
- Connects to the DriveWorks Live Integration Theme API
- Login Screen - Customizable login screen, with credentials attached to a config file
- Projects View - Renders a list of available Projects
- Shown on successful login by default - redirect configurable
- Run View - Render and transition Specifications
- Load custom assets matching the current Project name. See /custom-project-assets
- Implement advanced customizations using JavaScript and CSS
- Details View - View Specification details and access documents
- History View - Search and filter Specifications
- "Query" Function - create new or edit existing Specifications through a URL query
- Similar to the [DriveWorks Live "Integration Module"](https://docs.driveworkspro.com/topic/IntegrationModuleLive)
- Examples:
- /query?run={ProjectName}
- /query?specification={SpecificationName}
- /query?specification={SpecificationName}&transition={TransitionName}

### 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 display - 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.
* `specificationPingInterval` - [optional] The interval at which to 'ping' the server automatically
* This ensures a session is kept alive during inactivity, if desired.
* *Optional*:
* Configure various redirects (login, logout, specification close/cancel)
* Configure update intervals (Details view)
* Configure 'Query' function settings and defaults

3. 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.

4. 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.

5. 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.

37 changes: 37 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Update these values to match those of your Server URL & DriveWorks Group Alias

const config = {
serverUrl: "",
groupAlias: "",
// (Optional) Configure ping & update intervals - in seconds
// A Specification will timeout after a configured period of inactivity (see DriveWorksConfigUser.xml).
// This function prevents a Specification timing out as long as the page is in view.
// Disable the ping by setting to 0
specificationPingInterval: 0,
// (Optional) Enter custom redirect URLs for login/logout and Project close/cancel
login: {
redirectUrl: "projects.html",
},
logout: {
redirectUrl: "index.html",
},
project: {
redirectOnClose: "details.html",
redirectOnCancel: "projects.html",
},
// (Optional) Configure 'Details' view
details: {
updateInterval: 5, // Interval to refresh content - in seconds
},
// (Optional) Configure the query function
// Enter a default Group Alias and/or Project name to be used (when none are passed in the query string)
// Choose how sessions are handled
query: {
defaultGroupAlias: "",
defaultProjectName: "",
autoLogin: false,
requireNewSession: false,
requireExactAlias: false,
},
loginReturnUrls: true, // Enable/disable return urls to restore the previous location when redirected to the login form
};
12 changes: 12 additions & 0 deletions custom-project-assets/project-name.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* ADDITIONAL STYLES
* Project: *project-name*
*
* This file will load when the Project name matches the file name
*
*/

.custom-selector {
/* your custom properties */
color: red;
}
4 changes: 4 additions & 0 deletions custom-project-assets/project-name.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// CUSTOM SCRIPT
// Project: *project-name*

console.log("This is a custom script. It will load when the Project name matches the file name.");
Loading

0 comments on commit 54f1758

Please sign in to comment.