Zimlet JavaScript API Reference - ZmApp

Class ZmApp


This object represents a Zimbra Application. This class is a base class for application classes. "App" is a useful abstraction for a set of related functionality, such as mail, address book, or calendar. Looked at another way, an app is a collection of one or more controllers.

Defined in: ZmApp.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
ZmApp(name, container, parentController)
Creates the application.
Field Summary
Field Attributes Field Name and Description
<static>  
ZmApp.BRIEFCASE
Defines the "briefcase" application.
<static>  
ZmApp.CALENDAR
Defines the "calendar" application.
<static>  
ZmApp.CONTACTS
Defines the "address book" application.
<static>  
ZmApp.MAIL
Defines the "mail" application.
<static>  
ZmApp.PORTAL
Defines the "portal" application.
<static>  
ZmApp.PREFERENCES
Defines the "preferences" application.
Method Summary
Method Attributes Method Name and Description
 
activate(active, viewId)
Activates the application.
 
Adds a deferred folder.
 
createView(params)
Creates the application view.
 
deleteSessionController(params, controllerClass, sessionId, searchResultsController)
Deletes a controller of the given type, class, and sessionId.
 
Disposes of the tree controllers (right now mainly gets rid of change listeners.
 
Gets the application display name.
 
Gets the initial search type.
 
getLimit(offset)
Gets the limit for the search triggered by the application launch or an overview click.
 
Gets the application name.
 
Gets the number of active session controllers
 
Gets the current overview, if any.
 
Gets the overview container.
 
getOverviewId(account)
Gets the overview id of the current ZmOverview, if any.
 
Creates the overview content for this app.
 
Gets the remote folder ids.
 
Gets the search parameters.
 
getSessionController(params, controllerClass, sessionId, searchResultsController)
Returns a controller of the given type and class.
 
getTypeFromController(params, controllerClass, sessionId, searchResultsController)
Evaluates the controller class and returns the default view type from that controller.
 
Checks if the application is active.
 
launch(params, callback)
Launches the application.
 
popView(force, viewId, skipHistory)
Pops the application view.
 
pushView(name, force)
Pushes the application view.
 
reset(active)
Resets the application state.
 
resetOverview(overviewId)
Resets the current overview, preserving expansion.
 
Handle the common aspects of a transition from online to offline and offline to online, and also do so when an app is activated
<static>  
ZmApp.runAppFunction(funcName, mixed)
Runs the given function for all known (e.g.
 
setAppView(view)
Sets the application view.
 
Sets the overview tree to display overview content for this application.
 
setView(name, force)
Sets the application view.
 
stageView(name)
Stages the application view.
 
Starts an alert on the application tab.
 
Stops an alert on the application tab.
 
Returns a string representation of the object.
Class Detail
ZmApp(name, container, parentController)
Creates the application.
Parameters:
{String} name
the application name
{DwtControl} container
the control that contains components
{ZmController} parentController
the parent window controller (set by the child window)
Field Detail
<static> ZmApp.BRIEFCASE
Defines the "briefcase" application.
Defined in: ZmBriefcaseApp.js.

<static> ZmApp.CALENDAR
Defines the "calendar" application.
Defined in: ZmCalendarApp.js.

<static> ZmApp.CONTACTS
Defines the "address book" application.
Defined in: ZmContactsApp.js.

<static> ZmApp.MAIL
Defines the "mail" application.
Defined in: ZmMailApp.js.

<static> ZmApp.PORTAL
Defines the "portal" application.
Defined in: ZmPortalApp.js.

<static> ZmApp.PREFERENCES
Defines the "preferences" application.
Defined in: ZmPreferencesApp.js.
Method Detail
activate(active, viewId)
Activates the application.
Parameters:
{Boolean} active
true if the application is active
{string} viewId
ID of view becoming active

addDeferredFolder(params)
Adds a deferred folder.
Parameters:
{Hash} params
a hash of parameters

createView(params)
Creates the application view.
Parameters:
{Hash} params
a hash of parameters
See:
ZmAppViewMgr
ZmAppViewMgr#createView

deleteSessionController(params, controllerClass, sessionId, searchResultsController)
Deletes a controller of the given type, class, and sessionId.
Parameters:
{hash} params
hash of params:
{string} controllerClass
string name of controller class
{string} sessionId
unique identifier for this controller
{ZmSearchResultsController} searchResultsController
containing controller

disposeTreeControllers()
Disposes of the tree controllers (right now mainly gets rid of change listeners.

{String} getDisplayName()
Gets the application display name.
Returns:
{String} the display name

{Object} getInitialSearchType()
Gets the initial search type.
Returns:
{Object} null since only set if different from the default

{int} getLimit(offset)
Gets the limit for the search triggered by the application launch or an overview click.
Parameters:
offset
Returns:
{int} the limit

{String} getName()
Gets the application name.
Returns:
{String} the name

{number} getNumSessionControllers(type)
Gets the number of active session controllers
Parameters:
type
Returns:
{number} the number of active session controllers

{ZmOverview} getOverview()
Gets the current overview, if any. Subclasses should ensure that a ZmOverview is returned.
Returns:
{ZmOverview} the overview

{ZmOverview} getOverviewContainer(dontCreate)
Gets the overview container.
Parameters:
dontCreate
Returns:
{ZmOverview} the overview container

{String} getOverviewId(account)
Gets the overview id of the current ZmOverview, if any.
Parameters:
{ZmZimbraAccount} account
the account
Returns:
{String} the id

{String} getOverviewPanelContent()
Creates the overview content for this app. The default implementation creates a ZmOverview with standard options. Other apps may want to use different options, or create a DwtComposite instead.
Returns:
{String} the content

{Array} getRemoteFolderIds(account)
Gets the remote folder ids.
Parameters:
{Object} account
the account
Returns:
{Array} an array of {String} ids

getSearchParams(params)
Gets the search parameters.
Parameters:
{Hash} params
a hash of arguments for the search
See:
ZmSearchController

getSessionController(params, controllerClass, sessionId, searchResultsController)
Returns a controller of the given type and class. If no sessionId is provided, then the controller's session ID will be an incremental number. If a sessionId is given, then a check is made for an existing controller with that session ID. If none is found, one is created and given that session ID.
Parameters:
{hash} params
hash of params:
{string} controllerClass
string name of controller class
{string} sessionId
unique identifier for this controller
{ZmSearchResultsController} searchResultsController
containing controller

{string} getTypeFromController(params, controllerClass, sessionId, searchResultsController)
Evaluates the controller class and returns the default view type from that controller.
Parameters:
{hash} params
hash of params:
{string} controllerClass
string name of controller class
{string} sessionId
unique identifier for this controller
{ZmSearchResultsController} searchResultsController
containing controller
Returns:
{string} default view type

{Boolean} isActive()
Checks if the application is active.
Returns:
{Boolean} true if the application is active

launch(params, callback)
Launches the application.
Parameters:
{Hash} params
a hash of parameters
{AjxCallback} callback
the callback

popView(force, viewId, skipHistory)
Pops the application view.
Parameters:
{Boolean} force
true to force the view off the stack
viewId
skipHistory
See:
ZmAppViewMgr#popView

pushView(name, force)
Pushes the application view.
Parameters:
{String} name
the view name
{Boolean} force
true to force the view onto the stack
See:
ZmAppViewMgr#pushView

{Boolean} reset(active)
Resets the application state.
Parameters:
active
Returns:
{Boolean} true if the application is active

resetOverview(overviewId)
Resets the current overview, preserving expansion.
Parameters:
{String} overviewId
the id of overview to reset

resetWebClientOfflineOperations()
Handle the common aspects of a transition from online to offline and offline to online, and also do so when an app is activated

<static> ZmApp.runAppFunction(funcName, mixed)
Runs the given function for all known (e.g. part of ZmApp.CLASS) app classes, passing args. NOTE: This runs class functions only, not instance (prototype) functions.
Parameters:
funcName
{String} The name of the function we will run on each application.
mixed
{mixed} 0 to n additional arguments are passed to funcName via apply.

setAppView(view)
Sets the application view.
Parameters:
{String} view
the view
See:
ZmAppViewMgr

setOverviewPanelContent(reset)
Sets the overview tree to display overview content for this application.
Parameters:
{Boolean} reset
if true, clear the content first

setView(name, force)
Sets the application view.
Parameters:
{String} name
the view name
{Boolean} force
true to force the view
See:
ZmAppViewMgr#setView

stageView(name)
Stages the application view.
Parameters:
{String} name
the view name
See:
ZmAppViewMgr#stageView

startAlert()
Starts an alert on the application tab.

stopAlert()
Stops an alert on the application tab.

{String} toString()
Returns a string representation of the object.
Returns:
{String} a string representation of the object

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