Class Index | File Index

Classes


Class finesse.containerservices.ContainerServices

This class provides container-level services for gadget developers, exposing container events by calling a set of exposed functions. Gadgets can utilize the container dialogs and event handling (add/remove).
Defined in: finesse.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
Method Attributes Method Name and Description
 
Make a request to set this container's tab active.
 
activateTab(tabId)
Make a request to set a particular tab active.
 
addHandler(topic, callback)
Adds a handler for one of the supported topics provided by ContainerServices.
 
Gets the id of the gadget.
 
Get the tabId of my container/gadget.
 
Hides the jQuery UI Dialog.
 
init(master)
Initialize ContainerServices for use in gadget.
 
Make a request to check the current tab.
 
Reloads the current gadget.
 
Updates the url for this gadget and then reload it.
 
removeHandler(topic, callback)
Removes a previously-added handler for one of the supported topics.
 
showDialog(options)
Shows the jQuery UI Dialog with the specified parameters.
 
Returns the visibility of current gadget.
Class Detail
finesse.containerservices.ContainerServices()
   containerServices = finesse.containerservices.ContainerServices.init();
   containerServices.addHandler(
     finesse.containerservices.ContainerServices.Topics.ACTIVE_TAB, 
     function() {
         clientLogs.log("Gadget is now visible");  // log to Finesse logger
         // automatically adjust the height of the gadget to show the html
         gadgets.window.adjustHeight();
     });
   containerServices.makeActiveTabReq();
Method Detail
activateMyTab()
Make a request to set this container's tab active. This method should be called after finesse.containerservices.ContainerServices#addHandler to ensure the gadget gets properly initialized.

activateTab(tabId)
Make a request to set a particular tab active. This method should be called after finesse.containerservices.ContainerServices#addHandler to ensure the gadget gets properly initialized.
Parameters:
{String} tabId
The tabId (not the label text) of the tab to make active. If the id is invalid, no action will occur.

addHandler(topic, callback)
Adds a handler for one of the supported topics provided by ContainerServices. The callbacks provided will be invoked when that topic is notified.
Parameters:
{String} topic
The Hub topic to which we are listening.
{Function} callback
The callback function to invoke.
See:
finesse.containerservices.ContainerServices.Topics
finesse.containerservices.ContainerServices#removeHandler

{number} getMyGadgetId()
Gets the id of the gadget.
Returns:
{number} the id of the gadget

{String} getMyTabId()
Get the tabId of my container/gadget.
Returns:
{String} tabid : The tabid of this container/gadget.

{jQuery} hideDialog()
Hides the jQuery UI Dialog.
Returns:
{jQuery} jQuery wrapped object of the dialog DOM element
See:
finesse.containerservices.ContainerServices#showDialog

init(master)
Initialize ContainerServices for use in gadget.
Parameters:
{Boolean} master Optional, Default: false
Do not use this parameter from your gadget.
Returns:
ContainerServices instance.

makeActiveTabReq()
Make a request to check the current tab. The activeTab event will be invoked if on the active tab. This method should be called after finesse.containerservices.ContainerServices#addHandler to ensure the gadget gets properly initialized.

reloadMyGadget()
Reloads the current gadget. For use from within a gadget only.

reloadMyGadgetFromUrl(url)
Updates the url for this gadget and then reload it. This allows the gadget to be reloaded from a different location than what is uploaded to the current server. For example, this would be useful for 3rd party gadgets to implement their own failover mechanisms. For use from within a gadget only.
Parameters:
{String} url
url from which to reload gadget

removeHandler(topic, callback)
Removes a previously-added handler for one of the supported topics.
Parameters:
{String} topic
The Hub topic from which we are removing the callback.
{Function} callback
The name of the callback function to remove.
See:
finesse.containerservices.ContainerServices.Topics
finesse.containerservices.ContainerServices#addHandler

{jQuery} showDialog(options)
Shows the jQuery UI Dialog with the specified parameters. The following are the default parameters:
Parameters:
{Object} options
An object containing additional options for the dialog.
{String/Boolean} options.title
Title to use. undefined defaults to "Cisco Finesse". false to hide
{Function} options.close
A function to invoke when the dialog is closed.
{String} options.message
The message to display in the dialog. Defaults to "A generic error has occurred."
{Boolean} options.isBlocking
Flag indicating whether this dialog will block other dialogs from being shown (Modal).
Returns:
{jQuery} JQuery wrapped object of the dialog DOM element.
See:
finesse.containerservices.ContainerServices#hideDialog

{Boolean} tabVisible()
Returns the visibility of current gadget. Note that this will not be set until after the initialization of the gadget.
Returns:
{Boolean} The visibility of current gadget.

Documentation generated by JsDoc Toolkit 2.3.2 on Thu Feb 23 2017 02:41:29 GMT-0500 (EST)