Skip to main content

Plugin Messages

Temenos Explorer plugins can communicate with each other by passing messages up to Temenos Explorer. This guide explains the structure of the messages and when to use each message.

Launch Plugin

The first case is when you would like to open a new plugin from an existing plugin. The most common scenario for this is to drill into a Transact Explorer screen from a user agent plugin.

To achieve this, a loadPlugin message needs to be sent. This takes the following format:

{
command: "loadPlugin",
detail: {
plugin: -the name of the plugin to load e.g. "transact-explorer"
description: -the text to be displayed in the title bar and tab bar (if visible) - e.g. "Customer Search"
searchParams: -a string appended to plugin url e.g. "?screen=ENQ CUSTOMER.LIST"
}
}

Another option for passing information into the new plugin is through a field called queryString. While not technically a query string, the value of the queryString field is stored in sessionStorage automatically, so the user agent can query it.

{
command: "loadPlugin",
detail: {
plugin: "csa",
description: "Customer Search",
queryString: {
page: "customer",
partyId: "100100"
},
}
}

Finally, the message should be posted to Temenos Explorer (which will be the 'top' frame) using

    top.postMessage(JSON.stringify(message), texOrigin);  

where texOrigin is the origin url for Temenos Explorer. This ensures that the message will only be receieved by origins you allow to get the message.

Display mode

The fields with the query string object will be specific to the user agent, except for the mode field, which directs Temenos Explorer on how to present the new plugin. Options are:

  • "append" - create new tab after all the existing tabs
  • "insert" - create new tab immediately after the current tab
  • "split" - create a split screen, with new plugin displayed in right half of screen. New tab is created in 'insert' mode
  • "new" - creates a pop out browser window, with just the plugin content visible. No tab is added to the task bar.

The mode field should be added to the queryString configuration object.

Message Owner Plugin

When a new plugin is launched from another plugin using the loadPlugin message, Temenos Explorer keeps track of who sent the original request. This means it is possible to communicate back to the plugin which created you.

This is achieved by sending a messageOwnerPlugin message. This takes the following structure

{
command: "messageOwnerPlugin",
detail: {
this can be anything in a format the the owner plugin expects
}
}

Update Current Plugin

It is possible to notify Temenos Explorer that the current state of the plug in has changed, and should be refected in Temenos Explorer. This can be done with the updatePlugin message.

The fields in the detail object are all optional

{
command: "updatePlugin",
detail: {
title: - the document title (appears in browser tab),
description: - used as page title (if title field not provided). Also used as base text in plugin tab.
shortDescription: - appended to current text description in plugin tab
page: - a name of the page with in the plugin
querystring: - settings that may be used with in the plugin
}
}

Security Configuration

Plugins which are all hosted with Temenos Explorer will automatically be trusted as sources of messages. If a plugin is hosted outside of Temenos Explorer (in another domain), then their domain needs to be added to the list of trusted origins. This is configured in the CONFIG object of Temenos Explorer in the ALLOWED_ORIGINS array.