(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('Console.open');</source> | ||
+ | |||
+ | == open == | ||
+ | Opens the Console UI. | ||
+ | <br /><br /> | ||
+ | === Example === | ||
+ | <source lang='javascript'> | ||
+ | oMyPlugin.command('Console.open').done(function(e){ | ||
+ | |||
+ | // Console opened successfully | ||
+ | |||
+ | }).fail(function(e){ | ||
+ | |||
+ | // Console failed to open | ||
+ | }); | ||
+ | </source> | ||
+ | |||
+ | <br /> | ||
+ | === Resolutions === | ||
+ | {| | ||
+ | |- | ||
+ | ! Status | ||
+ | ! When | ||
+ | ! Returns | ||
+ | |- | ||
+ | | resolved | ||
+ | | When Console is successfully opened | ||
+ | | n/a | ||
+ | |- | ||
+ | | rejected | ||
+ | | When Console is already open | ||
+ | | 'Already opened' | ||
+ | |- | ||
+ | |} | ||
+ | == close == | ||
+ | Closes the Console UI. | ||
+ | <br /><br /> | ||
+ | === Example === | ||
+ | <source lang='javascript'> | ||
+ | oMyPlugin.command('Console.close').done(function(e){ | ||
+ | |||
+ | // Console closed successfully | ||
+ | |||
+ | }).fail(function(e){ | ||
+ | |||
+ | // Console failed to close | ||
+ | }); | ||
+ | </source> | ||
+ | |||
+ | <br /> | ||
+ | === Resolutions === | ||
+ | {| | ||
+ | |- | ||
+ | ! Status | ||
+ | ! When | ||
+ | ! Returns | ||
+ | |- | ||
+ | | resolved | ||
+ | | When Console successfully closed | ||
+ | | n/a | ||
+ | |- | ||
+ | | rejected | ||
+ | | When Console is already closed | ||
+ | | 'Already closed' | ||
+ | |- | ||
+ | |} | ||
+ | == configure == | ||
+ | Modify configuration options for Console. See configuration page for Console | ||
+ | <br /><br /> | ||
+ | === Example === | ||
+ | <source lang='javascript'> | ||
+ | oMyPlugin.command('Console.configure', { | ||
+ | |||
+ | open: false | ||
+ | |||
+ | }).done(function(e){ | ||
+ | |||
+ | // Console configured successfully | ||
+ | |||
+ | }).fail(function(e){ | ||
+ | |||
+ | // Console failed to configure | ||
+ | }); | ||
+ | </source> | ||
+ | |||
+ | <br /> | ||
+ | === Options === | ||
+ | {| | ||
+ | |- | ||
+ | ! Option | ||
+ | ! Type | ||
+ | ! Description | ||
+ | |- | ||
+ | | open | ||
+ | | boolean | ||
+ | | If setting is open: true, the console will automatically be open when widgets is launched and the console is ready. | ||
+ | |- | ||
+ | |} | ||
+ | <br /> | ||
+ | === Resolutions === | ||
+ | {| | ||
+ | |- | ||
+ | ! Status | ||
+ | ! When | ||
+ | ! Returns | ||
+ | |- | ||
+ | | resolved | ||
+ | | When Console configuration is provided | ||
+ | | n/a | ||
+ | |- | ||
+ | | rejected | ||
+ | | When no configuration provided | ||
+ | | 'Invalid Configuration' | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | [[Category:V:PSAAS:Julie]] |
Revision as of 16:59, June 7, 2019
Contents
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('Console.open');
open
Opens the Console UI.
Example
oMyPlugin.command('Console.open').done(function(e){
// Console opened successfully
}).fail(function(e){
// Console failed to open
});
Resolutions
Status | When | Returns |
---|---|---|
resolved | When Console is successfully opened | n/a |
rejected | When Console is already open | 'Already opened' |
close
Closes the Console UI.
Example
oMyPlugin.command('Console.close').done(function(e){
// Console closed successfully
}).fail(function(e){
// Console failed to close
});
Resolutions
Status | When | Returns |
---|---|---|
resolved | When Console successfully closed | n/a |
rejected | When Console is already closed | 'Already closed' |
configure
Modify configuration options for Console. See configuration page for Console
Example
oMyPlugin.command('Console.configure', {
open: false
}).done(function(e){
// Console configured successfully
}).fail(function(e){
// Console failed to configure
});
Options
Option | Type | Description |
---|---|---|
open | boolean | If setting is open: true, the console will automatically be open when widgets is launched and the console is ready. |
Resolutions
Status | When | Returns |
---|---|---|
resolved | When Console configuration is provided | n/a |
rejected | When no configuration provided | 'Invalid Configuration' |
Comments or questions about this documentation? Contact us for support!