Difference between revisions of "PEC-Developer/Current/SCAPI/SystemNamespace"

From Genesys Documentation
Jump to: navigation, search
 
Line 16: Line 16:
 
|structuredtext=The System namespace includes the following methods:
 
|structuredtext=The System namespace includes the following methods:
  
 +
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=amIVisible|display text=amIVisible}}
 +
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=closeDialog|display text=closeDialog}}
 +
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=closeToast|display text=closeToast}}
 +
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=closeViewInApplicationMenuBar|display text=closeViewInApplicationMenuBar}}
 
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=getAllowedServices|display text=getAllowedServices}}
 
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=getAllowedServices|display text=getAllowedServices}}
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=triggerActivity|display text=triggerActivity}}
 
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=popupToast|display text=popupToast}}
 
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=updateToast|display text=updateToast}}
 
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=closeToast|display text=closeToast}}
 
 
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=isFrameLeading|display text=isFrameLeading}}
 
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=isFrameLeading|display text=isFrameLeading}}
 
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=isFrameFollowing|display text=isFrameFollowing}}
 
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=isFrameFollowing|display text=isFrameFollowing}}
Line 26: Line 26:
 
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=isFrameLeadingOrNegotiating|display text=isFrameLeadingOrNegotiating}}
 
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=isFrameLeadingOrNegotiating|display text=isFrameLeadingOrNegotiating}}
 
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=isLastActiveFrame|display text=isLastActiveFrame}}
 
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=isLastActiveFrame|display text=isLastActiveFrame}}
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=amIVisible|display text=amIVisible}}
+
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=popupToast|display text=popupToast}}
 
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=openDialog|display text=openDialog}}
 
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=openDialog|display text=openDialog}}
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=closeDialog|display text=closeDialog}}
+
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=triggerActivity|display text=triggerActivity}}
 +
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=updateViewInApplicationMenuBar|display text=updateViewInApplicationMenuBar}}
 +
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=updateToast|display text=updateToast}}
 +
 
 +
===amIVisible===
  
===getAllowedServices===
 
 
{{{!}}
 
{{{!}}
 
!Signature
 
!Signature
{{!}}<static> getAllowedServices(succeeded, failed) → {Array.<string>}
+
{{!}}<static> amIVisible(succeeded, failed) → {boolean}
 
{{!}}-
 
{{!}}-
 
!Description
 
!Description
{{!}}Gets the list of allowed services, as determined by the {{Link-SomewhereInThisVersion|manual=SCAPI|topic=ServiceClientAPI|anchor=SecurityConfiguration|display text=Security configuration}}. If the domain of the web application that calls this method isn't listed in the [https://docs.genesys.com/Documentation/Options/Current/HTCC/GWS-interaction-workspace#service-client-api-accepted-web-content-origins service-client-api.accepted-web-content-origins] option, then this method fails.
+
{{!}}Get the current visibility state of the frame.
 
{{!}}-
 
{{!}}-
 
!Parameters
 
!Parameters
Line 55: Line 58:
 
{{!}}-
 
{{!}}-
 
!Returns
 
!Returns
{{!}}Array.<string>
+
{{!}}<tt>true</tt> if the frame is visible.
 
{{!}}}
 
{{!}}}
 +
====Sample request====
 +
<syntaxhighlight>
 +
setTimeout(function() {
 +
    genesys.wwe.service.system.amIVisible(succeeded, failed);
 +
}, 3000); // This gives 3 seconds to switch the panel to test.
 +
</syntaxhighlight>
 +
 +
====Sample response====
 +
The asynchronous answer is included in the <code>data</code> attribute:<syntaxhighlight>
 +
{
 +
  "request": "system.amIVisible",
 +
  "data": true,
 +
  "userAgent": "WWE Server",
 +
  "protocolVersion": 2
 +
}
 +
</syntaxhighlight>
  
===triggerActivity===
+
===closeDialog===
 
{{{!}}
 
{{{!}}
 
!Signature
 
!Signature
{{!}}<static> triggerActivity(succeeded, failed)
+
{{!}}<static> closeDialog(''dialogId'', ''succeeded'', ''failed'') → {boolean}
 
{{!}}-
 
{{!}}-
 
!Description
 
!Description
{{!}}Triggers a fake activity to prevent the [https://docs.genesys.com/Documentation/Options/Current/HTCC/GWS-interaction-workspace#security-inactivity-timeout inactivity timer] from closing the agent session.
+
{{!}}Close a previously opened dialog.
 
{{!}}-
 
{{!}}-
 
!Parameters
 
!Parameters
Line 72: Line 91:
 
!Type
 
!Type
 
!Description
 
!Description
 +
{{!}}-
 +
{{!}}dialogId
 +
{{!}}string
 +
{{!}}The dialog identifier (returned in the response of {{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=openDialog|display text=openDialog}}).
 
{{!}}-
 
{{!}}-
 
{{!}}succeeded
 
{{!}}succeeded
Line 81: Line 104:
 
{{!}}A function called when the operation fails.
 
{{!}}A function called when the operation fails.
 
{{!}}}
 
{{!}}}
 +
{{!}}-
 +
!Returns
 +
{{!}}<tt>true</tt> if the dialog is closed; <tt>false</tt> if the dialog is not found.
 
{{!}}}
 
