Migrating to Glue42 Enterprise

Overview

The Main app and all Web Client apps can run in Glue42 Enterprise without any code modification. The Main app will automatically detect that it is running in Glue42 Enterprise and won't initialize any of its Web Platform logic - it will default to being a normal Glue42 Enterprise client app. The Web Client apps will also auto detect the environment and will initialize the @glue42/desktop library instead of Glue42 Web, with all necessary features enabled and set to the highest possible level (e.g., the Aplication Management API will be initialized in "full" mode) to ensure correct app functionality. This gives you the option to easily experiment with your apps running in a functionally richer environment with more integration options.

For more information, see the Glue42 Enterprise product page and the official Glue42 Enterprise documentation.

How To

  1. Install Glue42 Enterprise version 3.9 or newer. Download the trial version of Glue42 Enterprise from here.

  2. Make sure that Glue42 Enterprise runs with auto injection on:

  • Open the system.json configuration file (located in the %LocalAppData%\Tick42\GlueDesktop\config folder).
  • Edit the autoInjectAPI property of the windows top-level key by setting the following configuration:
"windows": {
    ...
    "autoInjectAPI": {
        "enabled": true,
        "version": "5.*",
        "autoInit": false
    }
}

For more details on configuring Glue42 Enterprise, see the System Configuration section.

  1. Create a definition file for your app. Use the template below and change the name, title and url properties with the details of your app.
[
    {
        "title": "Glue42 Core app",
        "type": "window",
        "name": "glue42-core-app",
        "details": {
            "url": "http://localhost:4242/",
            "top": 100,
            "left": 200,
            "width": 600,
            "height": 300,
            "mode": "tab"
        }
    }
]

Save the configuration file as a JSON file and place it in the app definitions folder. Usually, this is the %LocalAppData%\Tick42\UserData\<ENV-REG>\apps folder where <ENV-REG> should be replaced with the region and environment folder name used for the deployment of your Glue42 Enterprise - e.g., T42-DEMO.

For more details on configuring a Glue42 enabled app in Glue42 Enterprise, see the App Configuration section.

  1. Start Glue42 Enterprise and open your app from the Glue42 Toolbar.

Using Enterprise Features

If you want to keep your app running in both environments (Glue42 Core and Glue42 Enterprise) and also use features that are specific to Glue42 Enterprise, you need to make checks in your code to determine in which environment your app is running.

For example, you may want to register a global hotkey shortcut using the Hotkeys API that is only available in Glue42 Enterprise. Use the glue42gd or the glue42core objects that are automatically attached to the global window object on startup of Glue42 Enterprise or Glue42 Core respectively to determine in which environment your app is running:

// Check whether the app is running in Glue42 Enterprise in order to use the Hotkeys API.
if (typeof glue42gd !== "undefined") {

    // Define a hotkey object.
    const hotkeyClientDetails = {
        hotkey: "shift+alt+c",
        description: "Open Client Details"
    };

    // Register the hotkey.
    glue.hotkeys.register(hotkeyClientDetails, (details) => {
        // This function will be invoked when the hotkey is used.
        console.log("Shortcut has been used.");
    });
} else if (typeof glue42core !== "undefined") {
    // Running in Glue42 Core, will fall back to in-page shortcuts.
};

If you are using TypeScript, cast your Glue42 Web API (@glue42/web) to the Glue42 Enterprise API (@glue42/desktop) to get better types:

// Import the types.
import { Glue42 } from "@glue42/desktop";

if (typeof glue42gd !== "undefined") {
    // Running in Glue42 Enterprise, you can now use Glue42 Enterprise specific APIs.
    const glueEnterprise = glue as Glue42.Glue;
};