Zimlet JavaScript API Reference - ZmContactList

Class ZmContactList


Extends ZmList.

This class represents a list of contacts. In general, the list is the result of a search. It may be the result of a <GetContactsRequest>, which returns all of the user's local contacts. That list is considered to be canonical.

Loading of all local contacts has been optimized by delaying the creation of ZmContact objects until they are needed. That has a big impact on IE, and not much on Firefox. Loading a subset of attributes did not have much impact on load time, probably because a large majority of contacts contain only those minimal fields.



Defined in: ZmContactList.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
ZmContactList(search, isGal, type)
Create a new, empty contact list.
Method Summary
Method Attributes Method Name and Description
<static>  
ZmContactList.addDlFolder()
 
Creates the item local.
 
deleteItems(params)
Deletes contacts after checking that this is not a GAL list.
 
deleteLocal(items)
Deletes the items.
 
getById(id)
Override in order to make sure the contact has been realized.
 
Gets the contact with the given address, if any (canonical list only).
 
Gets information about the contact with the given phone number, if any (canonical list only).
 
Gets the list ID hash
 
getSubList(offset, limit, folderId)
Override in order to make sure the contacts have been realized.
 
moveItems(params)
Moves a list of items to the given folder.
 
moveLocal(items, folderId)
Moves the items.
 
setIsGal(isGal)
Sets the is GAL flag.
Methods borrowed from class ZmList:
add, addFromDom, cache, clear, copyItems, create, flagItems, get, getArray, getVector, hasMore, indexOf, modifyItem, modifyLocal, notifyCreate, remove, removeAllTags, set, setHasMore, size, tagItems
Methods borrowed from class ZmModel:
addChangeListener, removeAllChangeListeners, removeChangeListener
Class Detail
ZmContactList(search, isGal, type)
Create a new, empty contact list.
Author: Conrad Damon.
Parameters:
{ZmSearch} search
the search that generated this list
{Boolean} isGal
if true, this is a list of GAL contacts
{constant} type
the item type
Method Detail
<static> ZmContactList.addDlFolder()

createLocal(item)
Creates the item local.
Parameters:
{ZmContact} item
the item

deleteItems(params)
Deletes contacts after checking that this is not a GAL list.
Parameters:
{Hash} params
a hash of parameters
{Array} params.items
the list of items to delete
{Boolean} params.hardDelete
if true, force physical removal of items
{Object} params.attrs
the additional attrs for SOAP command

deleteLocal(items)
Deletes the items.
Parameters:
{Array} items
an array of ZmContact objects

{ZmContact} getById(id)
Override in order to make sure the contact has been realized. Canonical list only.
Parameters:
{int} id
the contact ID
Returns:
{ZmContact} the contact or null if not found

{ZmContact} getContactByEmail(address)
Gets the contact with the given address, if any (canonical list only).
Parameters:
{String} address
an email address
Returns:
{ZmContact} the contact or null if not found

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

getIdHash()
Gets the list ID hash
Returns:
idHash {Ojbect} list ID hash

{AjxVector} getSubList(offset, limit, folderId)
Override in order to make sure the contacts have been realized. We don't call realizeContact() since this is not the canonical list.
Parameters:
{int} offset
the starting index
{int} limit
the size of sublist
folderId
Returns:
{AjxVector} a vector of ZmContact objects

moveItems(params)
Moves a list of items to the given folder.

This method calls the base class for normal "moves" UNLESS we're dealing w/ shared items (or folder) in which case we must send a CREATE request for the given folder to the server followed by a hard delete of the shared contact.

Parameters:
{Hash} params
a hash of parameters
{Array} params.items
a list of items to move
{ZmFolder} params.folder
the destination folder
{Hash} params.attrs
the additional attrs for SOAP command
{Boolean} params.outOfTrash
if true, we are moving contacts out of trash

moveLocal(items, folderId)
Moves the items.
Parameters:
{Array} items
an array of ZmContact objects
{String} folderId
the folder id

setIsGal(isGal)
Sets the is GAL flag.
Parameters:
{Boolean} isGal
true if contact list is GAL

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