{{!}}}
  
===popupToast===
+
===closeToast===
  
 
{{{!}}
 
{{{!}}
 
!Signature
 
!Signature
{{!}}<static> popupToast(''parameters'', succeeded, failed) → {string}
+
{{!}}<static> closeToast(''id'', succeeded, failed) → {boolean}
 
{{!}}-
 
{{!}}-
 
!Description
 
!Description
{{!}}Pops up a new custom toast.
+
{{!}}Closes the specified toast.
 
{{!}}-
 
{{!}}-
 
!Parameters
 
!Parameters
Line 99: Line 125:
 
!Description
 
!Description
 
{{!}}-
 
{{!}}-
{{!}}parameters
+
{{!}}id
{{!}}object
 
{{!}}
 
{{{!}} border="1"
 
{{!}}-
 
!Name
 
!Type
 
!Description
 
{{!}}-
 
{{!}}title
 
 
{{!}}string
 
{{!}}string
{{!}}The title
+
{{!}}The identifier of the toast to close. The identifier is returned by the {{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=popupToast|display text=popupToast}} method.
{{!}}-
 
{{!}}iconUrl
 
{{!}}string
 
{{!}}The URL of the icon you want to display in the title bar of the custom toast popup.
 
{{!}}-
 
{{!}}subject
 
{{!}}string
 
{{!}}Optional. The subject
 
{{!}}-
 
{{!}}message
 
{{!}}string
 
{{!}}Optional. The message
 
{{!}}-
 
{{!}}keyValues
 
{{!}}string
 
{{!}}Optional. JSON object used to fill the key value pair list. For example: <tt>{"key1" ; "value one","key2" ; "value two","key3" ; "value three"}</tt>.
 
{{!}}-
 
{{!}}buttons
 
{{!}}Array.<string>
 
{{!}}Optional. Each character string in this array becomes a button. All buttons are displayed as buttons, not hyperlinks, in the following order: [Button 2] [Button 3] ... [Button N] [Button 1].
 
{{!}}-
 
{{!}}buttonShowDismiss
 
{{!}}boolean
 
{{!}}Optional.  If set to <tt>true</tt>, displays the '''Show''' and '''Dismiss''' buttons and pops up the current iframe if the '''Show''' button is pushed. If set to <tt>false</tt> , displays '"OK"' or custom buttons based on the parameter's buttons.
 
{{!}}-
 
{{!}}autoCloseTimeout
 
{{!}}object
 
{{!}}Optional. If set to greater than <tt>0</tt>, the popup is automatically closed after the specified milliseconds.
 
{{!}}-
 
{{!}}sendToMyMessage
 
{{!}}object
 
{{!}}Optional. If set to <tt>true</tt>, sends the '''subject''', '''iconUrl''', '''title''', '''keyValues''', and  '''message''' parameters to the '''MyMessage''' panel.
 
{{!}}-
 
{{!}}width
 
{{!}}number
 
{{!}}Optional. The width of the custom toast popup, in pixels. This values takes precedence over the service-client-api.toast.width configuration option.
 
{{!}}}
 
 
{{!}}-
 
{{!}}-
 
{{!}}succeeded
 
{{!}}succeeded
Line 159: Line 139:
 
{{!}}-
 
{{!}}-
 
!Returns
 
!Returns
{{!}}A unique identifier
+
{{!}}<tt>true</tt> if the toast has been updated; <tt>false</tt> if the toast identifier has not been found.
 
{{!}}}
 
{{!}}}
  
===updateToast===
+
===closeViewInApplicationMenuBar===
 
 
 
