Difference between revisions of "WID/Current/SDK/Console-combined"
(Published) |
|||
(6 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
|Standalone=No | |Standalone=No | ||
|DisplayName=Console | |DisplayName=Console | ||
− | |||
|TocName=Console | |TocName=Console | ||
− | | | + | |Context=Learn how to debug commands and events on the widget bus. |
|ComingSoon=No | |ComingSoon=No | ||
− | | | + | |Platform=GenesysEngage-cloud |
+ | |Role=Developer | ||
|Section={{Section | |Section={{Section | ||
|sectionHeading=Overview | |sectionHeading=Overview | ||
− | | | + | |anchor=overview |
− | |||
|alignment=Vertical | |alignment=Vertical | ||
− | |structuredtext=Use the Console Widget to debug commands and events on the widget bus. You can use dynamically populated lists to test, debug, or demo all | + | |structuredtext=Use the Console Widget to debug commands and events on the widget bus. You can use dynamically populated lists to test, debug, or demo all commands. You can also create event watch lists that alert you when an event has fired. |
− | [[File:Console_Main.png| | + | [[File:Console_Main.png|500px|alt=the Console Widget in dark theme used for or debugging the widget bus]] |
− | Console provides an easy-to-use interface for debugging the widget bus that | + | Console provides an easy-to-use interface for debugging the widget bus that complements the standard command-line methods. You can drag and drop the console anywhere on your screen, and when you refresh the page or move to another one, Console reappears right where you left it. It is a great tool for getting to know the widget bus, the API for each widget, and debugging issues. |
===Usage=== | ===Usage=== | ||
Launch WebChat manually by using the following methods: | Launch WebChat manually by using the following methods: | ||
− | * Call the '''Console.open''' command | + | |
− | * Configure the settings to show Console when the browser window is opened. | + | *Call the '''Console.open''' {{Link-SomewhereInThisVersion|manual=SDK|topic=Console-combined|anchor=commands|display text=command}} |
− | * Create your own custom button or link to open Console (using the | + | *Configure the settings to show Console when the browser window is opened. |
− | + | *Create your own custom button or link to open Console (using the '''Console.open''' {{Link-SomewhereInThisVersion|manual=SDK|topic=Console-combined|anchor=commands|display text=command}}) | |
|Status=No | |Status=No | ||
}}{{Section | }}{{Section | ||
|sectionHeading=Configuration | |sectionHeading=Configuration | ||
− | | | + | |anchor=config |
− | |||
|alignment=Vertical | |alignment=Vertical | ||
|structuredtext====Description=== | |structuredtext====Description=== | ||
Line 49: | Line 47: | ||
{{!}}{{!}}open | {{!}}{{!}}open | ||
{{!}}{{!}}boolean | {{!}}{{!}}boolean | ||
− | {{!}}{{!}}Set to true for console to open at start. | + | {{!}}{{!}}Set to <code>true</code> for console to open at start. |
{{!}}{{!}}false | {{!}}{{!}}false | ||
{{!}}{{!}}false | {{!}}{{!}}false | ||
{{!}}} | {{!}}} | ||
− | |||
|Status=No | |Status=No | ||
}}{{Section | }}{{Section | ||
|sectionHeading=Localization | |sectionHeading=Localization | ||
− | | | + | |anchor=localize |
− | |||
|alignment=Vertical | |alignment=Vertical | ||
− | |structuredtext= | + | |structuredtext={{NoteFormat|For information on how to set up localization, please refer to {{Link-AnywhereElse|product=WID|version=Current|manual=Developer|topic=GWCInternat}}.|1}} |
− | + | ==Strings== | |
+ | <source lang="javascript">{ | ||
+ | "ConsoleTitle": "CXBus Console", | ||
+ | "Commands": "Commands", | ||
+ | "Plugin": "Plugin", | ||
+ | "ConsoleErrorButton": "OK", | ||
+ | "Execute": "Execute", | ||
+ | "Event": "Event", | ||
+ | "SubscribeTo": "Subscribe to", | ||
+ | "Unsubscribe": "Unsubscribe", | ||
+ | "ReturnData": "Return Data", | ||
+ | "EventsSubscriber": "Events Subscriber", | ||
+ | "Watch": "Watch", | ||
+ | "pluginNameEvent": "PluginName.Event", | ||
+ | "ClearAll": "Clear All", | ||
+ | "OptionsSample": "JSON Formatted Options {'option': value}" | ||
+ | }</source><br /> | ||
|Status=No | |Status=No | ||
}}{{Section | }}{{Section | ||
− | |sectionHeading=API | + | |sectionHeading=API commands |
− | | | + | |anchor=commands |
− | |||
|alignment=Vertical | |alignment=Vertical | ||
|structuredtext=Once you've registered your plugin on the bus, you can call commands on other registered plugins. Here's how to use the global bus object to register a new plugin on the bus. | |structuredtext=Once you've registered your plugin on the bus, you can call commands on other registered plugins. Here's how to use the global bus object to register a new plugin on the bus. | ||
− | {{NoteFormat|The global bus object is a debugging tool. When implementing Widgets on your own site, do not use the global bus object to register your custom plugins. Instead, see {{Link- | + | {{NoteFormat|The global bus object is a debugging tool. When implementing Widgets on your own site, do not use the global bus object to register your custom plugins. Instead, see {{Link-AnywhereElse|product=WID|version=Current|manual=SDK|topic=GWCBusExtensions|display text=Genesys Widgets Extensions}} for more information about extending Genesys Widgets.|1}} |
− | <source lang= | + | <source lang="javascript">var oMyPlugin = window._genesys.widgets.bus.registerPlugin('MyPlugin'); |
oMyPlugin.command('Console.open');</source> | oMyPlugin.command('Console.open');</source> | ||
Line 78: | Line 89: | ||
Opens the Console UI. | Opens the Console UI. | ||
====Example==== | ====Example==== | ||
− | <source lang= | + | <source lang="javascript"> |
oMyPlugin.command('Console.open').done(function(e){ | oMyPlugin.command('Console.open').done(function(e){ | ||
Line 98: | Line 109: | ||
{{!}}- | {{!}}- | ||
{{!}}{{!}}resolved | {{!}}{{!}}resolved | ||
− | {{!}}{{!}} | + | {{!}}{{!}}Console is successfully opened |
{{!}}{{!}}n/a | {{!}}{{!}}n/a | ||
{{!}}- | {{!}}- | ||
{{!}}{{!}}rejected | {{!}}{{!}}rejected | ||
− | {{!}}{{!}} | + | {{!}}{{!}}Console is already open |
{{!}}{{!}}'Already opened' | {{!}}{{!}}'Already opened' | ||
{{!}}} | {{!}}} | ||
Line 110: | Line 121: | ||
Closes the Console UI. | Closes the Console UI. | ||
====Example==== | ====Example==== | ||
− | <source lang= | + | <source lang="javascript"> |
oMyPlugin.command('Console.close').done(function(e){ | oMyPlugin.command('Console.close').done(function(e){ | ||
Line 130: | Line 141: | ||
{{!}}- | {{!}}- | ||
{{!}}{{!}}resolved | {{!}}{{!}}resolved | ||
− | {{!}}{{!}} | + | {{!}}{{!}}Console successfully closed |
{{!}}{{!}}n/a | {{!}}{{!}}n/a | ||
{{!}}- | {{!}}- | ||
{{!}}{{!}}rejected | {{!}}{{!}}rejected | ||
− | {{!}}{{!}} | + | {{!}}{{!}}Console is already closed |
{{!}}{{!}}'Already closed' | {{!}}{{!}}'Already closed' | ||
{{!}}} | {{!}}} | ||
Line 142: | Line 153: | ||
Modifies the Console configuration options. See the Console configuration page. | Modifies the Console configuration options. See the Console configuration page. | ||
====Example==== | ====Example==== | ||
− | <source lang= | + | <source lang="javascript"> |
oMyPlugin.command('Console.configure', { | oMyPlugin.command('Console.configure', { | ||
Line 167: | Line 178: | ||
{{!}}{{!}}open | {{!}}{{!}}open | ||
{{!}}{{!}}boolean | {{!}}{{!}}boolean | ||
− | {{!}}{{!}}If setting is open: true, the console will automatically be open when | + | {{!}}{{!}}If setting is open: true, the console will automatically be open when Widgets is launched and the console is ready. |
{{!}}} | {{!}}} | ||
Line 180: | Line 191: | ||
{{!}}- | {{!}}- | ||
{{!}}{{!}}resolved | {{!}}{{!}}resolved | ||
− | {{!}}{{!}} | + | {{!}}{{!}}Console configuration is provided |
{{!}}{{!}}n/a | {{!}}{{!}}n/a | ||
{{!}}- | {{!}}- | ||
{{!}}{{!}}rejected | {{!}}{{!}}rejected | ||
− | {{!}}{{!}} | + | {{!}}{{!}}No configuration is provided |
{{!}}{{!}}'Invalid Configuration' | {{!}}{{!}}'Invalid Configuration' | ||
{{!}}} | {{!}}} | ||
− | |||
|Status=No | |Status=No | ||
}}{{Section | }}{{Section | ||
− | |sectionHeading=API | + | |sectionHeading=API events |
− | | | + | |anchor=events |
− | |||
|alignment=Vertical | |alignment=Vertical | ||
|structuredtext=Once you've registered your plugin on the bus, you can subscribe to and listen for published events. Here's how to use the global bus object to register a new plugin on the bus. | |structuredtext=Once you've registered your plugin on the bus, you can subscribe to and listen for published events. Here's how to use the global bus object to register a new plugin on the bus. | ||
− | {{NoteFormat|The global bus object is a debugging tool. When implementing Widgets on your own site, do not use the global bus object to register your custom plugins. Instead, see {{Link- | + | {{NoteFormat|The global bus object is a debugging tool. When implementing Widgets on your own site, do not use the global bus object to register your custom plugins. Instead, see {{Link-AnywhereElse|product=WID|version=Current|manual=SDK|topic=GWCBusExtensions|display text=Genesys Widgets Extensions}} for more information about extending Genesys Widgets.|1}} |
− | <source lang= | + | <source lang="javascript">var oMyPlugin = window._genesys.widgets.bus.registerPlugin('MyPlugin'); |
oMyPlugin.subscribe('Console.ready', function(e){});</source> | oMyPlugin.subscribe('Console.ready', function(e){});</source> | ||
Line 212: | Line 221: | ||
{{!}}- | {{!}}- | ||
{{!}}{{!}}opened | {{!}}{{!}}opened | ||
− | {{!}}{{!}}The Console | + | {{!}}{{!}}The Console Widget has appeared on screen. |
{{!}}{{!}}n/a | {{!}}{{!}}n/a | ||
{{!}}- | {{!}}- | ||
{{!}}{{!}}closed | {{!}}{{!}}closed | ||
− | {{!}}{{!}}The Console | + | {{!}}{{!}}The Console Widget has been removed from the screen. |
{{!}}{{!}}n/a | {{!}}{{!}}n/a | ||
{{!}}} | {{!}}} | ||
− | |||
|Status=No | |Status=No | ||
}} | }} | ||
}} | }} |
Latest revision as of 13:14, October 12, 2021
Contents
Learn how to debug commands and events on the widget bus.
Overview
Use the Console Widget to debug commands and events on the widget bus. You can use dynamically populated lists to test, debug, or demo all commands. You can also create event watch lists that alert you when an event has fired.
Console provides an easy-to-use interface for debugging the widget bus that complements the standard command-line methods. You can drag and drop the console anywhere on your screen, and when you refresh the page or move to another one, Console reappears right where you left it. It is a great tool for getting to know the widget bus, the API for each widget, and debugging issues.
Usage
Launch WebChat manually by using the following methods:
Configuration
Description
Console option to open on initial loading.
Example
window._genesys.widgets.console = {open: true};
Options
Name | Type | Description | Default | Required |
---|---|---|---|---|
open | boolean | Set to true for console to open at start.
|
false | false |
Localization
Strings
{
"ConsoleTitle": "CXBus Console",
"Commands": "Commands",
"Plugin": "Plugin",
"ConsoleErrorButton": "OK",
"Execute": "Execute",
"Event": "Event",
"SubscribeTo": "Subscribe to",
"Unsubscribe": "Unsubscribe",
"ReturnData": "Return Data",
"EventsSubscriber": "Events Subscriber",
"Watch": "Watch",
"pluginNameEvent": "PluginName.Event",
"ClearAll": "Clear All",
"OptionsSample": "JSON Formatted Options {'option': value}"
}
API commands
Once you've registered your plugin on the bus, you can call commands on other registered plugins. Here's how to use the global bus object to register a new plugin on the bus.
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 | Console is successfully opened | n/a |
rejected | 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 | Console successfully closed | n/a |
rejected | Console is already closed | 'Already closed' |
configure
Modifies the Console configuration options. See the Console configuration page.
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 | Console configuration is provided | n/a |
rejected | No configuration is provided | 'Invalid Configuration' |
API events
Once you've registered your plugin on the bus, you can subscribe to and listen for published events. Here's how to use the global bus object to register a new plugin on the bus.
var oMyPlugin = window._genesys.widgets.bus.registerPlugin('MyPlugin');
oMyPlugin.subscribe('Console.ready', function(e){});
Name | Description | Data |
---|---|---|
ready | Console is initialized and ready to accept commands. | n/a |
opened | The Console Widget has appeared on screen. | n/a |
closed | The Console Widget has been removed from the screen. | n/a |