The Discngine Connector 6.x is not backward compatible with the Discngine Connector 5.x as a big part of the JavaScript API changed. However, most of the protocols created with version 5.x should work in version 6.x.
All the changes observed in the behavior of the Connector 6.x are only applicable in the panel in Web Player which was not existing in Connector 5.x and are related to the fact that this panel is reloaded from scratch each time the Spotfire page changes (known side effect). This has an impact only on few advanced use cases (the panel closing in the active page, the opening of several documents, the actions raised on-click in a reporting page and the marking event listener) and on the capability to keep the latest result page displayed.
This tutorial shows you how to migrate your 5.x protocols to 6.x protocols to make them work also in the panel in Web Player.
Panel closing before save
If, in a protocol, the "Page" component is used to close the "Web Panel" in the active page and that the document is saved after this closing, do not close the panel using the Page component but using the save
method.
For example use the following code in the "Execute JavaScript" component:
spotfireDocument.save(
{
path: "/Users/MyFolder",
fileName: "SavedAnalysis",
singleExecution: true
},{
webPanel: false
});
Successive document openings
All "Open Document" components which should be automatically executed (not after a user interaction) must have "Execute Spotfire Script" set to "On Page Load". Make also sure that they are positioned in the wanted opening order in the protocol.
On click actions
A new parameter is available on most of the components having the "Execute Spotfire Script" group of parameters (e.g. "HTML TIBCO Spotfire Viewer", "Apply Document Editor Changes" or "Mark Rows"): "Single Execution". This parameter ensures that the components piped before are not re-executed when the panel is reloaded, which happens each time the Spotfire page changes with the panel in Web Player. This parameter is by default set to "True" and most of the time you will not need to change it. However, sometimes you may want to apply again the content of a pipe, and this is mainly when you have buttons triggering actions on click.
If the "Execute Spotfire Script" parameter is set to "On Demand" and the demand is raised by a user interaction (click on a button, a link, ...), then set the parameter "Single Execution" to "False".
See the example protocol available under "Protocols\Discngine\Spotfire Enabled Protocols\Client Automation\Miscellaneous Examples\A Customized Bar Chart".
Explanation:
The "Submit Button" components creates a button named "Toggle error bars" which has as HTML Attribute onclick=toggleErrorBars(). The function named toggleErrorBars is associated to the "Execute IronPython Script" component which is triggered on demand and has the parameter "Single Execution" set to False. Thus, the button "Toggle error bars" triggers the execution of the IronPython script on click, even after reloading the panel.
Marking event listener
If the "Marking Event Listener" component has the "Execute Spotfire Script" parameter which is set to "On Demand", and is chained after a component which has "Execute Spotfire Script" set to "On Page Load" or "Single Execution" set to True, set the "Execute Spotfire Script" parameter to "On Page Load". Make also sure that the "Marking Event Listener" component is positioned after the first component with the "Execute Spotfire Script" parameter set to "On Page Load".
Display the latest result page
As the panel is reloaded each time the Spotfire page changes with the panel in Web Player, the default URL, which is defined in the Spotfire preferences, is reloaded. This means that if a Pipeline Pilot protocol has been launched, when changing of Spotfire page, the result page of this protocol is lost.
A new parameter is available on the "HTML TIBCO Spotfire Viewer" component: "Last URL". This parameter is by default set to "Store", which means that the result page's URL of the protocol will be stored in the browser session. This parameter can also be set to "Redirect", which means that instead of loading the content of the current protocol, the content of the previously stored one will be loaded.
If the default URL is a link to a Pipeline Pilot protocol ending by a "HTML TIBCO Spotfire Viewer" component, to be sure to be redirected to the correct page when necessary, set the parameter "Last URL" to "Redirect" in this protocol (see as an example the protocol available under "Protocols\Discngine\Spotfire Enabled Protocols\Client Automation\Default Client Automation Home Page").
To avoid to be stucked in the result page and be able to go back to the default page, implement a way to go to this default page, such as the "Home Link" component (available under "Components\Discngine\TIBCO Spotfire Connector\Utilities\Discngine Home Link") which clears the browser session.
Note that if the default URL is the SWAPP, the display of the latest result page is already handled.