{{{!}}
 
{{{!}}
 
!Signature
 
!Signature
{{!}}<static> updateToast(''id'', ''parameters'', succeeded, failed) → {boolean}
+
{{!}}<static>closeViewInApplicationMenuBar(parameters, succeeded, failed) → {boolean}
 
{{!}}-
 
{{!}}-
 
!Description
 
!Description
{{!}}Updates the specified toast.
+
{{!}}Removes the given view from the '''Application Menu''' bar region.
 
{{!}}-
 
{{!}}-
 
!Parameters
 
!Parameters
Line 178: Line 157:
 
!Description
 
!Description
 
{{!}}-
 
{{!}}-
{{!}}id
+
{{!}}name
{{!}}string
 
{{!}}The identifier of the toast to update. The identifier is returned by the {{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=popupToast|display text=popupToast}} method.
 
{{!}}-
 
{{!}}parameters
 
{{!}}object
 
{{!}}
 
{{{!}} border="1"
 
{{!}}-
 
!Name
 
!Type
 
!Description
 
{{!}}-
 
{{!}}title
 
{{!}}string
 
{{!}}The title
 
{{!}}-
 
{{!}}iconURL
 
{{!}}string
 
{{!}}The URL of the icon you want to display in the title bar of the custom toast popup.
 
{{!}}-
 
{{!}}subject
 
{{!}}string
 
{{!}}Optional. The subject.
 
{{!}}-
 
{{!}}message
 
 
{{!}}string
 
{{!}}string
{{!}}Optional. The message.
+
{{!}}The name of the custom view to be removed.
{{!}}-
 
{{!}}keyValues
 
{{!}}object
 
{{!}}Optional. JSON object used to fill the key value pair list. For example: <tt>{"key1" : "value one","key2" : "value two","key3" : "value three"}</tt>.
 
{{!}}-
 
{{!}}buttons
 
{{!}}Array.<string>
 
{{!}}Each character string in this array becomes a button. All buttons are displayed as buttons, not hyperlinks, in the following order: [Button 2] [Button 3] ... [Button N] [Button 1].
 
{{!}}-
 
{{!}}buttonShowDismiss
 
{{!}}boolean
 
{{!}}If  set to <tt>true</tt>, displays '''Show''' and '''Dismiss''' buttons and pops up the current iframe if the '''Show'''  button is pushed. If set to <tt>false</tt>,  displays '"OK"' or custom buttons based on the parameter's buttons.
 
{{!}}}
 
 
{{!}}-
 
{{!}}-
 
{{!}}succeeded
 
{{!}}succeeded
Line 230: Line 171:
 
{{!}}-
 
{{!}}-
 
!Returns
 
!Returns
{{!}}<tt>true</tt> if the toast has been updated; <tt>false</tt> if the toast identifier has not been found.
+
{{!}}<tt>true</tt> if the view is removed; <tt>false</tt> if the view name is not found.
 
{{!}}}
 
{{!}}}
 +
====Sample request====
 +
<syntaxhighlight>
 +
genesys.wwe.service.system.closeViewInApplicationMenuBar("view1", succeeded, failed)
 +
</syntaxhighlight>
  
===closeToast===
+
====Sample response====
 +
<syntaxhighlight>
 +
{
 +
  "request": "system.closeViewInApplicationMenuBar",
 +
    "data": true,
 +
    "userAgent": "WWE Server",
 +
    "protocolVersion": 2
 +
}
 +
</syntaxhighlight>
 +
 
 +
====Sample request====
 +
<syntaxhighlight>
 +
genesys.wwe.service.system.closeDialog("wweCustomDialog1", succeeded, failed)
 +
</syntaxhighlight>
 +
 
 +
====Sample response====
 +
The asynchronous answer is included in the <code>data</code> attribute:<syntaxhighlight>
 +
{
 +
    "request": "system.closeDialog",
 +
    "data": true,
 +
    "userAgent": "WWE Server",
 +
    "protocolVersion": 2
 +
}
 +
</syntaxhighlight>
  
 +
===getAllowedServices===
 
{{{!}}
 
{{{!}}
 
!Signature
 
!Signature
{{!}}<static> closeToast(''id'', succeeded, failed) → {boolean}
+
{{!}}<static> getAllowedServices(succeeded, failed) → {Array.<string>}
 
{{!}}-
 
{{!}}-
 
!Description
 
!Description
{{!}}Closes the specified toast.
+
{{!}}Gets the list of allowed services, as determined by the {{Link-SomewhereInThisVersion|manual=SCAPI|topic=ServiceClientAPI|anchor=SecurityConfiguration|display text=Security configuration}}. If the domain of the web application that calls this method isn't listed in the [https://docs.genesys.com/Documentation/Options/Current/HTCC/GWS-interaction-workspace#service-client-api-accepted-web-content-origins service-client-api.accepted-web-content-origins] option, then this method fails.
 
{{!}}-
 
{{!}}-
 
!Parameters
 
!Parameters
Line 248: Line 217:
 
!Type
 
!Type
 
!Description
 
!Description
{{!}}-
 
{{!}}id
 
{{!}}string
 
{{!}}The identifier of the toast to close. The identifier is returned by the {{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=popupToast|display text=popupToast}} method.
 
 
{{!}}-
 
{{!}}-
 
{{!}}succeeded
 
{{!}}succeeded
Line 263: Line 228:
 
{{!}}-
 
{{!}}-
 
!Returns
 
!Returns
{{!}}<tt>true</tt> if the toast has been updated; <tt>false</tt> if the toast identifier has not been found.
+
{{!}}Array.<string>
 
{{!}}}
 
{{!}}}
  
Line 410: Line 375:
 
{{!}}<tt>true</tt> if this is the last active browser tab.
 
{{!}}<tt>true</tt> if this is the last active browser tab.
 
{{!}}}
 
{{!}}}
===amIVisible===
 
  
 +
===openDialog===
 
