### Install and Start All Solution React Applications
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/react/index
Execute these commands from the main `/react/solution` directory to install all necessary Node.js dependencies for the entire solution project and then simultaneously launch all solution applications. This provides a quick way to get the complete pre-built project up and running.
```npm
npm install
npm run start
```
--------------------------------
### Install and Run io.Connect Desktop Example Applications
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/tutorials/javascript/index
These commands are executed in the `/start` directory to install all necessary Node.js dependencies and then launch separate local servers for each of the example io.Connect Desktop applications (Clients, Stocks, Client Details, Portfolio Downloader).
```Shell
npm install
npm start
```
--------------------------------
### Install and Run io.Connect Desktop Start Apps
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/javascript/index
This command sequence installs project dependencies and launches local servers for the io.Connect Desktop start applications (Clients, Stocks, Client Details, Workspaces App, Portfolio Downloader), making them accessible via specified localhost URLs.
```Shell
npm install
npm start
```
--------------------------------
### Install and Start the Project REST Server
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/react/index
Navigate to the `/rest-server` directory and run these commands to install the required Node.js dependencies and start the REST server. This server provides the necessary data for the client applications and typically runs on port 8080.
```npm
npm install
npm start
```
--------------------------------
### Install and Start Individual React Client Applications
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/react/index
Execute these commands within each React client application's directory (e.g., Clients, Stocks, Stock Details, Portfolio Downloader, Workspaces App) to install project dependencies and launch the development server. This prepares each application for standalone development and testing.
```npm
npm install
npm start
```
--------------------------------
### Install and Run io.Connect Desktop Solution Apps
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/javascript/index
This command sequence installs dependencies and runs the io.Connect Desktop solution project, allowing access to the Clients app entry point at http://localhost:9000/.
```Shell
npm install
npm start
```
--------------------------------
### Install io.Connect React Dependencies
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/react/index
Install required npm packages for the React app, including `@interopio/react-hooks` and `bootstrap`. Run this command in the root directory of your app.
```Bash
npm install --save @interopio/react-hooks bootstrap@4.4.1
```
--------------------------------
### Install IO Connect Workspaces API Library
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/react/index
This command-line snippet demonstrates how to install the @interopio/workspaces-api library using npm, saving it as a dependency in the project.
```bash
npm install --save @interopio/workspaces-api
```
--------------------------------
### Install Dependencies for Solution React Applications
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/react/index
Run this command in the directories of the solution React applications (e.g., clients, client-details, stocks, stock-details, workspace) to install their respective Node.js dependencies. This step is necessary to prepare the pre-built solution files for execution.
```npm
npm install
```
--------------------------------
### Install and Run Angular Applications
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/angular/index
This command sequence installs all necessary Node.js dependencies for an Angular application and then starts the development server, making the application accessible via a local URL. It's used for both the Clients and Stocks apps.
```npm
npm install
npm start
```
--------------------------------
### Install io.Connect Browser Platform Library
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/react/index
Installs the `@interopio/browser-platform` library. This crucial library is responsible for managing the entire io.Connect environment, enabling Browser Client apps to connect to the Main app and facilitate inter-application communication.
```npm
npm install --save @interopio/browser-platform
```
--------------------------------
### Initialize io.Connect .NET Library for .NET 5+
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/getting-started/how-to/interop-enable-your-apps/net/index
Example demonstrating asynchronous initialization of the io.Connect .NET library for .NET 5+, including how to specify `InitializeOptions` for application name and included features. Initialization options are optional; if skipped, default settings are used.
```C#
var options = new InitializeOptions()
{
ApplicationName = "my-app",
IncludedFeatures = GDFeatures.UseAppManager | GDFeatures.UseGlueWindows
};
// The initialization options aren't required.
// If skipped, the library will be initialized with the default options
// (default assembly name for `ApplicationName` and with all features included).
Glue42 io = await Glue42.InitializeGlue(options);
```
--------------------------------
### Install and Run REST Server
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/angular/index
This command sequence installs Node.js dependencies for the REST server and then starts it, making it available on port 8080 to host data for the applications.
```npm
npm install
npm start
```
--------------------------------
### Install and Start io.Connect Desktop Tutorial Solution Applications
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/tutorials/javascript/index
These commands install the required Node.js dependencies for the io.Connect Desktop tutorial solution applications and then launch separate local servers for each application. This allows access to the tutorial apps via the io.Connect launcher.
```Shell
npm install
npm start
```
--------------------------------
### Start React Development Server
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/react/index
Command to start the React development server for your application. Run this from the app's root directory.
```Bash
npm start
```
--------------------------------
### Install io.Connect React Hooks Library
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/react/index
Installs the `@interopio/react-hooks` library into the Clients app. This library provides essential React hooks for interacting with io.Connect APIs, simplifying state management and event handling within React components.
```npm
npm install --save @interopio/react-hooks
```
--------------------------------
### Reference io.Connect Browser Platform Library in Main App HTML
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/getting-started/quick-start/index
This snippet shows how to include the `@interopio/browser-platform` library and the application's `index.js` file in the `index.html` for the Main app. It uses the unpkg CDN for the library to quickly get started.
```HTML
```
--------------------------------
### Initialize io.Connect .NET Library for .NET Standard
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/getting-started/how-to/interop-enable-your-apps/net/index
This C# example demonstrates how to initialize the io.Connect .NET library for .NET Standard applications. It shows how to configure `InitializeOptions` to specify the application name and include desired features like `UseAppManager` and `UseGlueWindows`.
```C#
var initializeOptions = new InitializeOptions()
{
ApplicationName = "my-app",
IncludedFeatures = GDFeatures.UseAppManager | GDFeatures.UseGlueWindows
};
// The initialization options aren't required.
// If skipped, the library will be initialized with the default options
// (default assembly name for `ApplicationName` and with all features included).
Glue42Base io = await Glue42Base.InitializeGlue(initializeOptions);
```
--------------------------------
### Example JSON Configuration for Installer Startup Extensibility Point
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/getting-started/how-to/rebrand-io-connect/installer/index
Demonstrates how to configure custom license, logo, and banner files using the 'startup' extensibility point in the io.Connect Desktop installer.
```JSON
{
"startup": [
// Use a predefined license file.
{
"type": "license",
"args": {
// Either a path or a URL.
"file": "license.json"
}
},
// Logo to display in the top-left corner.
{
"type": "logo",
"args": {
// Either a path or a URL.
"url": "https://example.com/logo.png",
// URL to open when the user clicks on the logo.
"onClick": "https://example.com"
}
},
// Banner during installation.
{
"type": "banner",
"args": {
// Either a path or a URL.
"file": "banner.png",
// URL to open when the user clicks on the banner.
"onClick": "https://example.com"
}
}
]
}
```
--------------------------------
### APIDOC: Application.start() Method
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/react/index
Starts a new instance of the application. An optional context object can be passed to initialize the new instance with specific data.
```APIDOC
Application.start(context?: object): Promise
```
--------------------------------
### Reference io.Connect Browser Library in Browser Client HTML
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/getting-started/quick-start/index
This snippet shows how to include the `@interopio/browser` library and the application's `index.js` file in the `index.html` for the Browser Client app. It uses the unpkg CDN for the library to quickly get started.
```HTML
```
--------------------------------
### Start Stocks App with Channel Context (Clients App)
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/javascript/index
Demonstrates how to get the 'Stocks' application object and start it, passing the current channel as context. This replaces previous Window Management API usage.
```javascript
// In `stocksButtonHandler()`.
const stocksApp = io.appManager.application("Stocks")
const currentChannel = io.channels.my();
stocksApp.start({ channel: currentChannel }).catch(console.error);
```
--------------------------------
### Install and Start io.Connect Desktop Tutorial REST Server
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/tutorials/javascript/index
These commands install the necessary Node.js dependencies for the REST server and then launch it. The server provides the required data for the io.Connect Desktop tutorial applications and runs on port 8080.
```Shell
npm install
npm start
```
--------------------------------
### Configure io.Connect Platform with Workspace Layouts Plugin
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/javascript/index
This JavaScript snippet demonstrates how to extend the io.Connect Browser Platform configuration to include a plugin responsible for setting up Workspace Layouts. It defines a 'plugins' object with an array of 'definitions', adding a new entry for 'Setup Workspace Layouts' that fetches layouts from a specified URL. This setup is crucial for dynamically loading Workspace blueprints into the application.
```JavaScript
// In `start()`.
const plugins = {
definitions: [
{
name: "Setup Applications",
config: { url: "http://localhost:8080/api/applications"},
start: setupApplications,
critical: true
},
{
name: "Setup Workspace Layouts",
config: { url: "http://localhost:8080/api/layouts"},
start: setupLayouts,
critical: true
}
]
};
const config = {
licenseKey: "my-license-key",
channels,
plugins
};
const { io } = await IOBrowserPlatform(config);
window.io = io;
```
--------------------------------
### Define io.Connect .NET Application in JSON
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/getting-started/how-to/interop-enable-your-apps/net/index
This JSON snippet illustrates an example application definition file for a .NET app to be registered with the io.Connect launcher. It specifies required properties such as `title`, `type` (must be 'exe'), `name`, and `details` including `path`, `command`, and optional `parameters`.
```JSON
{
"title": "My .NET App",
"type": "exe",
"name": "my-net-app",
"details": {
"path": "%GDDIR%/../Demos/MyNETApp/",
"command": "MyNETApp.exe",
"parameters": " --mode=1"
}
}
```
--------------------------------
### Install io.Connect React Hooks Library
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/react/index
This command installs the `@interopio/react-hooks` library, a dependency required for integrating io.Connect functionalities into React applications. It saves the package to the project's `package.json` file.
```npm
npm install --save @interopio/react-hooks
```
--------------------------------
### Start io.Connect Desktop REST Server
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/javascript/index
This command sequence installs dependencies and launches the REST server required to host data for the io.Connect Desktop applications, making it available on port 8080.
```Shell
npm install
npm start
```
--------------------------------
### Configure Welcome Extensibility Point to Run a Script
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/getting-started/how-to/rebrand-io-connect/installer/index
Example JSON configuration for the 'welcome' extensibility point, demonstrating how to use a 'run' item to execute an external script (e.g., 'copy-resources.bat') during the installation process. It includes options for hiding the process, handling custom exit codes, and controlling installer visibility.
```JSON
{
"welcome": [
{
// Depending on your purpose, you may run scripts here,
// or after the installation, in the "done" extensibility point.
"type": "run",
"args": {
// Name of the program to run.
"filename": "cmd.exe",
// Command line arguments for the program execution.
"args": "/c copy-resources.bat",
// By default, "exitCode0" is success, while any other is an error message, followed by the installer exiting.
// You can override any code with "success" for success and any other string for an error message.
// Error messages aren't shown during unattended or hidden installations to avoid stalling.
"exitCode1": "Error validating the installation.",
"exitCode2": "Error contacting server.",
"exitCode3": "success",
//Other exit codes.
// Hide the started process.
"hide": true,
// Don't hide the installer while the process is running.
"hideInstaller": false
}
}
]
// Other screens: "downloadProgress", "packages", "previewAndConfirm", "uninstall".
}
```
--------------------------------
### Setup Channel Functionality in Stocks App
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/react/index
This code block shows the setup for channel functionalities within the Stocks React component. It imports channel management functions and defines additional state variables and a `setDefaultClient` callback specific to the Stocks app, preparing it for channel interaction and managing the default client state.
```JavaScript
import {
getChannelNamesAndColors,
joinChannel
} from "./io-connect";
function Stocks() {
...
const channelNamesAndColors = useIOConnect(getChannelNamesAndColors);
const onChannelSelected = useIOConnect(joinChannel);
const setDefaultClient = () => setClient({ clientId: "", clientName: "" });
const [channelWidgetState, setChannelWidgetState] = useState(false);
...
};
```
--------------------------------
### Reference io.Connect .NET DLL for .NET 5+
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/getting-started/how-to/interop-enable-your-apps/net/index
Demonstrates how to reference the GlueNetCore.dll library file for .NET 5+ projects by specifying its hint path in a project file.
```XML
..\lib\GlueNetCore.dll
```
--------------------------------
### io.Connect .NET Library Core API
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/getting-started/how-to/interop-enable-your-apps/net/index
API documentation for the core classes and methods used to initialize and access io.Connect functionalities in .NET applications.
```APIDOC
Class: Glue42
Description: The main class for accessing io.Connect functionalities in .NET 5+ and .NET Framework applications.
Method: InitializeGlue(options: InitializeOptions)
Description: Asynchronously initializes the io.Connect library.
Parameters:
options: InitializeOptions (optional)
Description: An object to specify various settings and io.Connect features for the application.
Returns: Task
Class: Glue42Base
Description: The main class for accessing io.Connect functionalities in .NET Standard applications.
Method: InitializeGlue(options: InitializeOptions)
Description: Asynchronously initializes the io.Connect library.
Parameters:
options: InitializeOptions (optional)
Description: An object to specify various settings and io.Connect features for the application.
Returns: Task
Class: InitializeOptions
Description: Configuration options for initializing the io.Connect library.
Properties:
ApplicationName: string
Description: The name of the application.
IncludedFeatures: GDFeatures (flags enum)
Description: Flags indicating which io.Connect features (e.g., UseAppManager, UseGlueWindows) to enable.
```
--------------------------------
### Install io.Connect Browser Platform Library for JavaScript
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/developers/browser-platform/setup/index
Install the core io.Connect Browser Platform library using npm for JavaScript projects. This library is essential for setting up the Main application.
```npm
npm install @interopio/browser-platform
```
--------------------------------
### Initialize io.Connect .NET Library for ClickOnce Apps
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/getting-started/how-to/interop-enable-your-apps/net/index
This C# example demonstrates the initialization of the io.Connect .NET library within a ClickOnce application. It uses `InitializeOptions` to set the application name and include specific features, similar to other .NET app initializations.
```C#
var initializeOptions = new InitializeOptions()
{
ApplicationName = "ClientProfileDemo",
IncludedFeatures = GDFeatures.UseAppManager | GDFeatures.UseGlueWindows
};
// The initialization options aren't required.
// If skipped, the library will be initialized with the default options
// (default assembly name for `ApplicationName` and with all features included).
Glue42 io = await Glue42.InitializeGlue(initializeOptions);
```
--------------------------------
### Reference io.Connect .NET DLL for .NET Framework
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/getting-started/how-to/interop-enable-your-apps/net/index
Demonstrates how to reference the ioConnectNET.dll library file for .NET Framework projects by specifying its hint path in a project file.
```XML
..\lib\ioConnectNET.dll
```
--------------------------------
### Launch io.Connect Desktop with Command Line Arguments After Installation
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/getting-started/how-to/rebrand-io-connect/installer/index
This configuration shows how to automatically start io.Connect Desktop after installation and pass specific command line arguments. It utilizes both the "context" extensibility point to set the arguments and the "done" extensibility point to trigger the launch.
```JSON
{
"context": [
{
"type": "setValue",
"args": {
"name": "LaunchGDArgs",
"value": "command-line-arguments"
}
}
],
"done": [
"launchGD"
]
}
```
--------------------------------
### Setup Channel Functionality in Clients App
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/react/index
This snippet illustrates how to set up channel functionalities within the Clients React component. It imports necessary constants and channel management functions, then uses the `useIOConnect` hook to integrate `getChannelNamesAndColors` and `joinChannel`, preparing the component for interactive channel management.
```JavaScript
import { NO_CHANNEL_VALUE } from "./constants";
import {
getChannelNamesAndColors,
joinChannel
} from "./io-connect";
function Clients() {
...
const channelNamesAndColors = useIOConnect(getChannelNamesAndColors);
const onChannelSelected = useIOConnect(joinChannel);
...
};
```
--------------------------------
### Configure io.Connect Desktop Installer Shortcuts
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/getting-started/how-to/rebrand-io-connect/installer/index
Demonstrates how to use the 'shortcuts' extensibility point to create desktop and Start Menu shortcuts for io.Connect Desktop with specific command-line arguments for different environments (DEV, UAT) and a shortcut to an external website. It also shows how to specify custom icons and descriptions.
```JSON
{
"shortcuts": [
{
"type": "shortcut",
"args": {
"artifact": "Desktop",
"icon": "copy:icon.ico",
"filename": "My Custom Product DEV",
"desktop": true,
"startMenu": true,
"description": "Start My Custom Product in DEV environment.",
"targetArguments": "-- config=config/system.json configOverrides config0=config/system-override-DEV.json"
}
},
{
"type": "shortcut",
"args": {
"artifact": "Desktop",
"icon": "copy:icon.ico",
"filename": "My Custom Product UAT",
"desktop": true,
"startMenu": true,
"description": "Start My Custom Product in UAT environment.",
"targetArguments": "-- config=config/system.json configOverrides config0=config/system-override-UAT.json"
}
},
{
"type": "shortcut",
"args": {
"target": "https://interop.io",
"filename": "interop.io Official Site",
"description": "Open the interop.io official site",
"icon": "io.Connect Desktop/Desktop/assets/images/logo.ico",
"startMenu": false,
"desktop": true
}
}
]
}
```
--------------------------------
### Example ProxyLoggingFacade Implementation for io.Connect .NET in C#
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/getting-started/how-to/interop-enable-your-apps/net/index
This comprehensive example provides a full implementation of a ProxyLoggingFacade using the standard log4net library. It includes methods for retrieving loggers, managing log folders and file names, and an inner DotLog class that adapts log4net's logging functionality to the IDotLog interface required by io.Connect.
```C#
public class ProxyLoggingFacade : IDotLoggingFacade
{
public IDotLog GetLogger(string loggerName)
{
return new DotLog(loggerName);
}
public List GetLogFolders()
{
// ensure repo is initialized
var logger = GetLogger(GetType().FullName);
var fileAppenders = GetFileAppenders();
var dirs = new HashSet(fileAppenders.Select(fa => Path.GetDirectoryName(fa.File)));
return dirs.ToList();
}
public List GetLogFileNames()
{
// ensure repo is initialized
var logger = GetLogger(GetType().FullName);
var fileAppenders = GetFileAppenders();
var files = new HashSet(fileAppenders.Select(fa => fa.File));
return files.ToList();
}
private static IEnumerable GetFileAppenders()
{
var repository = LogManager.GetRepository();
var fileAppenders =
repository.GetAppenders().Where(iAppender => iAppender is FileAppender).Cast();
return fileAppenders;
}
private class DotLog : IDotLog
{
static DotLog()
{
DeclaringType = typeof(DotLog);
}
public DotLog(string loggerName)
{
Log4NetLogger = LogManager.GetLogger(loggerName);
}
internal DotLog(ILog log4NetLogger)
{
Log4NetLogger = log4NetLogger;
}
private static Type DeclaringType { get; }
private ILog Log4NetLogger { get; }
public bool IsEnabled(DotLogLevel logLevel)
{
return Log4NetLogger.Logger.IsEnabledFor(GetLevel(logLevel));
}
public void Log(DotLogLevel logLevel, object message)
{
Log4NetLogger.Logger.Log(DeclaringType, GetLevel(logLevel), message, null);
}
public void Log(
DotLogLevel logLevel,
object message,
Exception exception)
{
Log4NetLogger.Logger.Log(DeclaringType, GetLevel(logLevel), message, exception);
}
public void FlushBuffers()
{
ILoggerRepository rep = LogManager.GetRepository();
foreach (IAppender appender in rep.GetAppenders())
{
if (appender is BufferingAppenderSkeleton buffered)
{
buffered.Flush();
}
}
}
public bool IsTraceEnabled => Log4NetLogger.Logger.IsEnabledFor(Level.Trace);
public bool IsDebugEnabled => Log4NetLogger.IsDebugEnabled;
public bool IsInfoEnabled => Log4NetLogger.IsInfoEnabled;
public bool IsWarnEnabled => Log4NetLogger.IsWarnEnabled;
public bool IsErrorEnabled => Log4NetLogger.IsErrorEnabled;
public bool IsFatalEnabled => Log4NetLogger.IsFatalEnabled;
public DotLogLevel SetLogLevel(DotLogLevel logLevel)
{
var logger = (Logger)Log4NetLogger.Logger;
var oldLevel = logger.Level;
logger.Level = GetLevel(logLevel);
return GetLevel(oldLevel);
}
private static DotLogLevel GetLevel(Level logLevel)
{
if (logLevel == Level.All)
{
return DotLogLevel.All;
}
if (logLevel == Level.Trace)
{
return DotLogLevel.Trace;
}
if (logLevel == Level.Debug)
{
return DotLogLevel.Debug;
}
if (logLevel == Level.Info)
{
return DotLogLevel.Info;
}
if (logLevel == Level.Warn)
{
return DotLogLevel.Warn;
}
if (logLevel == Level.Error)
{
return DotLogLevel.Error;
}
if (logLevel == Level.Fatal)
{
return DotLogLevel.Fatal;
}
return DotLogLevel.Off;
}
private static Level GetLevel(DotLogLevel logLevel)
{
switch (logLevel)
{
case DotLogLevel.All:
return Level.All;
case DotLogLevel.Trace:
return Level.Trace;
case DotLogLevel.Debug:
return Level.Debug;
case DotLogLevel.Info:
return Level.Info;
case DotLogLevel.Warn:
return Level.Warn;
case DotLogLevel.Error:
return Level.Error;
case DotLogLevel.Fatal:
return Level.Fatal;
case DotLogLevel.Off:
return Level.Off;
default:
return Level.Off;
}
}
}
}
```
--------------------------------
### Configure Plugins for Applications and Workspace Layouts
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/react/index
This JavaScript snippet demonstrates how to define plugins for an IO Connect application. It includes configurations for fetching application definitions and workspace layouts from specified URLs, marking them as critical for application startup.
```javascript
import { setupLayouts } from "./plugins/layoutsPlugin";
const plugins = {
definitions: [
{
name: "Setup Applications",
config: { url: "http://localhost:8080/api/applicationsReact"},
start: setupApplications,
critical: true
},
{
name: "Setup Workspace Layouts",
config: { url: "http://localhost:8080/api/layouts"},
start: setupLayouts,
critical: true
}
]
};
const config = { plugins };
```
--------------------------------
### Customize IO Connect Home App Setup Flow with React Components
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/capabilities/home-app/library-features/index
This example illustrates how to provide a custom logo for the first-time user setup flow page in the IO Connect Home App. It demonstrates using the `setupFlow` property within the main configuration object to specify custom components, enhancing the initial user experience.
```javascript
import { IOConnectHome } from "@interopio/home-ui-react";
import "@interopio/workspaces-ui-react/dist/styles/workspaces.css";
import "@interopio/home-ui-react/src/index.css";
import logo from "./logo.png";
const getConfig = (user) => {
// Define and return the required platform configuration.
};
const config = {
getIOConnectConfig: getConfig,
// Setup flow settings.
setupFlow: {
// Custom logo for the setup flow page.
components: {
Logo: () =>
}
}
};
const App = () => {
return
};
export default App;
```
--------------------------------
### GetStartingContext
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/getting-started/how-to/interop-enable-your-apps/delphi/index
Gets the starting context for the app.
```APIDOC
GetStartingContext() -> GlueValue
Gets the starting context for the app.
Parameters: None
Return value: GlueValue - A GlueValue containing the starting context for the app.
```
--------------------------------
### Manage Stock Details App Instances (Stock Click Handler)
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/javascript/index
Demonstrates how to check if an instance of the 'Stock Details' app for a specific stock is already running by iterating through existing instance contexts. If not, a new instance is started with the stock as context.
```javascript
// In `stockClickedHandler()`.
const detailsApplication = io.appManager.application("Stock Details");
// Check whether an instance with the selected stock is already running.
const contexts = await Promise.all(
// Use the `instances` property to get all running app instances.
detailsApplication.instances.map(instance => instance.getContext())
);
const isRunning = contexts.find(context => context.RIC === stock.RIC);
if (!isRunning) {
// Start the app and pass the `stock` as context.
detailsApplication.start(stock).catch(console.error);
};
```
--------------------------------
### Create New React Application
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/react/index
Command to initialize a new React application using `create-react-app`. Replace `my-app` with your desired application name.
```Bash
npx create-react-app my-app
```
--------------------------------
### APIDOC: @interopio/browser-platform Plugin Configuration
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/react/index
Defines the structure for configuring plugins within the `@interopio/browser-platform` library. Plugins allow custom logic to be executed during the platform's initialization phase.
```APIDOC
browserPlatform.config.plugins: {
definitions: PluginDefinition[];
}
PluginDefinition: {
name: string; // A unique name for the plugin.
config?: object; // Optional configuration object passed to the plugin's start function.
start: Function; // The function to execute when the plugin starts.
critical?: boolean; // If true, the platform waits for the plugin to complete before initialization.
}
```
--------------------------------
### Receive and Join Channel (Stocks App)
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/javascript/index
Shows how the 'Stocks' app retrieves its context upon startup to get the channel to join, then programmatically joins it.
```javascript
// In `start()`.
const appContext = await io.appManager.myInstance.getContext();
const channelToJoin = appContext.channel;
if (channelToJoin) {
await io.channels.join(channelToJoin);
};
```
--------------------------------
### IO Connect Interop API Reference
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/react/index
This section provides a summary of key Interop methods used for inter-application communication within IO Connect Desktop.
```APIDOC
io.interop.register(methodName: string, handler: Function)
- methodName: The name to register the Interop method under.
- handler: A callback function that will be invoked when the method is called.
io.interop.createStream(streamName: string)
- streamName: The name to register the Interop stream under.
- Returns: A Promise that resolves to the created Stream object.
io.interop.methods()
- Returns: An array of objects, each representing a registered Interop method, containing properties like 'name'.
```
--------------------------------
### Configure System Folder Locations for Extensible Installer (JSON)
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/getting-started/changelog/9-4/index
Illustrates how to set the 'Desktop' and 'Start Menu' folder locations for the io.Connect Desktop installer using the 'context' extensibility point in the extensibility configuration file. This is useful for repackaging the installer.
```JSON
{
"context": [
{
"type": "setValue",
"args": {
"name": "DesktopFolder",
"value": "%Public%/Desktop"
}
},
{
"type": "setValue",
"args": {
"name": "StartMenuFolder",
"value": "%ProgramData%/Microsoft/Windows/Start Menu/Programs/io.Connect Desktop"
}
}
]
}
```
--------------------------------
### Configure Applications with IO Connect App Management API
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/react/index
This JavaScript snippet demonstrates how to define application configurations using the "applications" property within the "IOBrowserPlatform" settings. It includes examples for 'Clients', 'Stocks', 'Stock Details', and 'Client Details' apps, specifying their names, types, URLs, and optional window dimensions, thereby centralizing app definitions and enabling decoupled app launching.
```javascript
// App definitions.
const applications = {
local: [
{
name: "Clients",
type: "window",
details: {
url: "http://localhost:3000/clients"
}
},
{
name: "Stocks",
type: "window",
details: {
url: "http://localhost:3001/stocks",
left: 0,
top: 0,
width: 860,
height: 600
}
},
{
name: "Stock Details",
type: "window",
details: {
url: "http://localhost:3002/details",
left: 100,
top: 100,
width: 400,
height: 400
}
},
{
name: "Client Details",
type: "window",
details: {
url: "http://localhost:3003/client-details"
}
}
]
};
const config = { channels, applications };
const settings = {
browserPlatform: {
factory: IOBrowserPlatform,
config
}
};
const domElement = document.getElementById("root");
const root = createRoot(domElement);
root.render(
);
```
--------------------------------
### Define Custom Shortcut for Installer
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/getting-started/how-to/rebrand-io-connect/installer/index
Configure the 'shortcuts' extensibility point to create a custom shortcut during installation. This example creates a desktop shortcut to the interop.io official site, using a custom icon and preventing its addition to the Windows 'Start Menu'.
```json
{
"shortcuts": [
{
"type": "shortcut",
"args": {
"target": "https://interop.io",
"filename": "interop.io Official Site",
"description": "Open the interop.io official site",
"icon": "io.Connect Desktop/Desktop/assets/images/icon.ico",
"startMenu": false,
"desktop": true
}
}
]
}
```
--------------------------------
### io.Connect Desktop: Get Instance Start Information
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/reference/javascript/app management/index
Documents the `startedBy` method, which provides details about how the current io.Connect Desktop app instance was initiated and by whom. Available since io.Connect Desktop 9.3.
```APIDOC
Method: startedBy
Signature: () => Promise<[StartedByInfo](../app%20management/index.html#StartedByInfo)>
Description: Retrieves information about how the current app instance was started, and about the identity of the initiator. Available since io.Connect Desktop 9.3
```
--------------------------------
### Reference io.Connect Installer Extensibility Points and Items
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/getting-started/how-to/rebrand-io-connect/installer/index
This API documentation outlines the available extensibility points within the io.Connect installer and the specific extensibility items applicable to each. Each point represents a stage in the installation or uninstallation process, allowing for custom actions or configurations. The 'run' and 'message' items are universally applicable across all points.
```APIDOC
Extensibility Point: "startup"
Items: "uninstall", "unattended", "hidden" (control install process)
Items: "license", "logo", "banner" (specify custom files/images)
Extensibility Point: "styles"
Items: "color" (specify colors for installer UI components)
Extensibility Point: "artifacts"
Items: Names of io.Connect Artifacts (control which artifacts to remove or make required)
Extensibility Point: "context"
Items: "setValue" (modify installer screen titles, URLs, text, product name, installation location)
Extensibility Point: "shortcuts"
Items: Modify or remove predefined shortcuts for io.Connect Artifacts, create new ones
Extensibility Point: "welcome", "previewAndConfirm", "downloadProgress", "packages", "uninstall" (installer screens/stages)
Items: "run" (run external programs)
Items: "message" (show messages to the user)
Extensibility Point: "finalizing"
Items: "gdConfig" (supply custom configuration files for io.Connect Desktop)
Extensibility Point: "done" (final installer screen)
Items: "showGD" (open folder containing io.Connect Desktop executable)
Items: "launchGD" (directly launch io.Connect Desktop)
Items: "exit" (exit install process with specified exit code)
```
--------------------------------
### Install io.Connect Electron Library via NPM
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/getting-started/how-to/interop-enable-your-apps/electron/index
This command installs the @interopio/electron library, which is essential for integrating Electron applications with io.Connect Desktop. Execute this command in the root directory of your project to add the dependency.
```npm
npm install @interopio/electron
```
--------------------------------
### Implement Plugin Logic to Fetch and Import App Definitions at Runtime
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/javascript/index
This JavaScript snippet illustrates the core logic of a plugin's setupApplications() function. It demonstrates how to receive the initialized "io" object and plugin configuration, fetch application definitions from a specified URL, and then use the io.appManager.inMemory.import() method to dynamically load these definitions into the io.Connect framework at runtime.
```JavaScript
// In `setupApplications()`.
try {
const appDefinitions = await fetchAppDefinitions(url);
await io.appManager.inMemory.import(appDefinitions);
} catch (error) {
console.error(error.message);
};
```
--------------------------------
### Full Example: Creating Interop Stream with Definition and Options
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/capabilities/data-sharing/interop/javascript/index
A comprehensive JavaScript example demonstrating the creation of an Interop stream. It combines a detailed `MethodDefinition` (including name, display name, accepted arguments, and return types) with `StreamOptions` that include handlers for subscription requests, additions, and removals, showcasing a complete stream setup.
```javascript
// Stream definition.
const streamDefinition = {
name: "MarketData.LastTrades",
displayName: "Market Data - Last Trades",
accepts: "String symbol",
returns: "String symbol, Double lastTradePrice"
};
// Stream options object containing subscription request handlers.
const streamOptions = {
subscriptionRequestHandler: subscriptionRequest => subscriptionRequest.accept(),
subscriptionAddedHandler: console.log,
subscriptionRemovedHandler: console.log
};
// Creating the stream.
let stream;
async function initiateStream() {
stream = await io.interop.createStream(streamDefinition, streamOptions);
console.log(`Stream "${stream.definition.displayName}" created successfully.`);
};
initiateStream().catch(console.error);
```
--------------------------------
### Retrieve App Instance Context (Stock Details App)
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/javascript/index
Shows how the 'Stock Details' app retrieves its startup context using `io.appManager.myInstance.getContext()`, replacing previous window context methods.
```javascript
// In `start()`.
const stock = await io.appManager.myInstance.getContext();
```
--------------------------------
### Configure io.Connect Browser Platform with a Plugin Definition
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/javascript/index
This JavaScript snippet demonstrates how to define a plugin within the @interopio/browser-platform configuration object. It shows how to specify the plugin's name, an optional configuration object (e.g., for a URL to fetch app definitions), the "start" function that will be executed, and the "critical" flag to ensure the main app waits for the plugin's completion before initialization.
```JavaScript
// In `start()`.
// Define a Plugin.
const plugins = {
definitions: [
{
name: "Setup Applications",
config: { url: "http://localhost:8080/api/applications"},
start: setupApplications,
critical: true
}
]
};
const config = {
licenseKey: "my-license-key",
channels,
plugins
};
const { io } = await IOBrowserPlatform(config);
window.io = io;
```
--------------------------------
### Example io.Connect Desktop App Configuration with Sandbox Disabled
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/capabilities/more/features/index
An example of a complete io.Connect Desktop app configuration, demonstrating how to embed the `security` settings to disable the sandbox within the `details` key. This setup is crucial for apps requiring specific permissions.
```JSON
{
"name": "My App",
"details": {
"url": "http://localhost:3000",
"security": {
"sandbox": false
}
}
}
```
--------------------------------
### Install io.Connect Angular Library
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/angular/index
This command installs the @interopio/ng npm package, which includes core io.Connect Browser and Browser Platform libraries, into an Angular project. It's a required dependency for defining an Angular app as a Main app.
```npm
npm install --save @interopio/ng
```
--------------------------------
### Application Start API Reference
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/reference/javascript/app%20management/index
This API documentation describes the function to start an application instance, including its parameters (context and options), and defines the ApplicationStartOptions object used to configure the app's startup behavior.
```APIDOC
Starts an instance of the app.
Parameters:
context:
Type: object
Required: No
Description: Context to be passed to the started app instance.
options:
Type: ApplicationStartOptions
Required: No
Description: Options for the started app instance that will override the default app configuration.
ApplicationStartOptions:
Type: object
Description: Options for starting an app.
```
--------------------------------
### Configure React App Homepage in package.json
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/react/index
Add or modify the `homepage` property in your app's `package.json` file to specify the base URL for the app. Remember to replace `my-app` with your actual app name.
```JSON
"homepage": "/my-app/"
```
--------------------------------
### Retrieve Window Context (JavaScript)
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/tutorials/javascript/index
This JavaScript snippet shows how to retrieve the context passed to the current window. Within the 'start()' function of the target application, it uses 'io.windows.my()' to get a reference to the current window and then 'getContext()' to asynchronously retrieve the associated data, such as the 'stock' object in this example.
```JavaScript
// In `start()`.
const myWindow = io.windows.my();
const stock = await myWindow.getContext();
```
--------------------------------
### Define Function to Start Stocks App with Channel Context
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/react/index
This JavaScript snippet defines the 'startApp' function within 'io-connect.js' for the 'Clients' application. It retrieves the current channel, constructs a channel definition object, and then uses 'io.appManager.application("Stocks").start()' to launch the 'Stocks' app, passing the channel as context.
```JavaScript
export const startApp = io => async () => {
const channels = await io.channels.list();
let channel = {};
if (io.channels.my()) {
const channelDefinition = channels.find(channel => channel.name === io.channels.my());
channel = {
name: channelDefinition.name,
label: channelDefinition.name,
color: channelDefinition.meta.color
};
} else {
channel = {
name: NO_CHANNEL_VALUE,
label: NO_CHANNEL_VALUE
}
};
io.appManager.application("Stocks").start({ channel });
};
```
--------------------------------
### Initialize io.Connect Java and Retrieve Version, Environment, Region
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/getting-started/how-to/interop-enable-your-apps/java/index
This Java example demonstrates how to initialize the `Glue` instance, which serves as the main entry point for the io.Connect SDK. It then shows how to access and print out the io.Connect version, environment, and region information. The `try`-with-resources block ensures proper resource cleanup.
```java
import com.tick42.glue.Glue;
try (Glue io = Glue.builder().build()) {
// Print out the io.Connect version.
System.out.println(io.version());
// Print out the io.Connect environment.
System.out.println(io.env());
// Print out the io.Connect region.
System.out.println(io.region());
}
```
--------------------------------
### Disable Windows Start Menu Entries for io.Connect Desktop
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/getting-started/how-to/rebrand-io-connect/installer/index
Demonstrates how to use the 'context' extensibility point to prevent the creation of entries in the Windows 'Start Menu' folder during installation.
```JSON
{
"context": [
{
"type": "setValue",
"args": {
"name": "CreateStartMenuEntries",
"value": false
}
}
]
}
```
--------------------------------
### Complete Browser Platform Initialization with Layouts
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/capabilities/windows/workspaces/enabling-workspaces/index
This comprehensive example demonstrates the full configuration for initializing the `@interopio/browser-platform` library. It includes a license key, Workspaces App source, the Workspaces API library, and crucial `layouts` settings for proper Workspace Layout functionality. It also shows the asynchronous initialization call.
```javascript
import IOBrowserPlatform from "@interopio/browser-platform";
import IOWorkspaces from "@interopio/workspaces-api";
const config = {
licenseKey: "my-license-key",
workspaces: {
src: "https://my-workspaces-app.com"
},
browser: {
libraries: [IOWorkspaces]
},
layouts: {
mode: "session",
// Layout definition objects of type \"Workspace\".
local: [ {...}, {...}]
}
};
const { io } = await IOBrowserPlatform(config);
```
--------------------------------
### Subscribing to Interop Data Streams in JavaScript
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/javascript/index
This example illustrates how to subscribe to an Interop stream named 'LivePrices' using `io.interop.subscribe()`. It then defines an `onData` handler for the returned subscription object to process incoming stream data, such as updating stock prices.
```JavaScript
// In `start()`.
// Create a stream subscription.
const subscription = await io.interop.subscribe("LivePrices");
// Define a handler for the received stream data.
const streamDataHandler = (streamData) => {
const updatedStocks = streamData.data.stocks;
const selectedStockPrice = updatedStocks.find(updatedStock => updatedStock.RIC === stock.RIC);
updateStockPrices(selectedStockPrice.Bid, selectedStockPrice.Ask);
};
// Handle the received stream data.
subscription.onData(streamDataHandler);
```
--------------------------------
### Start an io.Connect Application Instance
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/capabilities/app-management/index
This snippet shows the basic way to start an application using its `start()` method. It first obtains an `Application` object and then invokes `start()` to launch an instance of the app.
```javascript
const myApp = io.appManager.application("my-app");
const myAppInstance = await myApp.start();
```
--------------------------------
### Confirm io.Connect Availability by Calling toggleIOAvailable
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/browser/tutorials/javascript/index
After the `IOBrowserPlatform()` factory function resolves, this JavaScript snippet shows calling `toggleIOAvailable()`. This function updates the UI to indicate that io.Connect is successfully initialized and available within the application, confirming the Main app setup.
```JavaScript
// In `start()`.
toggleIOAvailable();
```
--------------------------------
### Extensibility Points Overview
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/getting-started/how-to/rebrand-io-connect/installer/index
General description of various extensibility points ('welcome', 'downloadProgress', 'packages', 'previewAndConfirm', 'uninstall') which represent installer screens. These points support 'run' items for script execution and 'message' items for user communication.
```APIDOC
Extensibility Points:
- welcome
- downloadProgress
- packages
- previewAndConfirm
- uninstall
Common Items:
- run: Execute external scripts.
- message: Show messages to the user.
```
--------------------------------
### Registering ClickOnce Apps: Basic Definition
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/getting-started/how-to/interop-enable-your-apps/net/index
Example JSON configuration for registering a ClickOnce application with the io.Connect launcher, specifying required properties like title, type, name, and URL. The 'name', 'type', and 'url' properties are mandatory, with 'type' fixed to 'clickonce'.
```JSON
{
"title": "My ClickOnce App",
"type": "clickonce",
"name": "my-clickonce-app",
"details": {
"url": "https://example.com/my-clickonce-app.application",
"width": 1000,
"height": 400
}
}
```
--------------------------------
### Start an io.Connect App with Context and Channels
Source: https://docs.interop.io/desktop/getting-started/what-is-io-connect-desktop/general-overview/index.html/desktop/capabilities/app-management/javascript/index
Shows how to pass custom data (context) and enable io.Connect Channels when starting an app. The `start()` method accepts optional context and `ApplicationStartOptions` objects to configure the app's launch behavior.
```javascript
const myApp = io.appManager.application("my-app");
const context = { selectedUser: 2 };
const startOptions = { channelSelector: { enabled: true, channelId: "Red" } };
const myAppInstance = await myApp.start(context, startOptions);
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.