Zimlet JavaScript API Reference - ZmZimbraMail

Class ZmZimbraMail


Extends ZmController.

This class is the "ubercontroller", as it manages all the apps as well as bootstrapping the ZimbraMail application.

Defined in: ZmZimbraMail.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
ZmZimbraMail(params)
Creates a controller to run ZimbraMail.
Method Summary
Method Attributes Method Name and Description
 
activateApp(appName, force, callback, errorCallback, params)
Activates the given application.
 
addApp(app)
Adds the application.
 
addAppListener(app, type, listener)
Adds a listener for the given event type and app.
<static>  
ZmZimbraMail.addAppListener(appName, type, listener)
Static function to add an app listener before this class has been instantiated.
 
addListener(type, listener)
Adds a listener for the given event type.
<static>  
ZmZimbraMail.addListener(type, listener)
Static function to add a listener before this class has been instantiated.
 
addPostRenderCallback(callback, order, delay, runNow)
Sets up a callback to be run after the starting app has rendered, if we're doing post-render callbacks.
 
appRendered(appName)
An app calls this once it has fully rendered, so that we may notify any listeners.
 
cancelRequest(reqId, errorCallback, noBusyOverlay)
Cancels the request.
 
Dismisses the displayed status message, if any
<static>  
ZmZimbraMail.exitSession()
Logs user off when session has expired and user has choosen to stay on page when prompted
 
Focuses on the content pane.
 
Focuses on the toolbar.
 
Gets the active app.
 
getApp(appName)
Gets a handle to the given app.
 
Gets the application chooser.
 
Gets the app chooser button.
 
Gets a handle to the app view manager.
<static>  
ZmZimbraMail.getConfirmExitMethod()
Return the confirmExitMethod that can be used for window.onbeforeunload
 
getDropMenuOptions(parent, parentElement, adminUrl)
Adds a "help" submenu.
 
getHelpButton(parent)
Adds a "help" submenu.
 
Gets the "instant notification" setting.
 
Gets the key map manager.
 
Gets the key map name.
 
Gets the previous application.
 
handleKeyAction(actionCode, ev)
Handles the key action.
<static>  
ZmZimbraMail.hashSortCompare(hash, a, b)
Returns sort order using a and b as keys into given hash.
<static>  
ZmZimbraMail.hasSessionEnded()
Returns the state of ZCS application if user is logged out in case of browser quit.
<static>  
ZmZimbraMail.killSplash()
Hides the splash screen.
<static>  
ZmZimbraMail.logOff(ev, relogin)
Logs off the application.
<static>  
ZmZimbraMail.redir(locationStr)
Redirect.
 
removeAppListener(app, type, listener)
Removes a listener for the given event type and app.
 
removeListener(type, listener)
Removes a listener for the given event type.
<static>  
ZmZimbraMail.run(params)
Sets up ZimbraMail, and then starts it by calling its constructor.
 
runAppFunction(funcName, force)
Runs the given function for all enabled apps, passing args.
 
sendClientEventNotify(event, isNetworkOn)
Sends a <ClientEventNotifyRequest> to the server.
 
Sends a <NoOpRequest> to the server.
<static>  
ZmZimbraMail.sendRedirect(locationStr)
Sends a redirect.
 
sendRequest(params)
Sends the request.
 
Handles a change in which app is current.
 
Sets the active tab.
<static>  
ZmZimbraMail.setExitTimer(startTimer)
If a user has been prompted and elects to stay on page, this timer automatically logs them off after an interval of time.
 
Sets the client into "instant notifications" mode.
 
Set up the New button based on the current app.
 
Resets the interval between poll requests, based on what's in the settings, only if we are not in instant notify mode.
 
setSessionTimer(bStartTimer)
Sets the session timer.
 
setStatusMsg(params, force, dismissCallback, finishCallback)
Displays a status message.
 
Sets the user info.
 
Shows the mini-calendar.
 
Shows reminders.
 
Shows reminders.
 