{{{!}}
 
{{{!}}
 
!Signature
 
!Signature
{{!}}<static> amIVisible(succeeded, failed) → {boolean}
+
{{!}}<static> openDialog(''url'', ''options'', ''succeeded'', ''failed'') → {string}
 
{{!}}-
 
{{!}}-
 
!Description
 
!Description
{{!}}Get the current visibility state of the frame.
+
{{!}}Open an iframe in a dialog, based on the configured parameters.
 
{{!}}-
 
{{!}}-
 
!Parameters
 
!Parameters
Line 425: Line 390:
 
!Type
 
!Type
 
!Description
 
!Description
 +
{{!}}-
 +
{{!}}url
 +
{{!}}string
 +
{{!}}The URL of the iframe to load in the dialog.
 +
{{!}}-
 +
{{!}}options
 +
{{!}}object
 +
{{!}}Optional parameters to configure the dialog. This value can't be null, so you must pass <code>{}</code> if there are no specific options. You can include any of the following options:
 +
 +
*label - Set a custom value for the [https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute aria-label] attribute on the dialog. When the dialog pops up, this value identifies it to accessibility tools like screen readers.
 +
*width - The initial width of the dialog. Valid formats are px or %.
 +
*height - The initial height of the dialog. Valid formats are px or %.
 
{{!}}-
 
{{!}}-
 
{{!}}succeeded
 
{{!}}succeeded
Line 436: Line 413:
 
{{!}}-
 
{{!}}-
 
!Returns
 
!Returns
{{!}}<tt>true</tt> if the frame is visible.
+
{{!}}The dialog identifier or null if the <code>url</code> parameter is not defined.
 
{{!}}}
 
{{!}}}
 +
 
====Sample request====
 
====Sample request====
 
<syntaxhighlight>
 
<syntaxhighlight>
setTimeout(function() {
+
genesys.wwe.service.system.openDialog("<url>", {
    genesys.wwe.service.system.amIVisible(succeeded, failed);
+
  label: "Dialog $Agent.FullName$",
}, 3000); // This gives 3 seconds to switch the panel to test.
+
  width: "430px",
 +
  height: "325px"
 +
}, succeeded, failed)
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 448: Line 428:
 
The asynchronous answer is included in the <code>data</code> attribute:<syntaxhighlight>
 
The asynchronous answer is included in the <code>data</code> attribute:<syntaxhighlight>
 
{
 
{
  "request": "system.amIVisible",
+
    "request": "system.openDialog",
  "data": true,
+
    "data": "wweCustomDialog1",
  "userAgent": "WWE Server",
+
    "userAgent": "WWE Server",
  "protocolVersion": 2
+
    "protocolVersion": 2
 
}
 
}
 
</syntaxhighlight>
 
</syntaxhighlight>
  
===openDialog===
+
===popupToast===
 +
 
 
{{{!}}
 
{{{!}}
 
!Signature
 
!Signature
{{!}}<static> openDialog(''url'', ''options'', ''succeeded'', ''failed'') → {string}
+
{{!}}<static> popupToast(''parameters'', succeeded, failed) → {string}
 
{{!}}-
 
{{!}}-
 
!Description
 
!Description
{{!}}Open an iframe in a dialog, based on the configured parameters.
+
{{!}}Pops up a new custom toast.
 
{{!}}-
 
{{!}}-
 
!Parameters
 
!Parameters
Line 470: Line 451:
 
!Description
 
!Description
 
{{!}}-
 
{{!}}-
{{!}}url
+
{{!}}parameters
 +
{{!}}object
 +
{{!}}
 +
{{{!}} border="1"
 +
{{!}}-
 +
!Name
 +
!Type
 +
!Description
 +
{{!}}-
 +
{{!}}title
 +
{{!}}string
 +
{{!}}The title
 +
{{!}}-
 +
{{!}}iconUrl
 +
{{!}}string
 +
{{!}}The URL of the icon you want to display in the title bar of the custom toast popup.
 +
{{!}}-
 +
{{!}}subject
 +
{{!}}string
 +
{{!}}Optional. The subject
 +
{{!}}-
 +
{{!}}message
 +
{{!}}string
 +
{{!}}Optional. The message
 +
{{!}}-
 +
{{!}}keyValues
 
{{!}}string
 
{{!}}string
{{!}}The URL of the iframe to load in the dialog.
+
{{!}}Optional. JSON object used to fill the key value pair list. For example: <tt>{"key1" ; "value one","key2" ; "value two","key3" ; "value three"}</tt>.
 +
{{!}}-
 +
{{!}}buttons
 +
{{!}}Array.<string>
 +
{{!}}Optional. Each character string in this array becomes a button. All buttons are displayed as buttons, not hyperlinks, in the following order: [Button 2] [Button 3] ... [Button N] [Button 1].
 +
{{!}}-
 +
{{!}}buttonShowDismiss
 +
{{!}}boolean
 +
{{!}}Optional.  If set to <tt>true</tt>, displays the '''Show''' and '''Dismiss''' buttons and pops up the current iframe if the '''Show''' button is pushed. If set to <tt>false</tt> , displays '"OK"' or custom buttons based on the parameter's buttons.
 +
{{!}}-
 +
{{!}}autoCloseTimeout
 +
{{!}}object
 +
{{!}}Optional. If set to greater than <tt>0</tt>, the popup is automatically closed after the specified milliseconds.
 
{{!}}-
 
{{!}}-
{{!}}options
+
{{!}}sendToMyMessage
 
{{!}}object
 
{{!}}object
{{!}}Optional parameters to configure the dialog. This value can't be null, so you must pass <code>{}</code> if there are no specific options. You can include any of the following options:
+
{{!}}Optional. If set to <tt>true</tt>, sends the '''subject''', '''iconUrl''', '''title''', '''keyValues''', and  '''message''' parameters to the '''MyMessage''' panel.
 +
{{!}}-
 +
{{!}}width
 +
{{!}}number
 +
{{!}}Optional. The width of the custom toast popup, in pixels. This values takes precedence over the service-client-api.toast.width configuration option.
 +
{{!}}}
 +
{{!}}-
 +
{{!}}succeeded
 +
{{!}}function
 +
{{!}}A function called when the operation succeeds.
 +
{{!}}-
 +
{{!}}failed
 +
{{!}}function
 +
{{!}}A function called when the operation fails.
 +
{{!}}}
 +
{{!}}-
 +
!Returns
 +
{{!}}A unique identifier
 +
{{!}}}
 +
 
 +
