Zimlet JavaScript API Reference - ZmAccountList

Class ZmAccountList


This class is used to store and manage a list of accounts for a mailbox.

Defined in: ZmAccountList.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Creates the account list.
Method Summary
Method Attributes Method Name and Description
 
Checks if there is at least one of the given account types in the account list.
 
add(account)
Adds the account.
 
addActiveAcountListener(listener, index)
Adds an active account listener.
 
createAccounts(settings, obj)
Creates the main account and all its children.
 
generateQuery(folderId, types)
Generates a query.
 
Gets the account by id.
 
Gets the account by email.
 
Gets the account by name.
 
Gets the accounts.
 
getItemCount(folderId, checkUnread)
Gets the cumulative item count of all accounts for the given folder ID.
 
Gets the tool tip for the folder.
 
Checks if any of the non-main, visible accounts is currently doing an initial sync.
 
isSyncStatus(status)
Returns true if any of the visible accounts have the given status
 
loadAccounts(callback)
Loads each visible account serially by requesting the following requests from the server in a batch request:
 
Resets the trees.
 
Saves the implicit preferences on the visible accounts.
 
setActiveAccount(account, skipNotify)
Sets the given account as the active one, which will then be used when fetching any account-specific data such as settings or folder tree.
 
size(includeInvisible)
Gets the number of visible accounts for this mailbox.
 
syncAll(callback)
Syncs all visible accounts.
 
Returns a string representation of the object.
Class Detail
ZmAccountList()
Creates the account list.
Author: Parag Shah.
Method Detail
{Boolean} accountTypeExists(type)
Checks if there is at least one of the given account types in the account list. Note: if the given account type is ZCS, the local parent account is NOT included when searching the account list.
Parameters:
{String} type
the type of account to check
Returns:
{Boolean} true if the account exists

add(account)
Adds the account.
Parameters:
{ZmAccount} account
the account

addActiveAcountListener(listener, index)
Adds an active account listener.
Parameters:
{AjxListener} listener
the listener
{int} index
the index where to insert the listener

createAccounts(settings, obj)
Creates the main account and all its children. In the normal case, the "main" account is the only account, and represents the user who logged in. If family mailbox is enabled, that account is a parent account with dominion over child accounts. If offline, the main account is the "local" account.
Parameters:
{ZmSettings} settings
the settings for the main account
{Object} obj
the JSON obj containing meta info about the main account and its children

{String} generateQuery(folderId, types)
Generates a query.
Parameters:
{String} folderId
the folder id
{Array} types
the types
Returns:
{String} the query

{ZmAccount} getAccount(id)
Gets the account by id.
Parameters:
{String} id
the id
Returns:
{ZmAccount} the account

{ZmAccount} getAccountByEmail(email)
Gets the account by email.
Parameters:
{String} email
the email
Returns:
{ZmAccount} the account

{ZmAccount} getAccountByName(name)
Gets the account by name.
Parameters:
{String} name
the name
Returns:
{ZmAccount} the account

{Array} getAccounts()
Gets the accounts.
Returns:
{Array} an array of {ZmAccount} objects

{int} getItemCount(folderId, checkUnread)
Gets the cumulative item count of all accounts for the given folder ID.
Parameters:
{String} folderId
the folder id
{Boolean} checkUnread
if true, checks the unread count instead of item count
Returns:
{int} the item count

{String} getTooltipForVirtualFolder(folderId)
Gets the tool tip for the folder.
Parameters:
{String} folderId
the folder id
Returns:
{String} the tool tip

{Boolean} isInitialSyncing()
Checks if any of the non-main, visible accounts is currently doing an initial sync.
Returns:
{Boolean} true if any of the non-main accounts are doing initial sync

isSyncStatus(status)
Returns true if any of the visible accounts have the given status
Parameters:
{String} status
Status to check for

loadAccounts(callback)
Loads each visible account serially by requesting the following requests from the server in a batch request:
Parameters:
{AjxCallback} callback
the callback to trigger once all accounts have been loaded

resetTrees()
Resets the trees.

saveImplicitPrefs()
Saves the implicit preferences on the visible accounts.

setActiveAccount(account, skipNotify)
Sets the given account as the active one, which will then be used when fetching any account-specific data such as settings or folder tree.
Parameters:
{ZmZimbraAccount} account
the account to make active
{Boolean} skipNotify
if true, skip notify

{int} size(includeInvisible)
Gets the number of visible accounts for this mailbox.
Parameters:
{Boolean} includeInvisible
if true, include the number of invisible accounts for this mailbox
Returns:
{int} the number of accounts for this mailbox

syncAll(callback)
Syncs all visible accounts.
Parameters:
{AjxCallback} callback
the callback

{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:38 GMT-0400 (EDT)