startup(params, app, settings)
Startup the mail controller.
<static>  
ZmZimbraMail.unload()
Unloads the controller.
Methods borrowed from class ZmController:
getCurrentViewId, getCurrentViewType, getNewFolderCallback, getSessionId, getTabGroup, getViewElements, isTransient, mapSupported, popupErrorDialog, popupUploadErrorDialog, setCurrentViewId, setCurrentViewType, setSessionId
Class Detail
ZmZimbraMail(params)
Creates a controller to run ZimbraMail. Do not call directly, instead use the run() factory method.
Parameters:
{Hash} params
a hash of parameters
{constant} params.app
the starting app
{Element} params.userShell
the top-level skin container
Method Detail
activateApp(appName, force, callback, errorCallback, params)
Activates the given application.
Parameters:
{constant} appName
the application name
{Boolean} force
if true, launch the app
{AjxCallback} callback
the callback
{AjxCallback} errorCallback
the error callback
{Hash} params
a hash of parameters (see #startup for full list)
{Boolean} params.checkQS
if true, check query string for launch args
{ZmCsfeResult} params.result
the result object from load of user settings

addApp(app)
Adds the application.
Parameters:
{ZmApp} app
the app

{Boolean} addAppListener(app, type, listener)
Adds a listener for the given event type and app.
Parameters:
{constant} app
the app name
{constant} type
the event type
{AjxListener} listener
a listener
Returns:
{Boolean} true if the listener is added

<static> ZmZimbraMail.addAppListener(appName, type, listener)
Static function to add an app listener before this class has been instantiated. This is separate from ZmZimbraMail#addListener so that the caller doesn't need to know the specifics of how we twiddle the type name for app events.
Parameters:
{String} appName
the application name
{constant} type
the event type
{AjxListener} listener
a listener

{Boolean} addListener(type, listener)
Adds a listener for the given event type.
Parameters:
{constant} type
the event type
{AjxListener} listener
a listener
Returns:
{Boolean} true if the listener is added

<static> ZmZimbraMail.addListener(type, listener)
Static function to add a listener before this class has been instantiated. During construction, listeners are copied to the event manager. This function could be used by a skin, for example.
Parameters:
{constant} type
the event type
{AjxListener} listener
a listener

addPostRenderCallback(callback, order, delay, runNow)
Sets up a callback to be run after the starting app has rendered, if we're doing post-render callbacks. The callback is registered with an order that determines when it will run relative to other callbacks. A delay can also be given, so that the UI has a chance to do some work between callbacks.
Parameters:
{AjxCallback} callback
the callback
{int} order
the run order for the callback
{int} delay
how long to pause before running the callback
{Boolean} runNow
if true, we are not doing post-render callbacks, run the callback now and don't add it to the list

appRendered(appName)
An app calls this once it has fully rendered, so that we may notify any listeners.
Parameters:
{String} appName
the app name

cancelRequest(reqId, errorCallback, noBusyOverlay)
Cancels the request.
Parameters:
{String} reqId
the request id
{AjxCallback} errorCallback
the callback
{Boolean} noBusyOverlay
if true, do not show busy overlay
See:
ZmRequestMgr#cancelRequest

dismissStatusMsg(all)
Dismisses the displayed status message, if any
Parameters:
all

<static> ZmZimbraMail.exitSession()
Logs user off when session has expired and user has choosen to stay on page when prompted

focusContentPane()
Focuses on the content pane.

focusToolbar()
Focuses on the toolbar.

{ZmApp} getActiveApp()
Gets the active app.
Returns:
{ZmApp} the app

{ZmApp} getApp(appName)
Gets a handle to the given app.
Parameters:
{String} appName
the app name
Returns:
{ZmApp} the app

{ZmAppChooser} getAppChooser()
Gets the application chooser.
Returns:
{ZmAppChooser} the chooser

{ZmAppButton} getAppChooserButton(id)
Gets the app chooser button.
Parameters:
{String} id
the id
Returns:
{ZmAppButton} the button

{ZmAppViewMgr} getAppViewMgr()
Gets a handle to the app view manager.
Returns:
{ZmAppViewMgr} the app view manager

<static> ZmZimbraMail.getConfirmExitMethod()
Return the confirmExitMethod that can be used for window.onbeforeunload

{ZmActionMenu} getDropMenuOptions(parent, parentElement, adminUrl)
Adds a "help" submenu.
Parameters:
{DwtComposite} parent
the parent widget
parentElement
adminUrl
Returns:
{ZmActionMenu} the menu

{ZmActionMenu} getHelpButton(parent)
Adds a "help" submenu.
Parameters:
{DwtComposite} parent
the parent widget
Returns:
{ZmActionMenu} the menu

{Boolean} getInstantNotify()
Gets the "instant notification" setting.
Returns:
{Boolean} true if instant notification is "ON"

{DwtKeyMapMgr} getKeyMapMgr()
Gets the key map manager.
Returns:
{DwtKeyMapMgr} the key map manager

{String} getKeyMapName()
Gets the key map name.
Returns:
{String} the key map name

{ZmApp} getPreviousApp()
Gets the previous application.
Returns:
{ZmApp} the app

handleKeyAction(actionCode, ev)
Handles the key action.
Parameters:
{constant} actionCode
the action code
{Object} ev
the event

<static> {int} ZmZimbraMail.hashSortCompare(hash, a, b)
Returns sort order using a and b as keys into given hash.
Parameters:
{Hash} hash
a hash with sort values
{String} a
a key into hash
{String} b
a key into hash
Returns:
{int} 0 if the items are the same; 1 if "a" is before "b"; -1 if "b" is before "a"

<static> ZmZimbraMail.hasSessionEnded()
Returns the state of ZCS application if user is logged out in case of browser quit. The public method is added to take appropriate action in the chat app if user session is ending.

<static> ZmZimbraMail.killSplash()
Hides the splash screen.

<static> ZmZimbraMail.logOff(ev, relogin)
Logs off the application.
Parameters:
ev
relogin

<static> ZmZimbraMail.redir(locationStr)
Redirect.
Parameters:
{String} locationStr
the redirect location

{Boolean} removeAppListener(app, type, listener)
Removes a listener for the given event type and app.
Parameters:
{constant} app
the app name
{constant} type
the event type
{AjxListener} listener
a listener
Returns:
{Boolean} true if the listener is removed

{Boolean} removeListener(type, listener)
Removes a listener for the given event type.
Parameters:
{constant} type
the event type
{AjxListener} listener
a listener
Returns:
{Boolean} true if the listener is removed

<static> ZmZimbraMail.run(params)
Sets up ZimbraMail, and then starts it by calling its constructor. It is assumed that the CSFE is on the same host.
Parameters:
{Hash} params
a hash of parameters
{constant} params.app
te starting app
{Boolean} params.offlineMode
if true, this is the offline client
{Boolean} params.devMode
if true, we are in development environment
{Hash} params.settings
the server prefs/attrs
{constant} params.protocolMode
the protocal mode (http, https or mixed)
{Boolean} params.noSplashScreen
if true, do not show splash screen during startup

runAppFunction(funcName, force)
Runs the given function for all enabled apps, passing args.
Parameters:
{String} funcName
the function name
{Boolean} force
if true, run func for disabled apps as well

sendClientEventNotify(event, isNetworkOn)
Sends a <ClientEventNotifyRequest> to the server.
Parameters:
{Object} event
the event
isNetworkOn

sendNoOp()
Sends a <NoOpRequest> to the server. Used for '$set:noop'

<static> ZmZimbraMail.sendRedirect(locationStr)
Sends a redirect.
Parameters:
{String} locationStr
the redirect location

sendRequest(params)
Sends the request.
Parameters:
{Hash} params
a hash of parameters
See:
ZmRequestMgr#sendRequest

setActiveApp(view)
Handles a change in which app is current. The change will be reflected in the current app toolbar and the overview. The previous and newly current apps are notified of the change. This method is called after a new view is pushed.
Parameters:
{Object} view

setActiveTabId(id)
Sets the active tab.
Parameters:
{String} id
the tab id

<static> ZmZimbraMail.setExitTimer(startTimer)
If a user has been prompted and elects to stay on page, this timer automatically logs them off after an interval of time.
Parameters:
startTimer
{boolean} true to start timer, false to cancel

setInstantNotify(on)
Sets the client into "instant notifications" mode.
Parameters:
{Boolean} on
if true, turn on instant notify

setNewButtonProps(params)
Set up the New button based on the current app.
Parameters:
params

{Boolean} setPollInterval(kickMe)
Resets the interval between poll requests, based on what's in the settings, only if we are not in instant notify mode.
Parameters:
{Boolean} kickMe
if true, start the poll timer
Returns:
{Boolean} true if poll interval started; false if in "instant notification" mode

setSessionTimer(bStartTimer)
Sets the session timer.
Parameters:
{Boolean} bStartTimer
if true, start the timer

setStatusMsg(params, force, dismissCallback, finishCallback)
Displays a status message.
Parameters:
{Hash} params
a hash of parameters
{String} params.msg
the message
{constant} params.level Optional
ZmStatusView.LEVEL_INFO, ZmStatusView.LEVEL_WARNING, or ZmStatusView.LEVEL_CRITICAL
{constant} params.detail Optional
the details
{constant} params.transitions Optional
the transitions
{constant} params.toast Optional
the toast control
{boolean} force Optional
force any displayed toasts out of the way (dismiss them and run their dismissCallback). Enqueued messages that are not yet displayed will not be displayed
{AjxCallback} dismissCallback Optional
callback to run when the toast is dismissed (by another message using [force], or explicitly calling ZmStatusView.prototype.dismiss())
{AjxCallback} finishCallback Optional
callback to run when the toast finishes its transitions by itself (not when dismissed)

setUserInfo()
Sets the user info.

showMiniCalendar()
Shows the mini-calendar.

showReminder()
Shows reminders.

showTaskReminder()
Shows reminders.

startup(params, app, settings)
Startup the mail controller.

The following steps are performed:

  • check for skin, show it
  • create app view mgr
  • create components (sash, banner, user info, toolbar above overview, status view)
  • create apps
  • load user settings (using a <GetInfoRequest>)
Parameters:
{Hash} params
a hash of parameters
{constant} app
the starting app
{Hash} settings
a hash of settings overrides

<static> ZmZimbraMail.unload()
Unloads the controller. Allows parent window to walk list of open child windows and either "delete" or "disable" them.

Documentation generated by JsDoc Toolkit 2.3.0 on Tue Jun 28 2016 21:01:35 GMT-0400 (EDT)