|
1 | | -# IntegrationThemeExample-StylingWithCSS |
| 1 | +# Integration Theme Example: Styling with CSS |
| 2 | +### Version: 1.0.0 |
| 3 | +#### Minimum DriveWorks Version: 18.0 |
| 4 | + |
| 5 | +A distributable example that demonstrates how to style DriveWorks controls using CSS. |
| 6 | + |
| 7 | +Please note: DriveWorks are not accepting pull requests for this example. |
| 8 | +Join our [online community](https://my.driveworks.co.uk) for discussion, resources and to suggest other examples. |
| 9 | + |
| 10 | +### This example: |
| 11 | +- Demonstrates using basic metadata & CSS selectors, and further advanced styling that CSS enables. |
| 12 | +- Provides 2 DriveWorks Packages (.drivepkg), each containing an example Project that demonstrate use of the Metadata property and styling various properties. |
| 13 | + - **BasicStyles18.drivepkg** - Demonstrates using metadata & basic CSS selectors to target DriveWorks controls (see also: /basic-styles/style.css) |
| 14 | + - **AdvancedStyles18.drivepkg** - Demonstrates some possibilities for advanced styling made available via CSS (see also: /advanced-styles/advanced-styles.css) |
| 15 | + |
| 16 | +The CSS selectors/styles demonstrated can be viewed without installing the provided Projects, for quick reference. Simply open the included `.css` files. |
| 17 | + |
| 18 | +### /basic-styles |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | +- Creates a new Specification |
| 23 | +- Loads in a custom stylesheet (/basic-styles/style.css) |
| 24 | +- Styles a single button control - using the Project 'BasicStyles18' |
| 25 | +- Demonstrates: |
| 26 | + - Targeting controls with the `Metadata` property (data-metadata) |
| 27 | + - Using CSS Attribute Selectors |
| 28 | + - Rounded Corners (border-radius) |
| 29 | + - Shadows (box-shadow) |
| 30 | + - Animating styles (transition) |
| 31 | + - Rotate and Scale (transform) |
| 32 | + - Gradients (linear-gradient) |
| 33 | + - Hover styles (:hover) |
| 34 | + - Styling child elements |
| 35 | + |
| 36 | +### /advanced-styles |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | +- Creates a new Specification |
| 41 | +- Loads in an alternate custom stylesheet (/advanced-styles/advanced-styles.css) |
| 42 | +- Styles multiple controls - using the Project 'AdvancedStyles18' |
| 43 | +- Demonstrates: |
| 44 | + - Various button styles |
| 45 | + - CSS Transforms (rotate/scale/skew) |
| 46 | + - CSS Filters (blur, grayscale) |
| 47 | + - Animating position changes |
| 48 | + |
| 49 | +### To use: |
| 50 | +1. Clone this repository, or download as a .zip |
| 51 | + |
| 52 | +2. Extract each of the supplied .drivepkg files using the DriveWorks Package Wizard to access the included Project files. |
| 53 | + |
| 54 | +3. Open the extracted Groups in DriveWorks Administrator and use 'Form Design' to view each Controls and its properties. |
| 55 | + * Most importantly: the 'Metadata' properties that are targeted via CSS. |
| 56 | + |
| 57 | +4. In `DriveWorksLiveConfigUser.xml`, add a new Group Alias for the each new Group containing the example Projects. |
| 58 | + * See [Integration Theme Settings](https://docs.driveworkspro.com/Topic/IntegrationThemeSettings) for additional guidance. |
| 59 | + |
| 60 | +5. Open the extracted Groups in DriveWorks Live and start the Integration Theme. |
| 61 | + * See [Selecting the Integration Theme](https://docs.driveworkspro.com/Topic/IntegrationThemeSelect) for additional guidance. |
| 62 | + |
| 63 | +6. Enter your Integration Theme details into `config.js` for each example. |
| 64 | + * `serverUrl` - The URL that hosts your Integration Theme, including any ports. |
| 65 | + * `groupAlias` - The public alias created for the Group containing the DriveApps to render - as configured in DriveWorksConfigUser.xml. |
| 66 | + * This *must* be specified for each Group you wish to use. |
| 67 | + * This allows you to mask the true Group name publicly, if desired. |
| 68 | + * See [Integration Theme Settings](https://docs.driveworkspro.com/Topic/IntegrationThemeSettings) for additional guidance. |
| 69 | + * `projectName` - The name of the Project to render a Specification from. |
| 70 | + * These are pre-filled with supplied Project names, but can be changed if required. |
| 71 | + |
| 72 | +7. Open the example HTML files locally (localhost) or on a remote server. |
| 73 | + * Ensure `<corsOrigins>` in DriveWorksConfigUser.xml permits request from this location. |
| 74 | + See [Integration Theme Settings](https://docs.driveworkspro.com/Topic/IntegrationThemeSettings) for additional guidance. |
| 75 | + |
| 76 | +8. If encountering any issues, check the browser's console for error messages (F12) |
| 77 | + |
| 78 | +### Potential Issues: |
| 79 | +* 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. |
| 80 | + * This appears as "Error: 401 Unauthorized" in the browser console, even with the correct configuration set. |
| 81 | + * To resolve: |
| 82 | + * 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. |
| 83 | + * See [Integration Theme Settings](https://docs.driveworkspro.com/Topic/IntegrationThemeSettings) for additional guidance. |
| 84 | + |
| 85 | +--- |
| 86 | + |
| 87 | +This source code has been made available to demonstrate how you can integrate with DriveWorks using the DriveWorks Live API. |
| 88 | +This code is provided under the MIT license, for more details see LICENSE.md. |
| 89 | + |
| 90 | +The example requires that you have the latest DriveWorks Live SDK installed, operational and remotely accessible. |
0 commit comments