===triggerActivity===
 +
{{{!}}
 +
!Signature
 +
{{!}}<static> triggerActivity(succeeded, failed)
 +
{{!}}-
 +
!Description
 +
{{!}}Triggers a fake activity to prevent the [https://docs.genesys.com/Documentation/Options/Current/HTCC/GWS-interaction-workspace#security-inactivity-timeout inactivity timer] from closing the agent session.
 +
{{!}}-
 +
!Parameters
 +
{{!}}
 +
{{{!}}
 +
!Name
 +
!Type
 +
!Description
 +
{{!}}-
 +
{{!}}succeeded
 +
{{!}}function
 +
{{!}}A function called when the operation succeeds.
 +
{{!}}-
 +
{{!}}failed
 +
{{!}}function
 +
{{!}}A function called when the operation fails.
 +
{{!}}}
 +
{{!}}}
  
*label - Set a custom value for the [https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute aria-label] attribute on the dialog. When the dialog pops up, this value identifies it to accessibility tools like screen readers.
+
===updateViewInApplicationMenuBar===
*width - The initial width of the dialog. Valid formats are px or %.
+
{{{!}}
*height - The initial height of the dialog. Valid formats are px or %.
+
!Signature
 +
{{!}}<static>updateViewInApplicationMenuBar(parameters, succeeded, failed) → {string}
 +
{{!}}-
 +
!Description
 +
{{!}}Creates a custom view in the '''Application Menu bar''' region.
 +
{{!}}-
 +
!Parameters
 +
{{!}}
 +
{{{!}}
 +
!Name
 +
!Type
 +
!Description
 +
{{!}}-
 +
{{!}}name
 +
{{!}}string
 +
{{!}}A unique name for the custom view of the '''Application Menu bar''' that is to be created or updated. If a view with the given name already exists, it will be updated, otherwise, a new view will be created.
 +
{{!}}-
 +
{{!}}iconUrl
 +
{{!}}string
 +
{{!}}The URL of the icon you want to display in the custom view of the '''Application Menu bar''' region. This parameter is mandatory if '''label''' is not provided.
 +
{{!}}-
 +
{{!}}label
 +
{{!}}string
 +
{{!}}The main textual content to be displayed for the custom view. This parameter is mandatory if '''iconUrl''' is not provided.
 +
{{!}}-
 +
{{!}}shortLabel
 +
{{!}}string
 +
{{!}}Optional. A shorter version of the '''label''' that will be used in the shortened mode if '''iconUrl''' is not available.
 +
{{!}}-
 +
{{!}}tooltip
 +
{{!}}string
 +
{{!}}Optional. The tooltip content to be shown when the mouse is hovered on the custom view.
 +
{{!}}-
 +
{{!}}labelColor
 +
{{!}}string
 +
{{!}}Optional. The color of the label text in case-insensitive hex color code format, for example, #FFFFF.
 +
{{!}}-
 +
{{!}}backgroundColor
 +
{{!}}string
 +
{{!}}Optional. The background color of the region where icon and title are displayed. The format of the background color is case-insensitive hex color code, for example, #FFFFF. By default, it is usually the same color as the navigation bar.
 
{{!}}-
 
{{!}}-
 
{{!}}succeeded
 
{{!}}succeeded
Line 492: Line 592:
 
{{!}}-
 
{{!}}-
 
!Returns
 
!Returns
{{!}}The dialog identifier or null if the <code>url</code> parameter is not defined.
+
{{!}}View name if successful.
 
{{!}}}
 
{{!}}}
  
 
====Sample request====
 
====Sample request====
<syntaxhighlight>
+
<syntaxhighlight>genesys.wwe.service.system.updateViewInApplicationMenuBar({
genesys.wwe.service.system.openDialog("<url>", {
+
    name: "view1",
  label: "Dialog $Agent.FullName$",
+
    iconUrl: "https://cdn1.iconfinder.com/data/icons/free-social-media-12/32/RSS_social_media-128.png",
  width: "430px",
+
    label: "Main content text",
  height: "325px"
+
    shortLabel: "Short text"
}, succeeded, failed)
+
    tooltip: "Tooltip text",
</syntaxhighlight>
+
    labelColor: "#FFFFF",
 +
    backgroundColor: "#00000"
 +
}, succeeded, failed)'
 +
</syntaxhighlight>
  
 
====Sample response====
 
====Sample response====
The asynchronous answer is included in the <code>data</code> attribute:<syntaxhighlight>
+
<syntaxhighlight>
 
{
 
{
     "request": "system.openDialog",
+
     "request": "system.updateViewInApplicationMenuBar",
     "data": "wweCustomDialog1",
+
     "data": "view1",
 
     "userAgent": "WWE Server",
 
     "userAgent": "WWE Server",
 
     "protocolVersion": 2
 
     "protocolVersion": 2
Line 514: Line 617:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
===closeDialog===
+
===updateToast===
 +
 
 
{{{!}}
 
{{{!}}
 
!Signature
 
!Signature
{{!}}<static> closeDialog(''dialogId'', ''succeeded'', ''failed'') → {boolean}
+
{{!}}<static> updateToast(''id'', ''parameters'', succeeded, failed) → {boolean}
 
{{!}}-
 
{{!}}-
 
!Description
 
!Description
{{!}}Close a previously opened dialog.
+
{{!}}Updates the specified toast.
 
{{!}}-
 
{{!}}-
 
!Parameters
 
!Parameters
Line 529: Line 633:
 
!Description
 
!Description
 
{{!}}-
 
{{!}}-
{{!}}dialogId
+
{{!}}id
 +
{{!}}string
 +
{{!}}The identifier of the toast to update. The identifier is returned by the {{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=popupToast|display text=popupToast}} method.
 +
{{!}}-
 +
{{!}}parameters
 +
{{!}}object
 +
{{!}}
 +
{{{!}} border="1"
 +
{{!}}-
 +
!Name
 +
!Type
 +
!Description
 +
{{!}}-
 +
{{!}}title
 +
{{!}}string
 +
{{!}}The title
 +
{{!}}-
 +
{{!}}iconURL
 +
{{!}}string
 +
{{!}}The URL of the icon you want to display in the title bar of the custom toast popup.
 +
{{!}}-
 +
{{!}}subject
 +
{{!}}string
 +
{{!}}Optional. The subject.
 +
{{!}}-
 +
{{!}}message
 
{{!}}string
 
{{!}}string
{{!}}The dialog identifier (returned in the response of {{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=openDialog|display text=openDialog}}).
+
{{!}}Optional. The message.
 +
{{!}}-
 +
{{!}}keyValues
 +
{{!}}object
 +
{{!}}Optional. JSON object used to fill the key value pair list. For example: <tt>{"key1" : "value one","key2" : "value two","key3" : "value three"}</tt>.
 +
{{!}}-
 +
{{!}}buttons
 +
{{!}}Array.<string>
 +
{{!}}Each character string in this array becomes a button. All buttons are displayed as buttons, not hyperlinks, in the following order: [Button 2] [Button 3] ... [Button N] [Button 1].
 +
{{!}}-
 +
{{!}}buttonShowDismiss
 +
{{!}}boolean
 +
{{!}}If  set to <tt>true</tt>, displays '''Show''' and '''Dismiss''' buttons and pops up the current iframe if the '''Show'''  button is pushed. If set to <tt>false</tt>,  displays '"OK"' or custom buttons based on the parameter's buttons.
 +
{{!}}}
 
{{!}}-
 
{{!}}-
 
{{!}}succeeded
 
{{!}}succeeded
Line 543: Line 685:
 
{{!}}-
 
{{!}}-
 
!Returns
 
!Returns
{{!}}<tt>true</tt> if the dialog is closed; <tt>false</tt> if the dialog is not found.
+
{{!}}<tt>true</tt> if the toast has been updated; <tt>false</tt> if the toast identifier has not been found.
 
{{!}}}
 
{{!}}}
 
====Sample request====
 
<syntaxhighlight>
 
genesys.wwe.service.system.closeDialog("wweCustomDialog1", succeeded, failed)
 
</syntaxhighlight>
 
 
====Sample response====
 
The asynchronous answer is included in the <code>data</code> attribute:<syntaxhighlight>
 
{
 
    "request": "system.closeDialog",
 
    "data": true,
 
    "userAgent": "WWE Server",
 
    "protocolVersion": 2
 
}
 
</syntaxhighlight>
 
 
|Status=No
 
|Status=No
 
}}
 
}}
 
}}
 
}}

