Class: SearchClient

Search Client

The Search Client allows for any window launched by Finsemble to act as a search provider or query against the registered providers.

Methods

invokeItemAction
(item, action)
clients/searchClient.js, line 149

Call this when you want to trigger an action associated to a returned item. There can be multiple actions associated with a result item and only one should be fired at a time.

Name Type Description
item SearchResultItem

This is the search result item

action Action

This is the action that you would like to fire.

Example
FSBL.Clients.SearchClient.invokeItemAction(resultItem,action);

invokeProviderAction
(provider)
clients/searchClient.js, line 159

Call this when you want to trigger an action associated to a provider. This may not exist on the provider

Name Type Description
provider Provider

This is the search result item

Example
FSBL.Clients.SearchClient.invokeProviderAction(provider);

register
(params, callback)
clients/searchClient.js, line 54

Register a provider with the search service.

Name Type Description
params Object

Params object

Name Type Description
name String

The name of the provider

searchCallback function

A function called when a search is initialized.

itemActionCallback function optional

A function that is called when an item action is fired

providerActionCallback function optional

A function that is called when a provider action is fired

providerActionTitle String optional

The title of the provider action

callback function

callback to be invoked when the provider is registered.

Example
FSBL.Clients.SearchClient.register({
			name: "MyProvider",
			searchCallback: searchApplications,
			itemActionCallback: itemActionCallback,
			providerActionTitle: providerActionTitle,
			providerActionCallback:providerActionCallback, (err, response) => {
		//provider has been registered
});

This initiates a search.

Name Type Description
params Object

Params object

Name Type Description
text String

The name of the provider

cb function

callback to called as search results for each provider are returned. Results are combined as they come in. So, every response will have the complete list of results that have been returned. Example: You have two proviers; provider one retunrs results first, you'll have an array with just the that providers data. Once Provider two returns you'll have results for proiver one and provider two.

Example
FSBL.Clients.SearchClient.search({
				text: "Chart",
				(err, response) => {
		//Search results will be returned here
});

unRegister
(params)
clients/searchClient.js, line 99

Remove a provider. This can only be done from the window that create the provider.

Name Type Description
params Object

-

Name Type Description
name string

The provider name

Example
FSBL.Clients.SearchClient.unRegister({name:"MyProvider"},function(){
});