### Install Dependencies and Build Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/register-with-dock3-basic/README.md Run these commands to set up the project, build the code, and start the test server. ```shell npm run setup ``` ```shell npm run start ``` ```shell npm run build ``` -------------------------------- ### Install Dependencies and Build Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/customize-home-templates/README.md Run this command to install project dependencies and perform the initial build. Assumes you are in the example's sub-directory. ```shell npm run setup ``` -------------------------------- ### Start the Test Server Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/customize-home-templates/README.md Execute this command in a new window to start the test server for the sample application. ```shell npm run start ``` -------------------------------- ### Install Dependencies Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/integrate-with-ms365/README.md Run this command to install the necessary project dependencies. Ensure you are in the sample's sub-directory. ```shell npm install ``` -------------------------------- ### Start Test Server Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/support-context-and-intents/README.md Starts the test server in a new window. This is a necessary step before launching the HERE Core UI Platform. ```shell npm start ``` -------------------------------- ### Start HERE Core UI Platform Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/customize-home-templates/README.md Run this command to start the HERE Core UI Platform, which includes launching Workspace if it's not already running. ```shell npm run client ``` -------------------------------- ### Start HERE Core UI Platform Client Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/register-with-dock3-basic/README.md Launch the HERE Core UI Platform, which starts Workspace if it's not already running. Use 'npm run secondclient' for the self-hosted app asset version. ```shell npm run client ``` ```shell npm run secondclient ``` -------------------------------- ### Manifest Platform Configuration Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/migrate-from-a-previous-version/README.md Example of the platform section in the manifest for the register-with-store example, including permissions and window options. ```json "platform": { "uuid": "register-with-store", "icon": "http://localhost:8080/favicon.ico", "autoShow": false, "providerUrl": "http://localhost:8080/platform/provider.html", "preventQuitOnLastWindowClosed":true, "permissions": { "System": { "launchExternalProcess": true, "downloadAsset": true, "openUrlWithBrowser": { "enabled": true, "protocols": ["mailto"] } } }, "defaultWindowOptions": { "permissions": { "System": { "openUrlWithBrowser": { "enabled": true, "protocols": ["mailto"] } } } } } ``` -------------------------------- ### Start Third HERE Core UI Platform Instance (FDC3) Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/workspace-platform-starter/docs/how-to-setup-workspace-platform-starter.md Starts a third instance of the HERE Core UI Platform configured with an FDC3 App Directory and a light theme. ```shell npm run thirdclient ``` -------------------------------- ### Start Demonstration Application with Hidden Provider Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/integrate-server-authentication/README.md Launches the demonstration application using a preload script to run the hidden provider window. ```shell npm run secondclient ``` -------------------------------- ### Example Auth Module Configuration Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/workspace-platform-starter/docs/how-to-authenticate.md This JSON configuration defines an example authentication module. It specifies URLs for login, logout, and checking authentication status, along with parameters for controlling the login flow and session validation. ```json { "authProvider": { "modules": [ { "id": "example", "url": "http://localhost:8080/js/modules/auth/example.bundle.js", "data": { "autoLogin": false, "loginUrl": "http://localhost:8080/windows/modules/auth/example-login.html", "logoutUrl": "http://localhost:8080/windows/modules/auth/example-logged-out.html", "authenticatedUrl": "http://localhost:8080/windows/modules/auth/example-logged-in.html", "checkLoginStatusInSeconds": 1, "checkSessionValidityInSeconds": -1, "loginHeight": 250, "loginWidth": 400 } } ] } } ``` -------------------------------- ### Display Templates Example Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/customize-home-templates/README.md The '/templates' command demonstrates a template containing various fragment types that can be displayed in a home template. ```shell /templates ``` -------------------------------- ### Implement Command Search Results Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/workspace-platform-starter/docs/how-to-add-integrations-to-home.md Implement the 'getSearchResults' method to handle commands. This example creates a command that opens a URL when the query starts with '/open-site '. ```typescript public async getSearchResults(query: string, filters: CLIFilter[], lastResponse: HomeSearchListenerResponse): Promise { const results: HomeSearchResult[] = []; if (query.startsWith("/open-site ")) { const url = query.replace("/open-site ", ""); results.push({ key: randomUUID(), title: `Open Web Site`, label: "Information", actions: [ { name: "open", hotkey: "Enter" } ], data: { providerId: "my-integration", url }, template: CLITemplate.Custom, templateContent: { layout: { type: TemplateFragmentTypes.Text, dataKey: "url", style: { fontSize: "10px" } }), data: { url } } }); } return { results }; } ``` -------------------------------- ### Rebuild Client Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/register-with-home-basic/README.md Run this command if you modify the project and need to rebuild the client. Alternatively, you can run `npm run setup` again. ```shell npm run build-client ``` -------------------------------- ### Start Idle Detector and Listen for Changes Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/hints-and-tips/docs/visible-idle-detection.md Initialize and start the IdleDetector to listen for changes in user and screen states. Includes error handling for initialization issues. ```javascript function startListening(idleDetectorController) { try { const signal = idleDetectorController.signal; const idleDetector = new IdleDetector(); idleDetector.addEventListener('change', () => { const userState = idleDetector.userState; const screenState = idleDetector.screenState; console.log(`Idle change: ${userState}, ${screenState}.`); }); await idleDetector.start({ threshold: 60000, signal }); console.log('IdleDetector is active.'); } catch (err) { // Deal with initialization errors like permission denied, // running outside of top-level frame, etc. console.error(err.name, err.message); } } ``` -------------------------------- ### Run package-content script with default parameters Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/workspace-platform-starter/docs/how-to-deploy-your-platform.md Execute the packaging script using default settings, which typically starts from 'manifest.fin.json', outputs to 'packaged/local', and serves from 'http://localhost:8081'. ```shell npm run package-content ``` -------------------------------- ### HERE Application Launch Flow Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/hints-and-tips/docs/appassets-and-launch-external-process.md This diagram illustrates the process of launching a HERE application, including downloading app assets and starting the main application. ```mermaid graph TD subgraph Server index.html manifest.json exe.zip end subgraph PC Desktop.Shortcut -->|1. User clicks Shortcut| RVM OpenFin.Application AppData/Local/OpenFin/apps/YOUR_APP/assets/myApp/4.12.8 RVM -->|3. RVM reads appAsset and downloads exe.zip| AppData/Local/OpenFin/apps/YOUR_APP/assets/myApp/4.12.8 RVM --> |4. RVM reads runtime version, starting url and launches|OpenFin.Application manifest.json -->|2. RVM reads manifest via HTTPS| RVM exe.zip -->|HTTPS| RVM index.html -->|5. Runtime loads url via HTTPS and executes JavaScript| OpenFin.Application OpenFin.Application -->|6. Launch External Process launches myApp.exe| AppData/Local/OpenFin/apps/YOUR_APP/assets/myApp/4.12.8 ``` -------------------------------- ### Setup OpenFin Application Styles and Channel Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/workspace-platform-starter/public/platform/splash.html This JavaScript code configures the application's appearance and sets up an inter-application communication channel. It requires the OpenFin runtime to be available. ```javascript if (window.fin) { function setupStyle(style) { document.title = style.title; const iconElem = document.querySelector('#icon'); if (iconElem) { iconElem.src = style.icon; } const headingElem = document.querySelector('#heading'); if (headingElem) { headingElem.textContent = style.title; } if (style.backgroundColor) { document.body.style.backgroundColor = style.backgroundColor; } if (style.textColor) { if (headingElem) { headingElem.style.color = style.textColor; } const progressElem = document.querySelector('#progress'); if (progressElem) { progressElem.style.color = style.textColor; } const loaderElem = document.querySelector('#loader'); if (loaderElem) { loaderElem.style.color = style.textColor; } } if (style.borderColor) { const headerElem = document.querySelector('header'); if (headerElem) { headerElem.style.borderBottomColor = style.borderColor; } } } async function setupChannel(channelName) { if (channelName) { const channel = await fin.InterApplicationBus.Channel.connect(channelName); await channel.register('progress', (payload) => { const progress = document.querySelector('#progress'); if (progress) { progress.textContent = "Initializing ${payload.progress}..."; } }); } } (async () => { try { const options = await fin.me.getOptions(); setupStyle(options.customData.style); await setupChannel(options.customData.channelName); } catch (err) { console.error(err); } })(); } ``` -------------------------------- ### Rebuild Project Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/customize-home-templates/README.md Use this command to rebuild the project if you have made modifications. Alternatively, you can run 'npm run setup' again. ```shell npm run build ``` -------------------------------- ### Dispatch Action in C# Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/workspace-platform-starter/docs/how-to-manage-connections-to-your-platform.md Example of dispatching an 'action' to the connection service in C# to perform platform actions like showing the home screen. ```csharp public async void ShowHome() { await _connectionService.DispatchAsync("action", new ActionPayload { action = AvailableActions.ShowHome }); } ``` -------------------------------- ### OpenFin Manifest Configuration Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/workspace-platform-starter/docs/how-to-define-apps-fdc3-2-0.md Example of custom configuration values for OpenFin manifests, including settings for privacy, auto-start, instance mode, and launch preferences. ```json "config": { "private": false, "autoStart": false, "instanceMode": "multi", "launchPreference": { "bounds": { "height": 500, "width": 500 }, "defaultCentered": false, "options": { } } } ``` -------------------------------- ### Display Quote Example Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/customize-home-templates/README.md The '/quote' command demonstrates a dynamically built template with a graph image. Provide a stock symbol as an argument. ```shell /quote ``` ```shell /quote MSFT ``` ```shell /quote APPL ``` -------------------------------- ### Create notification using Channel API Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/workspace-platform-starter/client/src/modules/lifecycle/example-notification-service/README.md This example demonstrates creating a notification by connecting to the notification service channel and dispatching a 'create' command with notification options. ```javascript const client = await fin.InterApplicationBus.Channel.connect(`${fin.me.identity.uuid}/notification-service`); await client.dispatch('create', { type: 'openfin.notificationoptions', notification: { id: 'guid-goes-here', title: 'Example Launches App', body: 'Click the button to launch an app.', buttons: [ { onClick: { task: 'launch-app', customData: { id: 'call-app' } }, cta: true, title: 'Open Call App', type: 'button' } ] } }); // other dispatch commands: // - 'update' passing it the notification update context // - 'clear' passing it the notification context with the id of the notification you want to clear ``` -------------------------------- ### Configure System Permissions for Snap Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/integrate-with-snap/README.md Define necessary system permissions in your manifest, including 'launchExternalProcess' with specific asset rules and 'downloadAsset'. This example uses a restrictive permission model. ```json "permissions": { "System": { "launchExternalProcess": { "enabled": true, "assets": { "enabled": true, "srcRules": [ { "match": [ "https://cdn.openfin.co/release/snap/*" ], "behavior": "allow" }, { "match": [ "" ], "behavior": "block" } ] }, "downloads": { "enabled": false }, "executables": { "enabled": false } }, "downloadAsset": true } } ``` -------------------------------- ### Get Workspace and Client API Versions Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/hints-and-tips/docs/version-info.md Retrieves the running workspace version and the client API version used for registration. Requires importing the 'Home' module from '@openfin/workspace'. ```javascript import { Home } from '@openfin/workspace'; const homeRegistration = await Home.register(homeProvider); const runningWorkspaceVersion: string = homeRegistration.workspaceVersion; const workspaceClientAPIVersion: string = homeRegistration.clientAPIVersion; ``` -------------------------------- ### Run Remote Mocha Tests for Workspace Starter Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/automation-testing/README.md Execute remote Mocha tests against the hosted version of the register-with-home app. Ensure you are in the `register-with-home-js` directory and have installed dependencies. ```shell cd register-with-home-js npm install npm run test-remote-mocha ``` -------------------------------- ### Mock fin.System.getMonitorInfo in Jest Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/workspace-platform-starter/docs/how-to-test-your-platform-code.md Example of mocking the `fin.System.getMonitorInfo` method for testing purposes. This setup is placed in `setup.ts` and is executed before all tests. ```typescript Object.defineProperty(globalThis, 'fin', { value: { System: { getMonitorInfo: async () => ({ primaryMonitor: { monitorRect: PRIMARY_MONITOR_RECT }, nonPrimaryMonitors: [ { monitorRect: SECONDARY_MONITOR_RECT }, { monitorRect: TERTIARY_MONITOR_RECT } ] }) } } }); ``` -------------------------------- ### Get Current RVM Version Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/hints-and-tips/docs/version-info.md Retrieves the version of the Runtime Version Manager (RVM) currently in use. No specific setup is required. ```javascript const rvmInfo = await fin.System.getRvmInfo(); ``` -------------------------------- ### Start local app using fin:// protocol Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/workspace-platform-starter/docs/how-to-deploy-your-platform.md Launch the locally served application using the OpenFin protocol handler. Ensure the http-server is running and accessible at the specified address. ```shell start fin://localhost:8181/manifest.fin.json ``` -------------------------------- ### FDC3 2.0 App Definition Example Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/workspace-platform-starter/docs/how-to-define-apps-fdc3-2-0.md This is a comprehensive example of an FDC3 2.0 application definition in JSON format. It includes details for intents, user channels, and localized versions. ```json { "$schema": "./schemas/fdc3v2.0-appd.schema.json", "applications": [ { "appId": "fdc3-workbench-2-0", "name": "fdc3-workbench-2-0", "title": "FDC3 Workbench (2.0)", "description": "Development and test tool for FDC3 desktop agents and apps", "categories": ["developer tools", "tools", "training"], "version": "2.0.0", "tooltip": "FDC3 Workbench", "lang": "en-US", "icons": [ { "src": "https://fdc3.finos.org/toolbox/fdc3-workbench/fdc3-icon-256.png" } ], "screenshots": [ { "src": "https://fdc3.finos.org/docs/assets/fdc3-logo.png", "label": "FDC3 logo" } ], "contactEmail": "fdc3@finos.org,", "supportEmail": "fdc3-maintainers@finos.org,", "publisher": "FDC3", "type": "other", "details": {}, "hostManifests": { "HERE": { "type": "view", "details": "http://localhost:8080/common/views/fdc3/workbench/fdc3-workbench-2-0.view.fin.json" } }, "localizedVersions": { "fr-FR": { "title": "FDC3 Table de travail", "description": "Outil de développement et de test pour les desktop agents et applications FDC3" } }, "interop": { "intents": { "listensFor": { "ViewContact": { "displayName": "View Contact", "contexts": ["fdc3.contact", "fdc3.contactList"] }, "ViewInstrument": { "displayName": "View Instrument", "contexts": ["fdc3.instrument", "fdc3.instrumentList"] } } }, "userChannels": { "broadcasts": ["fdc3.instrument"], "listensFor": [ "fdc3.instrument", "fdc3.instrumentList", "fdc3.position", "fdc3.portfolio", "fdc3.chart", "fdc3.timeRange" ] }, "appChannels": [] } } ] } ``` -------------------------------- ### Display All Commands Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/customize-home-templates/README.md Use the '?' command to display a list of all available commands and their help information. ```shell ? - which displays a list of all the commands with help ``` -------------------------------- ### Example Notification Source Endpoint Provider Configuration Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/workspace-platform-starter/client/src/modules/endpoint/example-notification-source/README.md This JSON configuration defines the endpoint provider for an example notification source. It includes modules, endpoints for various notification actions, and client configurations to grant access to specific endpoints. ```json "endpointProvider": { "modules": [ { "id": "example-notification-source", "icon": "http://localhost:8080/favicon.ico", "title": "Example Notification Source", "description": "Example Notification Source", "enabled": true, "url": "http://localhost:8080/js/modules/endpoint/example-notification-source.bundle.js", "data": {} } ], "endpoints": [ { "id": "notification-source-create", "type": "module", "typeId": "example-notification-source", "options": {} }, { "id": "notification-source-clear", "type": "module", "typeId": "example-notification-source", "options": {} }, { "id": "notification-source-close", "type": "module", "typeId": "example-notification-source", "options": {} }, { "id": "notification-source-update", "type": "module", "typeId": "example-notification-source", "options": {} }, { "id": "notification-source-stream", "type": "module", "typeId": "example-notification-source", "options": {} } ], "endpointClients": { "clientOptions": [ { "enabled": true, "id": "example-notification-service", "endpointIds": ["notification-source-create", "notification-source-clear", "notification-source-close", "notification-source-update", "notification-source-stream"] } ] } } ``` -------------------------------- ### Basic Module Configuration Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/workspace-platform-starter/docs/how-to-add-a-module.md Illustrates the standard pattern for configuring modules within a provider section, showing an empty modules list. ```json "loggerProvider": { "modules": [ ] } ``` -------------------------------- ### Get All Pages Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/migrate-from-a-previous-version/README.md Retrieves all pages stored within the workspace. Requires the platform to be initialized. ```javascript import { getCurrentSync, Page } from '@openfin/workspace-platform'; export async function getPages() { let platform = getCurrentSync(); return platform.Storage.getPages(); } ``` -------------------------------- ### Initialize Workspace Platform Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/migrate-from-a-previous-version/README.md App initialization has changed from using `fin.Platform.init` to `workspacePlatformInit` from '@openfin/workspace-platform'. This is necessary for launching apps as it's now a platform responsibility. ```typescript import { fin } from 'openfin-adapter/src/mock'; export async function init() { console.log('Initializing platform'); await fin.Platform.init({}); } ``` ```typescript import { init as workspacePlatformInit, BrowserInitConfig } from '@openfin/workspace-platform'; export async function init() { console.log('Initializing platform'); let browser: BrowserInitConfig = {}; await workspacePlatformInit({ browser }); } ``` -------------------------------- ### Get Current Container Version Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/hints-and-tips/docs/version-info.md Fetches the version of the current OpenFin runtime container. This is a direct system call. ```javascript const runtimeVersion = await fin.System.getVersion(); ``` -------------------------------- ### Show Help Context Menu on Button Click (JavaScript) Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/workspace-platform-starter/public/common/panels/header-panel.html Adds a click event listener to a help button to show a specific context menu. This example uses the OpenFin API and defines a simple menu with 'Feedback' and 'About' options. ```javascript const btnHelp = document.querySelector('#btnHelp'); btnHelp.addEventListener('click', async (e) => { const view = fin.View.getCurrentSync(); const window = await view.getCurrentWindow(); await window.showPopupMenu({ template: [ { label: 'Feedback' }, { label: 'About' } ], x: btnHelp.offsetLeft + 40, y: btnHelp.offsetTop + 65 }); }); ``` -------------------------------- ### Configure App Directory URL Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/migrate-from-a-previous-version/README.md Instead of configuring 'appDirectoryUrl' through DesktopOwnerSettings, use the '@openfin/workspace' module to register your application against Home. This allows specifying functions for user input and result dispatch. ```javascript "appDirectoryUrl": "https://yourserver/api/apps" ``` -------------------------------- ### Get a Specific Page by ID Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/migrate-from-a-previous-version/README.md Retrieves a specific page from storage using its unique ID. Requires the platform to be initialized. ```javascript import { getCurrentSync, Page } from '@openfin/workspace-platform'; export async function getPage(pageId: string) { let platform = getCurrentSync(); return platform.Storage.getPage(pageId); } ``` -------------------------------- ### Initialize Workspace Platform with Custom Theme Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/migrate-from-a-previous-version/README.md Initialize the workspace platform with custom theme options, including labels, logo URLs, and color palettes. This is done during platform initialization. ```javascript import { init as workspacePlatformInit, CustomThemeOptions } from '@openfin/workspace-platform'; export async function init() { console.log('Initializing platform'); const theme: CustomThemeOptions[] = [ { label: 'Starter Theme', logoUrl: 'http://localhost:8080/favicon.ico', palette: { brandPrimary: '#0A76D3', brandSecondary: '#383A40', backgroundPrimary: '#111214' } } ]; await workspacePlatformInit({ theme }); } ``` -------------------------------- ### Provide Help Search Entries Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/workspace-platform-starter/docs/how-to-add-integrations-to-home.md Implement the `getHelpSearchEntries` method to provide help for commands. Adding `populateQuery` in the data object will auto-fill the home search query box. ```typescript public async getHelpSearchEntries?(): Promise { return [ { key: `open-site-help`, title: "/open-site", label: "Help", icon: "http://localhost:8080/favicon.ico, actions: [], data: { providerId: "my-integration", populateQuery: "/open-site" }, template: CLITemplate.Custom, templateContent: await createHelp( "/open-site", [ "Open a new window with the url specified." ], ["/open-site www.google.com"] ) } ]; } ``` -------------------------------- ### Create a Custom dos.json File Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/migrate-from-a-previous-version/README.md Define your desktop settings, including the workspace version, in a JSON file. ```javascript { "desktopSettings": { "systemApps": { "workspace": { "version": "3.0.0" } } } } ``` -------------------------------- ### Manifest Update: Filter ID Addition Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/migrate-from-a-previous-version/README.md Example showing the addition of an 'id' field to a CLIFilter object for better filter determination. ```typescript let tagFilter: CLIFilter = { id: 'tags', title: 'Tags', type: CLIFilterOptionType.MultiSelect, options: [] }; ``` -------------------------------- ### Rebuild HERE Core UI Platform Starter Modules Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/workspace-platform-starter/docs/how-to-setup-workspace-platform-starter.md Rebuilds the starter modules located in the client/src/modules directory. ```shell npm run build-starter-modules ``` -------------------------------- ### Module Entry Points Export Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/workspace-platform-starter/docs/how-to-add-a-module.md Example of exporting entry points for different module types from a module's index file. ```typescript export const entryPoints: { [type in ModuleTypes]?: ModuleImplementation } = { log: new ConsoleLogProvider() }; ``` -------------------------------- ### Run package-content script with custom parameters Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/workspace-platform-starter/docs/how-to-deploy-your-platform.md Execute the packaging script with custom parameters, specifying a different manifest file, environment, and host URL. ```shell npm run package-content --manifest=second.manifest.fin.json --env=uat --host=https://openfin.mydomain.com ``` -------------------------------- ### Automatically Show Components on Startup Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/workspace-platform-starter/docs/how-to-customize-the-bootstrapping-process.md Configure the 'autoShow' property within the 'bootstrap' settings to specify which components should be automatically displayed when the application starts. This overrides the default behavior of showing the first registered component. ```json "bootstrap": { ... "autoShow": ["home", "dock"] } ``` -------------------------------- ### Configure Version Provider Settings Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/workspace-platform-starter/docs/how-to-add-versioning-support.md Specify application version, minimum required versions, and a version check window URL. ```json { "versionProvider": { "appVersion": "1.0.0", "minimumVersion": { "workspace": "16.0.0" }, "maximumVersion": { }, "versionWindow": { "name": "versioning", "url": "http://localhost:8080/windows/version/version.html" } } } } ``` -------------------------------- ### Example Hidden Window Definition Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/workspace-platform-starter/docs/how-to-add-a-service.md This JSON configuration defines a hidden window for a headless application, ensuring it is not included in snapshots or automatically shown. ```json { "includeInSnapshots": false, "autoShow": false } ``` -------------------------------- ### Get OpenFin Version Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/workspace-platform-starter/public/common/panels/footer-panel.html Retrieves the current OpenFin runtime version and displays it on the page. Ensure an element with the ID 'version' exists in your HTML. ```javascript fin.System.getVersion().then((v) => (document.querySelector('#version').textContent = `Version: ${v}`)); ``` -------------------------------- ### Get Notification Center Versions Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/hints-and-tips/docs/version-info.md Retrieves the version of the running Notification Center and its API version. Requires importing specific modules from '@openfin/workspace/notifications'. ```javascript import { provider, VERSION } from '@openfin/workspace/notifications'; const providerStatus = await provider.getStatus(); const notificationCenterVersion = providerStatus.version; const notificationApiVersion = VERSION; ``` -------------------------------- ### Implement IntegrationModule Entry Points Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/workspace-platform-starter/docs/how-to-add-integrations-to-home.md Define the 'entryPoints' for your integration module, mapping module types to their implementations. This example shows how to register an 'integrations' provider. ```typescript export const entryPoints: { [type in ModuleTypes]?: ModuleImplementation } = { integrations: new MyIntegrationProvider() }; ``` -------------------------------- ### Listen for App Asset Download Event Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/workspace-platform-starter/docs/how-to-use-lifecycle-events.md This example shows how to subscribe to the 'app-asset-download' lifecycle event within a module's initialize function. It logs information about the download progress. Ensure 'helpers.subscribeLifecycleEvent' is available before calling. ```javascript import type { AppAssetDownloadLifecyclePayload } from "workspace-platform-starter/shapes/lifecycle-shapes"; // an example of code being called in the initialize function of a module if (helpers.subscribeLifecycleEvent) { await helpers.subscribeLifecycleEvent( "app-asset-download", async (platform, payload) => { this._logger?.info( `App Asset Download Lifecycle Event Received for appId: ${payload?.appId}, alias: ${payload?.alias}, state: ${payload?.state}, downloadPercent: ${payload?.downloadPercent}` ); } ); } ``` -------------------------------- ### Disconnect from Broker Service (C#) Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/workspace-platform-starter/docs/how-to-manage-connections-to-your-platform.md Example of how to dispatch a 'disconnect' call to the broker service using C#. This is typically used when a client is intentionally disconnecting from the platform. ```csharp await _connectionService.DispatchAsync("disconnect"); ``` -------------------------------- ### Module Configuration with Data Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/workspace-platform-starter/docs/how-to-add-a-module.md Demonstrates adding optional metadata and custom data to a module configuration, such as includeLevels for a logger. ```json "loggerProvider": { "modules": [ { "enabled": true, "id": "console", "url": "http://localhost:8080/js/modules/log/console.bundle.js", "data": { "includeLevels": ["error"] } } ] } ``` -------------------------------- ### Configure Custom Endpoint Provider Source: https://github.com/built-on-openfin/workspace-starter/blob/main/how-to/workspace-platform-starter/docs/how-to-customize-workspace-management.md Define custom endpoint modules and their configurations. This example shows how to set up a local storage module for workspace data operations. ```json "endpointProvider": { "modules": [ { "enabled": true, "id": "local-storage", "url": "http://localhost:8080/js/modules/endpoint/local-storage.bundle.js" } ], "endpoints": [ { "id": "workspace-list", "type": "module", "typeId": "local-storage", "options": { "method": "GET", "dataType": "workspace" } }, { "id": "workspace-get", "type": "module", "typeId": "local-storage", "options": { "method": "GET", "dataType": "workspace" } }, { "id": "workspace-set", "type": "module", "typeId": "local-storage", "options": { "method": "SET", "dataType": "workspace" } }, { "id": "workspace-remove", "type": "module", "typeId": "local-storage", "options": { "method": "REMOVE", "dataType": "workspace" } } ] }, ```