Latest revision as of 11:31, March 28, 2023

This topic is part of the manual Service Client API Reference for version Current of Developer.

Learn about the System namespace methods in the Service Client API.

Important
Depending on your environment, you might need to contact your Genesys representative to complete the configuration described on this page.

Methods

The System namespace includes the following methods:

amIVisible

Signature <static> amIVisible(succeeded, failed) → {boolean}
Description Get the current visibility state of the frame.
Parameters
Name Type Description
succeeded function A function called when the operation succeeds.
failed function A function called when the operation fails.
Returns true if the frame is visible.

Sample request

setTimeout(function() {
    genesys.wwe.service.system.amIVisible(succeeded, failed);
}, 3000); // This gives 3 seconds to switch the panel to test.

Sample response

The asynchronous answer is included in the data attribute:
{
  "request": "system.amIVisible",
  "data": true,
  "userAgent": "WWE Server",
  "protocolVersion": 2
}

closeDialog

Signature <static> closeDialog(dialogId, succeeded, failed) → {boolean}
Description Close a previously opened dialog.
Parameters
Name Type Description
dialogId string The dialog identifier (returned in the response of openDialog).
succeeded function A function called when the operation succeeds.
failed function A function called when the operation fails.
Returns true if the dialog is closed; false if the dialog is not found.

