Data Sharing
Overview
The io.Connect Channels are globally accessed named contexts that allow users to dynamically group apps via the UI, instructing them to work over the same shared data object. Your apps can join, leave, subscribe and publish to Channels programmatically. Channels are also represented visually via the configurable Channel Selector app shown in the header area of an io.Connect Window. The Channel Selector allows users to join, leave or switch between Channels manually from the UI. Apps on the same Channel share a context data object which they can monitor and update.
The following demonstrates how apps interact with each other using the io.Connect Channels:
io.Connect Desktop supports directional Channels which allow for finer user control over whether an app should publish or subscribe to a Channel:
Channels are based on Shared Contexts. A context object may contain various types of data such as ids
, displayName
, and more:
{
"contact": {
"ids": [
{
"systemName": "sfId",
"nativeId": "0031r00002IukOxAAJ"
},
{
"systemName": "rest.id",
"nativeId": "0e23375b-dd4f-456a-b034-98ee879f0eff"
}
],
"displayName": "Nola Rios",
"name": {
"lastName": "Rios",
"firstName": "Nola",
"otherNames": null,
"honorific": "Ms.",
"postNominalLetters": null
}
}
}
Different apps on the same Channel may use different parts of the data:
- A "Client List" app may update the context object fields with data for the selected user.
- A "Client Portfolio" app may use the
ids
property to load the portfolio of the client selected by the user in the "Client List" app.
Defining Channels
To define any number of Channels in io.Connect Desktop to be used by your apps, modify the channels.json
file located in the %LocalAppData%/interop.io/io.Connect Desktop/Desktop/config
folder. The following example demonstrates adding a custom black Channel to the already existing default list of Channels in io.Connect Desktop:
{
"name": "Black",
"meta": {
"color": "black"
}
}
For more details on how to configure Channels, see the Developers > Configuration > Channels section.
For details on using Channels in FDC3 apps, see the FDC3 Compliance > Channels section.
Channel Selector
The Channel Selector enables users to manually assign Channels to their apps and also control the flow of data when using directional Channels. io.Connect Desktop supports different types of Channel Selectors with standard and directional Channels. Standard Channels allow apps to publish and subscribe for Channel data unrestrictedly. Directional Channels offer finer user control - besides selecting a Channel for the app, the user can restrict the app from publishing or subscribing to that Channel, depending on the desired direction for the data flow. The Channel Selector is configurable on a global level and per app.
Types
Available since io.Connect Desktop 9.3
The type of the Channel Selector to be used by the io.Connect Windows can be configured globally and per app.
Single
The single Channel Selector is the default one and it allows users to select a single Channel for the window. The window will be able to subscribe and publish to that Channel unrestrictedly:
Directional Single
The directional single Channel Selector allows users to select a single Channel for the window, but also enables them to instruct the window only to publish or subscribe to the selected Channel:
Multi
Available since io.Connect Desktop 9.7
The multi Channel Selector allows users to select multiple Channels for the window. The window will be able to subscribe and publish to the selected Channels simultaneously and unrestrictedly:
⚠️ Note that this functionality is still experimental and you should take into consideration the following:
- There may be hidden bugs.
- Currently, there is only JavaScript API for working with multiple Channels.
- There isn't backwards compatibility between the versions of the
@interopio/desktop
library that support only single Channels and the ones that support both single and multiple Channels. If you want to use multiple Channels, all apps using Channels must be upgraded to the latest version of the@interopio/desktop
library.- Currently, directional Channels aren't supported in multi Channel mode.
- Supplementary methods for working with multiple Channels have been added to the io.Connect JavaScript FDC3 implementation. These methods are specific io.Connect implementations and are outside the scope of the FDC3 standard. Their purpose is to enable working with multiple Channels in FDC3 apps.
Configuration
You can configure the Channel Selector globally via the system.json
system configuration file of io.Connect Desktop located in the %LocalAppData%/interop.io/io.Connect Desktop/Desktop/config
folder, and per app via the app definition. The settings in the app definition will override the global system settings.
Available since io.Connect Desktop 9.3
To configure the Channel Selector globally, use the "channelSelector"
property of the "windows"
top-level key in the system.json
file:
{
"windows": {
"channelSelector": {
"enabled": true,
"type": "directionalSingle"
}
}
}
To configure the Channel Selector per app, use the "channelSelector"
property of the "details"
top-level key in the app definition:
{
"details": {
"channelSelector": {
"enabled": true,
"type": "single",
"channelId": "Black"
}
}
}
The "channelSelector"
object has the following properties:
Property | Type | Description |
---|---|---|
"enabled" |
boolean |
If true , will allow showing the Channel Selector. Defaults to false . |
"channelId" |
string |
Name of the Channel to which the window will be joined by default when it's started. |
"readOnly" |
boolean |
If true , the Channel Selector will be visible, but the user won't be able to switch between Channels from it. Defaults to false . |
"type" |
"single" | "directionalSingle" | "multi" |
Type of the Channel Selector to show on the io.Connect Windows. - "single" (default) - allows the window to join a single Channel to which it can subscribe and publish data unrestrictedly; - "directionalSingle" - allows the window to join a single Channel, but also enables the user to restrict the window from publishing or from subscribing to the current Channel; - "multi" - allows the window to join multiple Channels simultaneously; Available since io.Connect Desktop 9.7. |
For more details on how to configure the Channel Selector globally and per app, see the Developers > Configuration > System > Window Settings > Channels and the Developers > Configuration > Application > Channels sections.