|
|
(3 intermediate revisions by 3 users not shown) |
Line 1: |
Line 1: |
| = API Commands = | | = 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.
| + | {{Template:PEC_Migrated}} |
| | | |
− | {{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');
| + | {{NoteFormat|Documentation for this software has moved to a new home. Please update links and bookmarks to content hosted at https://all.docs.genesys.com/WID/Current/SDK/Calendar-combined#API_Commands.}} |
− | | |
− | oMyPlugin.command('Calendar.reset');</source>
| |
− | | |
− | == configure ==
| |
− | Internal use only. The main App plugin shares configuration settings to widgets using each widget’s configure command. The configure command can only be called once at startup. Calling configure again after startup may result in unpredictable behavior.
| |
− | <br /><br />
| |
− | === Example ===
| |
− | <source lang='javascript'>
| |
− | oMyPlugin.command('Calendar.configure', {
| |
− | | |
− | showAvailability: true,
| |
− | numberOfDays: 7,
| |
− | calendarHours:{
| |
− | | |
− | interval: 3000,
| |
− | morning:{
| |
− | | |
− | enable: true,
| |
− | openTime: '08:00',
| |
− | closeTime: '11:00'
| |
− | },
| |
− | afternoon:{
| |
− | | |
− | enable: true,
| |
− | openTime: '11:01',
| |
− | closeTime: '14:30'
| |
− | },
| |
− | evening:{
| |
− | | |
− | enable: true,
| |
− | openTime: '14:31',
| |
− | closeTime: '18:00'
| |
− | },
| |
− | }
| |
− | }).done(function(e){
| |
− | | |
− | // Calendar configured successfully
| |
− | | |
− | }).fail(function(e){
| |
− | | |
− | // Calendar failed because of invalid configuration or invalid time is provided
| |
− | });
| |
− | </source>
| |
− | | |
− | <br />
| |
− | === Options ===
| |
− | {|
| |
− | |-
| |
− | ! Option
| |
− | ! Type
| |
− | ! Description
| |
− | |-
| |
− | | showAvailability
| |
− | | boolean | |
− | | Enable/disable calendar to update the timeslots based on the callback availability. The unavailable timeslots are greyed out.
| |
− | |-
| |
− | | numberOfDays
| |
− | | number
| |
− | | The number of days to display on calendar starting today.
| |
− | |-
| |
− | | calenderHours.interval
| |
− | | number
| |
− | | The time interval between each consecutive timeslot displayed on calendar.
| |
− | |-
| |
− | | calenderHours.morning.enable
| |
− | | boolean
| |
− | | Enable/Disable morning section in calendar.
| |
− | |-
| |
− | | calenderHours.morning.openTime
| |
− | | string
| |
− | | Morning section opening time in 'HH:MM' 24 Hr format.
| |
− | |-
| |
− | | calenderHours.morning.closeTime
| |
− | | string
| |
− | | Morning section closing time in 'HH:MM' 24 Hr format.
| |
− | |-
| |
− | | calenderHours.afternoon.enable
| |
− | | boolean
| |
− | | Enable/Disable afternoon section in calendar.
| |
− | |-
| |
− | | calenderHours.afternoon.openTime
| |
− | | string
| |
− | | Afternoon section opening time in 'HH:MM' 24 Hr format.
| |
− | |-
| |
− | | calenderHours.afternoon.closeTime
| |
− | | string
| |
− | | Afternoon section closing time in 'HH:MM' 24 Hr format.
| |
− | |-
| |
− | | calenderHours.evening.enable
| |
− | | boolean
| |
− | | Enable/Disable evening section in calendar.
| |
− | |-
| |
− | | calenderHours.evening.openTime
| |
− | | string
| |
− | | Evening section opening time in 'HH:MM' 24 Hr format.
| |
− | |-
| |
− | | calenderHours.evening.closeTime
| |
− | | string
| |
− | | Evening section closing time in 'HH:MM' 24 Hr format.
| |
− | |-
| |
− | |}
| |
− | <br />
| |
− | === Resolutions ===
| |
− | {|
| |
− | |-
| |
− | ! Status
| |
− | ! When
| |
− | ! Returns
| |
− | |-
| |
− | | resolved
| |
− | | When configuration options are provided and set
| |
− | | n/a
| |
− | |-
| |
− | | rejected
| |
− | | When no configuration options are provided
| |
− | | 'No configuration provided'
| |
− | |-
| |
− | | rejected
| |
− | | When invalid time is provided in Morning opening time section
| |
− | | 'Invalid config: morning open time'
| |
− | |-
| |
− | | rejected
| |
− | | When invalid time is provided in Morning closing time section
| |
− | | 'Invalid config: morning close time'
| |
− | |-
| |
− | | rejected
| |
− | | When invalid time is provided in Afternoon opening time section
| |
− | | 'Invalid config: afternoon open time'
| |
− | |-
| |
− | | rejected
| |
− | | When invalid time is provided in Afternoon closing time section
| |
− | | 'Invalid config: afternoon close time'
| |
− | |-
| |
− | | rejected
| |
− | | When invalid time is provided in Evening opening time section
| |
− | | 'Invalid config: evening open time'
| |
− | |-
| |
− | | rejected
| |
− | | When invalid time is provided in Evening closing time section
| |
− | | 'Invalid config: evening close time'
| |
− | |-
| |
− | |}
| |
− | == generate ==
| |
− | Builds and generates the calendar. Should subscribe to the events to get the generated calendar and display where you would like to.
| |
− | <br /><br />
| |
− | === Example ===
| |
− | <source lang='javascript'>
| |
− | oMyPlugin.command('Calendar.generate', {date: 'Mon Mar 20 2017 19:51:47 GMT-0700 (PDT)'}).done(function(e){
| |
− | | |
− | // Calendar generated successfully
| |
− | | |
− | }).fail(function(e){
| |
− | | |
− | // Calendar failed to generate
| |
− | });
| |
− | </source>
| |
− | | |
− | <br />
| |
− | === Options ===
| |
− | {|
| |
− | |-
| |
− | ! Option
| |
− | ! Type
| |
− | ! Description
| |
− | |-
| |
− | | date
| |
− | | Date string/object
| |
− | | To pre-select the date and time on calendar.
| |
− | |-
| |
− | |}
| |
− | <br />
| |
− | === Resolutions ===
| |
− | {|
| |
− | |-
| |
− | ! Status
| |
− | ! When
| |
− | ! Returns
| |
− | |-
| |
− | | resolved
| |
− | | When the calendar is successfully generated
| |
− | | n/a
| |
− | |-
| |
− | | rejected
| |
− | | When Invalid date is passed to calendar
| |
− | | 'Invalid data'
| |
− | |-
| |
− | |}
| |
− | == showAvailability ==
| |
− | Update the calendar timeslots with the callback availability. This enables only those timeslots that have the callback facility and disables the remaining.
| |
− | <br /><br />
| |
− | === Example ===
| |
− | <source lang='javascript'>
| |
− | oMyPlugin.command('Calendar.showAvailability', {date: '03/22/17'}).done(function(e){
| |
− | | |
− | // Calendar showed availability successfully
| |
− | | |
− | }).fail(function(e){
| |
− | | |
− | // Calendar failed to show availability
| |
− | });
| |
− | </source>
| |
− | | |
− | <br />
| |
− | === Options ===
| |
− | {|
| |
− | |-
| |
− | ! Option
| |
− | ! Type
| |
− | ! Description
| |
− | |-
| |
− | | date
| |
− | | Date string/object
| |
− | | Update the callback availability on calendar with the selected date.
| |
− | |-
| |
− | |}
| |
− | <br />
| |
− | === Resolutions ===
| |
− | {|
| |
− | |-
| |
− | ! Status
| |
− | ! When
| |
− | ! Returns
| |
− | |-
| |
− | | resolved
| |
− | | When timeslots are successfully updated
| |
− | | n/a
| |
− | |-
| |
− | | rejected
| |
− | | When no date value is found to check the availability
| |
− | | 'No date found to check availability'
| |
− | |-
| |
− | | rejected
| |
− | | When invalid date value is found
| |
− | | 'Invalid date'
| |
− | |-
| |
− | |}
| |
− | == reset ==
| |
− | Resets the calendar with no pre-selected values.
| |
− | <br /><br />
| |
− | === Example ===
| |
− | <source lang='javascript'>
| |
− | oMyPlugin.command('Calendar.reset').done(function(e){
| |
− | | |
− | // Calendar reset successfully
| |
− | | |
− | }).fail(function(e){
| |
− | | |
− | // Calendar failed to reset
| |
− | }); | |
− | </source>
| |
− | | |
− | <br />
| |
− | === Resolutions ===
| |
− | {|
| |
− | |-
| |
− | ! Status
| |
− | ! When
| |
− | ! Returns
| |
− | |-
| |
− | | resolved
| |
− | | When calendar is successfully reset
| |
− | | n/a
| |
− | |-
| |
− | |}
| |
| | | |
| [[Category:V:PSAAS:Public]] | | [[Category:V:PSAAS:Public]] |