closeToast

Signature <static> closeToast(id, succeeded, failed) → {boolean}
Description Closes the specified toast.
Parameters
Name Type Description
id string The identifier of the toast to close. The identifier is returned by the popupToast method.
succeeded function A function called when the operation succeeds.
failed function A function called when the operation fails.
Returns true if the toast has been updated; false if the toast identifier has not been found.

closeViewInApplicationMenuBar

Signature <static>closeViewInApplicationMenuBar(parameters, succeeded, failed) → {boolean}
Description Removes the given view from the Application Menu bar region.
Parameters
Name Type Description
name string The name of the custom view to be removed.
succeeded function A function called when the operation succeeds.
failed function A function called when the operation fails.
Returns true if the view is removed; false if the view name is not found.

Sample request

genesys.wwe.service.system.closeViewInApplicationMenuBar("view1", succeeded, failed)

Sample response

{
   "request": "system.closeViewInApplicationMenuBar",
    "data": true,
    "userAgent": "WWE Server",
    "protocolVersion": 2
}

Sample request

genesys.wwe.service.system.closeDialog("wweCustomDialog1", succeeded, failed)

Sample response

The asynchronous answer is included in the data attribute:
{
    "request": "system.closeDialog",
    "data": true,
    "userAgent": "WWE Server",
    "protocolVersion": 2
}

getAllowedServices

Signature <static> getAllowedServices(succeeded, failed) → {Array.<string>}
Description Gets the list of allowed services, as determined by the Security configuration. If the domain of the web application that calls this method isn't listed in the service-client-api.accepted-web-content-origins option, then this method fails.
Parameters
Name Type Description
succeeded function A function called when the operation succeeds.
failed function A function called when the operation fails.
Returns Array.<string>

isFrameLeading

Signature <static> isFrameLeading(succeeded, failed) → {boolean}
Description Find out if the browser tab is leading.
Parameters
Name Type Description
succeeded function A function called when the operation succeeds.
failed function A function called when the operation fails.
Returns true if the browser tab is the leader.

isFrameFollowing

Signature <static> isFrameFollowing(succeeded, failed) → {boolean}
Description Find out if the browser tab is following.
Parameters
Name Type Description
succeeded function A function called when the operation succeeds.
failed function A function called when the operation fails.
Returns true if this browser tab is following.

isFrameNegotiating

Signature <static> isFrameNegotiating(succeeded, failed) → {boolean}
Description Find out if there is an election in progress and the browser tab state is not yet set to leading or following (the tab is "negotiating.")
Parameters
Name Type Description
succeeded function A function called when the operation succeeds.
failed function A function called when the operation fails.
Returns true if the tab is negotiating.

isFrameLeadingOrNegotiating

Signature <static> isFrameLeadingOrNegotiating(succeeded, failed) → {boolean}
Description Find out if the browser tab is leading or there is an election in progress and the tab state is not yet set to leading or following (the tab is "negotiating.").
Parameters
Name Type Description
succeeded function A function called when the operation succeeds.
failed function A function called when the operation fails.
Returns true if the browser tab is leading or negotiating.

isLastActiveFrame

Signature <static> isLastActiveFrame(succeeded, failed) → {boolean}
Description Find out if this is the last active browser tab.
Parameters
Name Type Description
succeeded function A function called when the operation succeeds.
failed function A function called when the operation fails.
Returns true if this is the last active browser tab.

openDialog

Signature <static> openDialog(url, options, succeeded, failed) → {string}
Description Open an iframe in a dialog, based on the configured parameters.
Parameters
Name Type Description
url string The URL of the iframe to load in the dialog.
options object Optional parameters to configure the dialog. This value can't be null, so you must pass {} if there are no specific options. You can include any of the following options:
  • label - Set a custom value for the aria-label attribute on the dialog. When the dialog pops up, this value identifies it to accessibility tools like screen readers.
  • width - The initial width of the dialog. Valid formats are px or %.
  • height - The initial height of the dialog. Valid formats are px or %.
