-
Notifications
You must be signed in to change notification settings - Fork 10
Creating a Nexus Bridge instance
You create a new instance of the Nexus Bridge passing the instance of applet's Presentation Model (PM).
The way you create the instance of the Nexus Bridge depends on how you included the Nexus Bridge into your project:
- IIFE as shown in Setup Nexus Bridge:
const nexus = new window.SiebelAppFacade.NexusBridge({pm});
- Dependency
import Nexus from '@ideaportriga/nexus-bridge';
const nexus = new Nexus ({pm});
The Nexus Bridge creation settings:
The custom PR application can create the instances of the Nexus Bridge:
const nexus = [];
const appletmap = window.SiebelApp.S_App.GetActiveView().GetAppletMap();
for (const applet in appletmap) {
const pm = appletmap[applet].GetPModel();
nexus.push(new window.SiebelAppFacade.NexusBridge({ pm, convertDates: true }));
}
This ES5 code could be used in the PR file deployed for the popup applet. Pay attention that the CreatePopupNB
is a static method.
var pm = this.GetPM();
var appletName = pm.Get('GetName');
var isPopup = pm.Get('IsPopup');
var popupPM = window.SiebelApp.S_App.GetPopupPM();
var isShuttle = popupPM.Get('isPopupMVGAssoc');
var mvgAssoc = popupPM.Get('MVGAssocAppletObject');
var applet = window.SiebelApp.S_App.GetActiveView().GetApplet(appletName)
var isMvgAssoc = isShuttle && applet && applet === mvgAssoc;
window.SiebelAppFacade.NB[appletName] =
window.SiebelAppFacade.NexusBridge.CreatePopupNB(Object.assign(
{ pm: pm, isMvgAssoc: isMvgAssoc, isPopup: true }, options
));
As outcome of the Oracle review, the Nexus Bridge is not allowed to use the GetPModel function and advised to create the instances of the Nexus Bridge in applet PRs.
-
Overrides Init, BindData, BindEvents, and ShowUI, and does not call the methods of superclasses.
-
Injects the external application that manipulates with Siebel Data using the instances of Nexus Bridge (not shown in the piece of the code below).
if (typeof (SiebelAppFacade.DefaultViewPR) === "undefined") {
SiebelJS.Namespace("SiebelAppFacade.DefaultViewPR");
define("siebel/custom/DefaultViewPR", ["siebel/viewpr"],
function () {
SiebelAppFacade.DefaultViewPR = (function () {
function DefaultViewPR(pm) {
SiebelAppFacade.DefaultViewPR.superclass.constructor.apply(this, arguments);
}
SiebelJS.Extend(DefaultViewPR, SiebelAppFacade.ViewPR);
DefaultViewPR.prototype.Init = function () { }
DefaultViewPR.prototype.ShowUI = function () { }
DefaultViewPR.prototype.BindData = function () { }
DefaultViewPR.prototype.BindEvents = function () { }
DefaultViewPR.prototype.EndLife = function () {
SiebelAppFacade.DefaultViewPR.superclass.EndLife.apply(this, arguments);
}
return DefaultViewPR;
}()
);
return "SiebelAppFacade.DefaultViewPR";
})
}
The Nexus Bridge instances are not independent. Standard Siebel functionality is also triggered when you are manipulating the Nexus Bridge instances. For example, when one Nexus Bridge instance is in the process of creating a new record, manipulating the another instance could cause the implicit write record in the first instance.