(Created target blank page For Version: PSAAS:Julie) |
(Update with the copy of version: Public) |
||
Line 1: | Line 1: | ||
− | <!-- | + | = API Commands = |
+ | |||
+ | Once you've registered your own plugin on the bus, you can call commands on other registered plugins. Below we'll quickly register a new plugin on the bus using the global bus object. | ||
+ | |||
+ | {{NoteFormat|The global bus object is a debug tool. When implementing Widgets on your own site, do not use the global bus object to register your custom plugins. Instead, see [[GWCBusExtensions|Widgets Extensions]] for more information about extending Genesys Widgets.|1}} | ||
+ | |||
+ | |||
+ | <source lang='javascript'>var oMyPlugin = window._genesys.widgets.bus.registerPlugin('MyPlugin'); | ||
+ | |||
+ | oMyPlugin.command('WindowManager.registerDockView', {html: '<div>HTML</div>'});</source> | ||
+ | |||
+ | == registerDockView == | ||
+ | Creates a docked view container to show a widget on the bottom right corner. Its position is adjusted (stacked) to show side by of a widget if already present and is indexed with a tabindex. | ||
+ | <br /><br /> | ||
+ | === Example === | ||
+ | <source lang='javascript'> | ||
+ | oMyPlugin.command('WindowManager.registerDockView', {html: '<div>Template</div>'}).done(function(e){ | ||
+ | |||
+ | // WindowManager registered a dockView successfully | ||
+ | |||
+ | }).fail(function(e){ | ||
+ | |||
+ | // WindowManager failed to register a dock view | ||
+ | }); | ||
+ | </source> | ||
+ | |||
+ | <br /> | ||
+ | === Options === | ||
+ | {| | ||
+ | |- | ||
+ | ! Option | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | html | ||
+ | | string | ||
+ | | A Widget HTML string template that needs to be shown in dock view. | ||
+ | |- | ||
+ | |} | ||
+ | <br /> | ||
+ | === Resolutions === | ||
+ | {| | ||
+ | |- | ||
+ | ! Status | ||
+ | ! When | ||
+ | ! Returns | ||
+ | |- | ||
+ | | resolved | ||
+ | | When the html template is successfully opened and registered in dock view | ||
+ | | n/a | ||
+ | |- | ||
+ | | rejected | ||
+ | | When no html template is found | ||
+ | | 'No html content' | ||
+ | |- | ||
+ | |} | ||
+ | == registerSideButton == | ||
+ | Registers a button to show on the right side of the screen for a particular plugin. Its position is based on the respective plugin order defined in the array configuration. Currently, this is not supported for external plugins. | ||
+ | <br /><br /> | ||
+ | === Example === | ||
+ | <source lang='javascript'> | ||
+ | oMyPlugin.command('WindowManager.registerSideButton', {template: '<div>Button Text</div>'}).done(function(e){ | ||
+ | |||
+ | // WindowManager registered a side button successfully | ||
+ | |||
+ | }).fail(function(e){ | ||
+ | |||
+ | // WindowManager failed to register a side button | ||
+ | }); | ||
+ | </source> | ||
+ | |||
+ | <br /> | ||
+ | === Options === | ||
+ | {| | ||
+ | |- | ||
+ | ! Option | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | template | ||
+ | | string | ||
+ | | Custom HTML string template for a button. | ||
+ | |- | ||
+ | |} | ||
+ | <br /> | ||
+ | === Resolutions === | ||
+ | {| | ||
+ | |- | ||
+ | ! Status | ||
+ | ! When | ||
+ | ! Returns | ||
+ | |- | ||
+ | | resolved | ||
+ | | When the html button is successfully registered | ||
+ | | n/a | ||
+ | |- | ||
+ | | rejected | ||
+ | | When no html template is found | ||
+ | | 'No button template found to register' | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | [[Category:V:PSAAS:Julie]] |
Revision as of 16:59, June 7, 2019
API Commands
Once you've registered your own plugin on the bus, you can call commands on other registered plugins. Below we'll quickly register a new plugin on the bus using the global bus object.
Important
The global bus object is a debug tool. When implementing Widgets on your own site, do not use the global bus object to register your custom plugins. Instead, see Widgets Extensions for more information about extending Genesys Widgets.
var oMyPlugin = window._genesys.widgets.bus.registerPlugin('MyPlugin');
oMyPlugin.command('WindowManager.registerDockView', {html: '<div>HTML</div>'});
registerDockView
Creates a docked view container to show a widget on the bottom right corner. Its position is adjusted (stacked) to show side by of a widget if already present and is indexed with a tabindex.
Example
oMyPlugin.command('WindowManager.registerDockView', {html: '<div>Template</div>'}).done(function(e){
// WindowManager registered a dockView successfully
}).fail(function(e){
// WindowManager failed to register a dock view
});
Options
Option | Type | Description |
---|---|---|
html | string | A Widget HTML string template that needs to be shown in dock view. |
Resolutions
Status | When | Returns |
---|---|---|
resolved | When the html template is successfully opened and registered in dock view | n/a |
rejected | When no html template is found | 'No html content' |
registerSideButton
Registers a button to show on the right side of the screen for a particular plugin. Its position is based on the respective plugin order defined in the array configuration. Currently, this is not supported for external plugins.
Example
oMyPlugin.command('WindowManager.registerSideButton', {template: '<div>Button Text</div>'}).done(function(e){
// WindowManager registered a side button successfully
}).fail(function(e){
// WindowManager failed to register a side button
});
Options
Option | Type | Description |
---|---|---|
template | string | Custom HTML string template for a button. |
Resolutions
Status | When | Returns |
---|---|---|
resolved | When the html button is successfully registered | n/a |
rejected | When no html template is found | 'No button template found to register' |
Comments or questions about this documentation? Contact us for support!