Zimlet JavaScript API Reference - ZmSearchController

Class ZmSearchController


Extends ZmController.

This class represents the search controller.

Defined in: ZmSearchController.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
ZmSearchController(container)
Creates a search controller.
Method Summary
Method Attributes Method Name and Description
 
dateSearch(d, searchFor)
Performs a search by date.
 
fromSearch(address)
Performs a search by from address.
 
Gets the search field value.
 
Get the searchFor var which is the same as type except for mail, in which case the type is either msg or conv but searchFor is mail.
 
Gets the search tool bar.
 
getTypeFromSearchFor(searchFor, userInitiated)
Gets the item type, based on searchFor.
 
redoSearch(search, noRender, changes, callback, errorCallback)
Performs the given search.
 
Resets search for all accounts.
 
Resets the search toolbar.
 
search(params, query, searchFor, types, sortBy, offset, limit, searchId, noRender, userText, callback, errorCallback, response, skipUpdateSearchToolbar, origin, sessionId, noGal)
Performs a search and displays the results.
 
Sets the default type.
 
setSearchField(searchString)
Sets the search field.
 
toSearch(address)
Performs a search by to address.
 
updateOverview(searchObj)
Selects the appropriate item in the overview based on the search.
Methods borrowed from class ZmController:
getApp, getCurrentViewId, getCurrentViewType, getKeyMapName, getNewFolderCallback, getSessionId, getTabGroup, getViewElements, handleKeyAction, isTransient, mapSupported, popupErrorDialog, popupUploadErrorDialog, setCurrentViewId, setCurrentViewType, setSessionId
Class Detail
ZmSearchController(container)
Creates a search controller.
Parameters:
{DwtControl} container
the top-level container
Method Detail
dateSearch(d, searchFor)
Performs a search by date.
Parameters:
{Date} d
the date or d for now
{String} searchFor
the search for string

fromSearch(address)
Performs a search by from address.
Parameters:
{String} address
the from address

{String} getSearchFieldValue()
Gets the search field value.
Returns:
{String} the search field value or an empty string

{String} getSearchForFromType(type)
Get the searchFor var which is the same as type except for mail, in which case the type is either msg or conv but searchFor is mail.
Parameters:
{String} type
type of items to search for
Returns:
{String} searchFor
See:
#search

{ZmButtonToolBar} getSearchToolbar()
Gets the search tool bar.
Returns:
{ZmButtonToolBar} the tool bar

{String} getTypeFromSearchFor(searchFor, userInitiated)
Gets the item type, based on searchFor. The type is the same as the searchFor, except for mail in which the type is either msg or conv based on view.
Parameters:
{String} searchFor
general description of what to search for
{Boolean} userInitiated
true if using a search tab
Returns:
{String} type
See:
#search

redoSearch(search, noRender, changes, callback, errorCallback)
Performs the given search. It takes a ZmSearch, rather than constructing one out of the currently selected menu choices. Aside from re-executing a search, it can be used to perform a canned search.
Parameters:
{ZmSearch} search
the search object
{Boolean} noRender
if true, results will not be passed to controller
{Object} changes
the hash of changes to make to search
{AjxCallback} callback
the async callback
{AjxCallback} errorCallback
the async callback to run if there is an exception

resetSearchAllAccounts()
Resets search for all accounts.

resetSearchToolbar()
Resets the search toolbar. This is used by the offline client to "reset" the toolbar whenever user switches between accounts.

search(params, query, searchFor, types, sortBy, offset, limit, searchId, noRender, userText, callback, errorCallback, response, skipUpdateSearchToolbar, origin, sessionId, noGal)
Performs a search and displays the results.
Parameters:
{Hash} params
a hash of parameters:
{String} query
the search string
{constant} searchFor
the semantic type to search for
{Array} types
the item types to search for
{constant} sortBy
the sort constraint
{int} offset
the starting point in list of matching items
{int} limit
the maximum number of items to return
{int} searchId
the ID of owning search folder (if any)
{Boolean} noRender
if true, results will not be passed to controller
{Boolean} userText
if true, text was typed by user into search box
{AjxCallback} callback
the async callback
{AjxCallback} errorCallback
the async callback to run if there is an exception
{Object} response
the canned JSON response (no request will be made)
{boolean} skipUpdateSearchToolbar
don't update the search toolbar (e.g. from the ZmDumpsterDialog where the search is called from its own search toolbar
{string} origin
indicates what initiated the search
{string} sessionId
session ID of search results tab (if search came from one)
{Boolean} noGal
if true, don't search GAL. This is to override the this._contactSource value in contacts search, specifically for clicking on TAGS.

setDefaultSearchType(type)
Sets the default type. This method provides a programmatic way to set the search type.
Parameters:
{Object} type
the search type to set as the default

setSearchField(searchString)
Sets the search field.
Parameters:
{String} searchString
the search string

toSearch(address)
Performs a search by to address.
Parameters:
{String} address
the to address

updateOverview(searchObj)
Selects the appropriate item in the overview based on the search. Selection only happens if the search was a simple search for a folder, tag, or saved search. A check is done to make sure that item is not already selected, so selection should only occur for a query manually run by the user.
Parameters:
{ZmSearch} searchObj
the current search

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