Zimlet JavaScript API Reference - ZmContactsApp

Class ZmContactsApp


Extends ZmApp.

The contacts app manages the creation and display of contacts, which are grouped into address books.

Defined in: ZmContactsApp.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
ZmContactsApp(container, parentController)
Creates and initializes the contacts application.
Method Summary
Method Attributes Method Name and Description
 
activate(active)
Activates the application.
 
getContactByEmail(address, callback)
Gets the contact with the given address, if any.
 
Gets information about the contact with the given phone number, if any.
 
Gets the contact controller.
 
getContactList(callback, errorCallback, account)
Gets a ZmContactList with all of the user's local contacts.
 
getContactListController(sessionId, searchResultsController)
Gets the contact list controller.
 
getContactsByEmails(addresses, callback)
Gets the contacts with the given addresses, if any.
 
Gets the GAL contact list.
 
Gets the initial search type.
 
getLimit(offset)
Gets the limit for the search triggered by the application launch or an overview click.
 
Checks if the contact list is loaded for the specified account.
 
launch(params, callback)
Launches the application.
 
Online to Offline or Offline to Online; Called from ZmApp.activate and from ZmOffline.enableApps, disableApps
 
setActive(active)
Sets the app as active.
 
Sets up a list of email addresses to use to find their contacts with a single search.
 
showSearchResults(results, callback, searchResultsController)
Shows the search results.
 
updateIdHash(contact, doDelete)
Adds/remove contacts from the contact list hash
Methods borrowed from class ZmApp:
addDeferredFolder, createView, deleteSessionController, disposeTreeControllers, getDisplayName, getName, getNumSessionControllers, getOverview, getOverviewContainer, getOverviewId, getOverviewPanelContent, getRemoteFolderIds, getSearchParams, getSessionController, getTypeFromController, isActive, popView, pushView, reset, resetOverview, setAppView, setOverviewPanelContent, setView, stageView, startAlert, stopAlert, toString
Class Detail
ZmContactsApp(container, parentController)
Creates and initializes the contacts application.
Author: Conrad Damon.
Parameters:
{DwtControl} container
the container
{ZmController} parentController
the parent controller
Method Detail
activate(active)
Activates the application.
Parameters:
{Object} active
(not used)

{ZmContact} getContactByEmail(address, callback)
Gets the contact with the given address, if any. If it's not in our cache and we are given a callback, we do a search. If a search is performed then any addresses in the Address Lookup Group are also searched for.
Parameters:
{String} address
an email address
{AjxCallback} callback
the callback to run
Returns:
{ZmContact} the contact
See:
#setAddrLookupGroup

{Object} getContactByPhone(phone)
Gets information about the contact with the given phone number, if any. Canonical list only.
Parameters:
{String} phone
the phone number
Returns:
{Object} an object with contact = the contact & field = the field with the matching phone number

{ZmContactController} getContactController(sessionId)
Gets the contact controller.
Parameters:
sessionId
Returns:
{ZmContactController} the controller

{ZmContactList} getContactList(callback, errorCallback, account)
Gets a ZmContactList with all of the user's local contacts. If that's a large number, performance may be slow.
Parameters:
{AjxCallback} callback
the callback to trigger after contact list loaded
{AjxCallback} errorCallback
the callback to trigger in the event of an error
{ZmZimbraAccount} account
the account to fetch contacts for
Returns:
{ZmContactList} the contact list

{ZmContactListController} getContactListController(sessionId, searchResultsController)
Gets the contact list controller.
Parameters:
sessionId
searchResultsController
Returns:
{ZmContactListController} the controller

{Array} getContactsByEmails(addresses, callback)
Gets the contacts with the given addresses, if any. If there are addresses not in our cache and we are given a callback, we do a search. Unlike #getContactByEmail, this method does not use or modify the Address Lookup Group.
Parameters:
{Array} addresses
an array of AjxEmailAddress objects
{AjxCallback} callback
the callback to run
Returns:
{Array} an array of [AjxEmailAddress, ZmContact] pairs.
See:
#setAddrLookupGroup

{ZmContactList} getGalContactList()
Gets the GAL contact list. NOTE: calling method should handle exceptions.
Returns:
{ZmContactList} the contact list

{constant} getInitialSearchType()
Gets the initial search type.
Returns:
{constant} the search (see ZmId.SEARCH_ constants)

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

{Boolean} isContactListLoaded(acctId)
Checks if the contact list is loaded for the specified account.
Parameters:
{String} acctId
the account id
Returns:
{Boolean} true if contact list is loaded

launch(params, callback)
Launches the application.
Parameters:
{Object} params
(not used)
{AjxCallback} callback
the callback

resetWebClientOfflineOperations()
Online to Offline or Offline to Online; Called from ZmApp.activate and from ZmOffline.enableApps, disableApps

setActive(active)
Sets the app as active.
Parameters:
{Boolean} active
if true active and shows application

setAddrLookupGroup(addrs)
Sets up a list of email addresses to use to find their contacts with a single search. The addresses passed in can either be raw email addresses (strings), or AjxEmailAddress objects. A list of the addresses is kept so that it can later be used to create a single search query. Each address will also keep track of the callbacks that will need to be run with its search result (it's a list of callbacks since the same address may be used in more than one context).

One example of this group approach is in rendering a message header, where each email address in the header is rendered based on whether it maps to a contact. The group approach lets us do a single search rather than several.

Parameters:
{Array} addrs
a list of email addresses to look up

showSearchResults(results, callback, searchResultsController)
Shows the search results.
Parameters:
{Object} results
the results
{AjxCallback} callback
the callback
{ZmSearchResultsController} searchResultsController
owning controller

updateIdHash(contact, doDelete)
Adds/remove contacts from the contact list hash
Parameters:
contact
{Object} contact object
doDelete
{boolean} true to delete from hash

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