You can access any methods of the Simplifier by using the Simplifier Object.
Business Objects
Simplifier.BusinessObject.<BOName>.<MethodName>(payload: object, successCallback: function, busyFlag?: boolean, failOnError?: boolean, errorCallback?: function, parametrized?: boolean = false): void
Example:
var payload = {leftOperand: 3, operation: "add", rightOperand: 4}; function onSuccess (data) { resolve(data); }; Simplifier.BusinessObject.OtherBO.someMethod(payload, onSuccess, true, false, function () { console.log("something went wrong"); }, true);
Client-side Business Objects
Simplifier.ClientsideBusinessObject.<CSBOName>.<FunctionName>(payload: object, successCallback: function, busyFlag?: boolean, failOnError?: boolean, errorCallback?: function): void Simplifier.CurrentClientsideBusinessObject.<FunctionName>(payload: object, successCallback: function, busyFlag?: boolean, failOnError?: boolean, errorCallback?: function): void
Example:
var payload = {leftOperand: 3, operation: "add", rightOperand: 4}; function onSuccess (data) { resolve(data); }; Simplifier.ClientsideBusinessObject.OtherBO.someMethod(payload, onSuccess, true, false, function () { console.log("something went wrong"); }); Simplifier.CurrentClientsideBusinessObject.someMethod(null, onSuccess, true, false, function () { console.log("something went wrong"); });
Plugins
Simplifier.Plugin.<PluginName>.<SlotName>(payload: object, successCallback: function, busyFlag?: boolean, failOnError?: boolean, errorCallback?: function): void
Example:
var payload = {name: ""}; function onSuccess (data) { resolve(data); }; Simplifier.Plugin.contentRepoPlugin.listRepos(null, onSuccess); Simplifier.Plugin.contentRepoPlugin.createRepo(payload, onSuccess);
CryptoJS
var sMySecretKey = "secret"; var oCrypted = CryptoJS.AES.encrypt("dontStealMyData", sMySecretKey); output.result = CryptoJS.AES.decrypt(oCrypted, sMySecretKey).toString(CryptoJS.enc.Utf8)
Take also a look at crypto-js.