succeeded function A function called when the operation succeeds.
failed function A function called when the operation fails.
Returns The dialog identifier or null if the url parameter is not defined.

Sample request

genesys.wwe.service.system.openDialog("<url>", {
  label: "Dialog $Agent.FullName$",
  width: "430px",
  height: "325px"
}, succeeded, failed)

Sample response

The asynchronous answer is included in the data attribute:
{
    "request": "system.openDialog",
    "data": "wweCustomDialog1",
    "userAgent": "WWE Server",
    "protocolVersion": 2
}

popupToast

Signature <static> popupToast(parameters, succeeded, failed) → {string}
Description Pops up a new custom toast.
Parameters
Name Type Description
parameters object
Name Type Description
title string The title
iconUrl string The URL of the icon you want to display in the title bar of the custom toast popup.
subject string Optional. The subject
message string Optional. The message
keyValues string Optional. JSON object used to fill the key value pair list. For example: {"key1" ; "value one","key2" ; "value two","key3" ; "value three"}.
buttons Array.<string> Optional. Each character string in this array becomes a button. All buttons are displayed as buttons, not hyperlinks, in the following order: [Button 2] [Button 3] ... [Button N] [Button 1].
buttonShowDismiss boolean Optional. If set to true, displays the Show and Dismiss buttons and pops up the current iframe if the Show button is pushed. If set to false , displays '"OK"' or custom buttons based on the parameter's buttons.
autoCloseTimeout object Optional. If set to greater than 0, the popup is automatically closed after the specified milliseconds.
sendToMyMessage object Optional. If set to true, sends the subject, iconUrl, title, keyValues, and message parameters to the MyMessage panel.
width number Optional. The width of the custom toast popup, in pixels. This values takes precedence over the service-client-api.toast.width configuration option.
succeeded function A function called when the operation succeeds.
failed function A function called when the operation fails.
Returns A unique identifier

triggerActivity

Signature <static> triggerActivity(succeeded, failed)
Description Triggers a fake activity to prevent the inactivity timer from closing the agent session.
Parameters
Name Type Description
succeeded function A function called when the operation succeeds.
failed function A function called when the operation fails.

updateViewInApplicationMenuBar

Signature <static>updateViewInApplicationMenuBar(parameters, succeeded, failed) → {string}
Description Creates a custom view in the Application Menu bar region.
Parameters
Name Type Description
name string A unique name for the custom view of the Application Menu bar that is to be created or updated. If a view with the given name already exists, it will be updated, otherwise, a new view will be created.
iconUrl string The URL of the icon you want to display in the custom view of the Application Menu bar region. This parameter is mandatory if label is not provided.
label string The main textual content to be displayed for the custom view. This parameter is mandatory if iconUrl is not provided.
shortLabel string Optional. A shorter version of the label that will be used in the shortened mode if iconUrl is not available.
tooltip string Optional. The tooltip content to be shown when the mouse is hovered on the custom view.
labelColor string Optional. The color of the label text in case-insensitive hex color code format, for example, #FFFFF.
backgroundColor string Optional. The background color of the region where icon and title are displayed. The format of the background color is case-insensitive hex color code, for example, #FFFFF. By default, it is usually the same color as the navigation bar.
succeeded function A function called when the operation succeeds.
failed function A function called when the operation fails.
Returns View name if successful.

Sample request

genesys.wwe.service.system.updateViewInApplicationMenuBar({
    name: "view1",
    iconUrl: "https://cdn1.iconfinder.com/data/icons/free-social-media-12/32/RSS_social_media-128.png",
    label: "Main content text",
    shortLabel: "Short text"
    tooltip: "Tooltip text",
    labelColor: "#FFFFF",
    backgroundColor: "#00000"
}, succeeded, failed)'

Sample response

{
    "request": "system.updateViewInApplicationMenuBar",
    "data": "view1",
    "userAgent": "WWE Server",
    "protocolVersion": 2
}

updateToast

Signature <static> updateToast(id, parameters, succeeded, failed) → {boolean}
Description Updates the specified toast.
Parameters
Name Type Description
id string The identifier of the toast to update. The identifier is returned by the popupToast method.
parameters object
Name Type Description
title string The title
iconURL string The URL of the icon you want to display in the title bar of the custom toast popup.
subject string Optional. The subject.
message string Optional. The message.
keyValues object Optional. JSON object used to fill the key value pair list. For example: {"key1" : "value one","key2" : "value two","key3" : "value three"}.
buttons Array.<string> Each character string in this array becomes a button. All buttons are displayed as buttons, not hyperlinks, in the following order: [Button 2] [Button 3] ... [Button N] [Button 1].
buttonShowDismiss boolean If set to true, displays Show and Dismiss buttons and pops up the current iframe if the Show button is pushed. If set to false, displays '"OK"' or custom buttons based on the parameter's buttons.
succeeded function A function called when the operation succeeds.
failed function A function called when the operation fails.
Returns true if the toast has been updated; false if the toast identifier has not been found.
Comments or questions about this documentation? Contact us for support!