Using AdapTable in OpenFin

Summary

  • The OpenFin Plugin provides extra functionality for users when AdapTable is running in the OpenFin container

The OpenFin Plugin is intended for use when AdapTable is instantiated inside the OpenFin container.

Note

  • In June 2024 OpenFin was renamed as here
  • All existing functionality remains unchanged (but we are exploring new possibilities...)

This plugin allows users to take advantage of some additional functionality courtesy of OpenFin:

  • AdapTable's Alerts can appear as OpenFin Notifications (together with actionable buttons)
  • 'Live Excel' - where data exported to Excel updates in the spreadsheet in real time as the source data in AdapTable itself ticks

Installing OpenFin Plugin

Terminal
npm install @adaptabletools/adaptable-plugin-openfin

Caution

If using CommonJS, then install @adaptabletools/adaptable-plugin-openfin-cjs instead

AdapTable users who are also using OpenFin are able to benefit from additional features.

Note

This is provided via a dedicated OpenFin Plugin

OpenFin describes itself as:

the OS for Enterprise Productivity. We bring organizations together in a single, secure, and unified workspace. From the world’s largest banks to emerging startups around the world, OpenFin is being used by firms of all sizes to build beautiful desktop applications and custom end-user workspaces that drive productivity.

OpenFin also provides full FDC3 functionality which AdapTable works with seamlessly.

Configuring OpenFin Plugin

Setting up the OpenFin Plugin is similar to all other Plugins in AdapTable.

Developers supply details in the plugins section of Adaptable Options.

They use OpenFin Plugin Options to specify optional configuration settings for running the OpenFin Plugin.

Developer Guide

Setting Up the OpenFin Plugin

OpenFin Toolbar

The OpenFin Plugin makes a dedicated Toolbar called 'OpenFin' available.

This makes it possible to run Live Reports in Excel

The Toolbar can be referenced in Dashboard Initial State as follows:

const initialState: InitialState = {
  Dashboard: {
    Tabs: [
      {
        Name: 'Dashboard Toolbars',
        Toolbars: ['Layout', 'OpenFin', 'Export'],
      },
    ],
  },
};

Live Reports

One feature available when AdapTable is running in the OpenFin Plugin is Live Export via Excel.

This enables grid data to be sent from AdapTable to Excel with 2 way updates:

Note

Any Reports created in the Export Module will automatically appear in the OpenFin Toolbar

  • Excel will automatically update in line with cell edits and ticking data changes in AdapTable
  • Any date edits made directly in Excel will be automatically reflected in AdapTable

Hint

Live Reports can, like all Reports, be set to run on a Schedule.

To make this functionality available, specify the following in the app.json file:

"services": [
    { "name": "excel",
        "manifestUrl": "http://openfin.github.io/excel-api-example/provider/app.json"
    }
]

Validating Excel Changes

The Alerts Module in AdapTable enables custom Rules to be provided to perform validation after each Data Change in the Grid.

When running Live Reports these validation rules can be extended to edits made in Excel, by setting the onValidationFailureInExcel property in OpenFinPluginOptions.

This property can take one of 3 values:

  • override: automatically updates Excel with the previous value (i.e. before the edit was made)

  • show-notification: displays an OpenFin Notification explaining that the edit in Excel broke validation

  • show-undo-notification: displays an OpenFin Notification containing a button; when clicked AdapTable will override the edit in Excel with the previous cell value

OpenFin Notifications

AdapTable will automatically convert Alerts(set to show as Popup) into OpenFin Notifications.

Note

When this happens all Alert Buttons become OpenFin Notification Action Buttons

AdapTable will display the Alert as an OpenFin Notification (using the same message type).

Hint

Turn this off by setting showAdaptableAlertsAsNotifications to false in OpenFin Plugin Options

Managing Notifications

Two properties in OpenFinPluginOptions help to manage how OpenFin notifications will look and work:

  • notificationTimeout - when OpenFin notifications will expire after being displayed

  • showAppIconInNotifications - displays App Icon (supplied in User Interface Options) in the Notification

Most of the time AdapTable Alerts will appear seamlessly as OpenFin Notifications with no extra work required.

However 2 properties (both JavaScript functions) are available for when greater control over the look and feel or functionality of a Notification is required:

  • onNotificationAction - function invoked when a button in an OpenFin notification is clicked

  • onShowNotification - function which custom updates an OpenFin notification before it is displayed

AdapTable Alerts as OpenFin Notifications

(Recorded with AdapTable v18.1)

FDC3

OpenFin was a founder member of FDC3 and provides comprehensive FDC3 support.

This means that anyone using AdapTable with OpenFin can utilise AdapTable's FDC3 features.

UI Entitlements

OpenFin only works if it's Entitlement is set to Full and the plugin was correctly set up and installed.

Caution

The ReadOnly Entitlement behaviour is the same as if the Access Level was Hidden

FAQ

Do I need to use the OpenFin plugin to use FDC3 in OpenFin? No, if you only want to use FDC3 then AdapTable's comprehensive FDC3 features are all you require. Use the OpenFin Plugin if you also want features like Live Reports and OpenFin Notifications.