Zimlet JavaScript API Reference - ZmFolderTree

Class ZmFolderTree


Extends ZmTree.

This class represents a tree of folders. It may be typed, in which case the folders are all of that type, or untyped.

Defined in: ZmFolderTree.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
ZmFolderTree(type)
Creates an empty folder tree.
Method Summary
Method Attributes Method Name and Description
<static>  
ZmFolderTree.createFolder(type, parent, obj, tree, path, elementType, account)
Creates the folder.
<static>  
ZmFolderTree.createFromJs(parent, obj, tree, elementType, path, account)
Generic function for creating a folder.
 
getByPath(path, useSystemName)
Gets the folder by path.
 
getByType(type)
Gets the folder by type.
 
Issues a <BatchRequest> of <GetFolderRequest>s for existing mountpoints that do not have permissions set.
 
Handles no such folder.
 
handleNoSuchFolderError(organizerType, zid, rid)
Handles a missing link by marking its organizer as not there, redrawing it in any tree views, and asking to delete it.
 
loadFromJs(rootObj, elementType, account)
Loads the folder or the zimlet tree.
 
Returns a string representation of the object.
Methods borrowed from class ZmTree:
asList, asString, getById, getByName, getFolderTypeByName, getUnreadHash, reset, size
Methods borrowed from class ZmModel:
addChangeListener, removeAllChangeListeners, removeChangeListener
Class Detail
ZmFolderTree(type)
Creates an empty folder tree.
Author: Conrad Damon.
Parameters:
{constant} type
the organizer type
Method Detail
<static> ZmFolderTree.createFolder(type, parent, obj, tree, path, elementType, account)
Creates the folder.
Parameters:
{String} type
the folder type
{ZmFolder} parent
the parent folder
{Object} obj
the JSON with folder data
{ZmFolderTree} tree
the containing tree
{Array} path
the list of path elements
{String} elementType
the type of containing JSON element
{ZmZimbraAccount} account
the account this folder belongs to

<static> ZmFolderTree.createFromJs(parent, obj, tree, elementType, path, account)
Generic function for creating a folder. Handles any organizer type that comes in the folder list.
Parameters:
{ZmFolder} parent
the parent folder
{Object} obj
the JSON with folder data
{ZmFolderTree} tree
the containing tree
{String} elementType
the type of containing JSON element
{Array} path
the list of path elements
{ZmZimbraAccount} account
the account this folder belongs to

{ZmFolder} getByPath(path, useSystemName)
Gets the folder by path.
Parameters:
{String} path
the path
{Boolean} useSystemName
true to use the system name
Returns:
{ZmFolder} the folder or null if not found

{ZmFolder} getByType(type)
Gets the folder by type.
Parameters:
{String} type
the type
Returns:
{ZmFolder} the folder or null if not found

getPermissions(params)
Issues a <BatchRequest> of <GetFolderRequest>s for existing mountpoints that do not have permissions set.
Parameters:
{Hash} params
a hash of parameters
{int} params.type
the ZmItem type constant
{AjxCallback} params.callback
the callback to trigger after fetching permissions
{Boolean} params.skipNotify
true to skip notify after fetching permissions
{Array} params.folderIds
the list of folder Id's to fetch permissions for
{Boolean} params.noBusyOverlay
true to not block the UI while fetching permissions
{String} params.accountName
the account to issue request under

handleDeleteNoSuchFolder(organizer)
Handles no such folder. The user will be notified that a linked organizer generated a "no such folder", error, giving the user a chance to delete the folder.
Parameters:
{ZmOrganizer} organizer
the organizer

{Boolean} handleNoSuchFolderError(organizerType, zid, rid)
Handles a missing link by marking its organizer as not there, redrawing it in any tree views, and asking to delete it.
Parameters:
{int} organizerType
the type of organizer (constants defined in ZmOrganizer)
{String} zid
the zid of the missing folder
{String} rid
the rid of the missing folder
Returns:
{Boolean} true if the error is handled

loadFromJs(rootObj, elementType, account)
Loads the folder or the zimlet tree.
Parameters:
{Object} rootObj
the root object
{String} elementType
the element type
{ZmZimbraAccount} account
the account

{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)