net.rim.device.api.unifiedsearch.searchables.adapters
Class EntityBasedSearchableProvider

java.lang.Object
  extended by net.rim.device.api.unifiedsearch.searchables.adapters.RegisterableDataSource
      extended by net.rim.device.api.unifiedsearch.searchables.adapters.EntityBasedSearchableProvider
All Implemented Interfaces:
EntityBasedSearchable, Searchable

public class EntityBasedSearchableProvider
extends RegisterableDataSource
implements EntityBasedSearchable

The EntityBasedSearchableProvider is the base class from which data sources should inherit in order to publish "findable" data into the Unified Search framework.

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

Field Summary
 
Fields inherited from interface net.rim.device.api.unifiedsearch.searchables.Searchable
PRIORITY_MAX, PRIORITY_MIN, PRIORITY_NORMAL
 
Constructor Summary
Category: Signed EntityBasedSearchableProvider()
          Creates an EntityBasedSearchableProvider instance.
 
Method Summary
Category: Signed  void addSearchableData(SearchableDataObject[] items)
          Adds an array of SearchableDataObject items to the search index
Category: Signed  void addSearchableData(SearchableDataObject[] items, AppContentListener listener)
          Adds an array of SearchableDataObject items to the search index
Category: Signed  SearchField[] defineSupportedSearchFields()
          Deprecated. Provide an overload of EntityBasedSearchableProvider.getSupportedSearchFields() instead
Category: Signed  Comparator getComparator()
          Returns an application-specific comparator for the searches performed on the data within that application.
Category: Signed  Image getIcon()
          Returns an icon for the Searchable.
Category: Signed  String getName()
          Returns a human-readable string that represents the Searchable component.
Category: Signed  int getPriority()
          Returns the preferred priority level for the Searchable.
Category: Signed  int getPrivacyLevel()
          Returns the ExposureLevel of this Searchable.
Category: Signed  SearchableEntity[] getSearchableEntities()
          Deprecated. The framework will not invoke this method. Use EntityBasedSearchableProvider.addSearchableData(SearchableDataObject[]) or AppContentManager.insertContent(SearchableEntity[], AppContentListener, RegistrationToken) to add data to the search framework
Category: Signed  SearchField[] getSupportedSearchFields()
          Returns the array of SearchFields that the SearchableDataObject belonging to this EntityBasedSearchableProvider may have.
Category: Signed  long getType()
          Returns the location and content type of the Searchable.
Category: Signed  UiAction getUiActions(SearchableEntity[] entities, Object contextObject, UiAction[] uiActions)
          Returns a UiAction for multiple SearchableEntity objects.
Category: Signed  void load(NotificationListener observer, int loadType)
          Deprecated. Please use #addSearchableData(SearchableDataObject[] or another overload of that method instead.
Category: Signed  void pause()
          Deprecated. This feature is no longer provided by EntityBasedSearchProvider.
Category: Signed  void removeAllData()
          Removes all data associated with this SearchableDataSource instance
Category: Signed  void removeSearchableData(SearchableDataObject[] items)
          Removes an array of SearchableDataObject items from the search index if they exist
Category: Signed  void removeSearchableData(SearchableDataObject[] items, AppContentListener listener)
          Removes an array of SearchableDataObject items from the search index if they exist
Category: Signed  void resume()
          Deprecated. This feature is no longer provided by EntityBasedSearchProvider.
Category: Signed  void setIcon(Image icon)
          Sets the Image used to represent this EntityBasedSearchableProvider
Category: Signed  void setName(String name)
          Sets the name of this EntityBasedSearchableProvider instance
Category: Signed  void setName(StringProvider name)
          Sets the name of this EntityBasedSearchableProvider instance
Category: Signed  void setPriority(int priority)
          Sets the priority of the EntityBasedSearchableProvider
Category: Signed  void setPrivacyLevel(int level)
          Sets the exposure level of the data.
Category: Signed  void setSupportedSearchFields(SearchField[] fields)
          Initializes the list of supported SearchField objects for this EntityBasedSearchableProvider
Category: Signed  void setType(long type)
          Sets the content type.
Category: Signed  String toString()
          Default String representation of this object
Category: Signed  void updateSearchableData(SearchableDataObject[] items)
          Updates an array of SearchableDataObject items in the search index if they exist
Category: Signed  void updateSearchableData(SearchableDataObject[] items, AppContentListener listener)
          Updates an array of SearchableDataObject items in the search index if they exist
 
Methods inherited from class net.rim.device.api.unifiedsearch.searchables.adapters.RegisterableDataSource
deregister, getListener, getRegistrationID, getRegistrationToken, register, setListener, setRegistrationID, setRegistrationToken
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.rim.device.api.unifiedsearch.searchables.Searchable
getRegistrationID, setRegistrationID
 



Constructor Detail

EntityBasedSearchableProvider

public EntityBasedSearchableProvider()
Creates an EntityBasedSearchableProvider instance.

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0


Method Detail

load

public final void load(NotificationListener observer,
                       int loadType)
Deprecated. Please use #addSearchableData(SearchableDataObject[] or another overload of that method instead.

Begins loading searchable data into the Unified Search Framework. The Searchable may choose to update the Framework via the NotificationListener reference, or it may choose to create its entries using AppContentManager.

After this method is invoked, the Framework may invoke pause(). In this a scenario, load should attempt to promptly complete any unit of activity, save its current state, then go dormant. It is preferred that the Searchable enters a wait state with Object.wait() to conserve processor use.

Specified by:
load in interface Searchable
Parameters:
observer - The object to notify of loading progress. This searchable must notify the Unified Search Framework when loading is complete by invoking a command similar to: observer.completed(this, null, NotificationListener.TYPE_SEARCHABLE).
loadType - A SearchableEventConstants constant that indicates why the load event was triggered.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

addSearchableData

public final void addSearchableData(SearchableDataObject[] items)
                             throws IllegalStateException,
                                    IllegalArgumentException
Adds an array of SearchableDataObject items to the search index

Parameters:
items - and array of SearchableDataObject
Throws:
IllegalStateException - If the System is in a state that does not allow the operation to proceed
IllegalArgumentException - If the parameters are malformed, or not correctly configured
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

addSearchableData

public final void addSearchableData(SearchableDataObject[] items,
                                    AppContentListener listener)
                             throws IllegalStateException,
                                    IllegalArgumentException
Adds an array of SearchableDataObject items to the search index

Parameters:
items - and array of SearchableDataObject
listener - the AppContentListener callback to notify about the transaction
Throws:
IllegalStateException - If the System is in a state that does not allow the operation to proceed
IllegalArgumentException - If the parameters are malformed, or not correctly configured
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

removeSearchableData

public final void removeSearchableData(SearchableDataObject[] items)
                                throws IllegalStateException,
                                       IllegalArgumentException
Removes an array of SearchableDataObject items from the search index if they exist

Parameters:
items - and array of SearchableDataObject to remove
Throws:
IllegalStateException - If the System is in a state that does not allow the operation to proceed
IllegalArgumentException - If the parameters are malformed, or not correctly configured
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

removeSearchableData

public final void removeSearchableData(SearchableDataObject[] items,
                                       AppContentListener listener)
                                throws IllegalStateException,
                                       IllegalArgumentException
Removes an array of SearchableDataObject items from the search index if they exist

Parameters:
items - and array of SearchableDataObject to remove
listener - the AppContentListener callback to notify about the transaction
Throws:
IllegalStateException - If the System is in a state that does not allow the operation to proceed
IllegalArgumentException - If the parameters are malformed, or not correctly configured
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

updateSearchableData

public final void updateSearchableData(SearchableDataObject[] items)
                                throws IllegalStateException,
                                       IllegalArgumentException
Updates an array of SearchableDataObject items in the search index if they exist

Parameters:
items - and array of SearchableDataObject to update
Throws:
IllegalStateException - If the System is in a state that does not allow the operation to proceed
IllegalArgumentException - If the parameters are malformed, or not correctly configured
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

updateSearchableData

public final void updateSearchableData(SearchableDataObject[] items,
                                       AppContentListener listener)
                                throws IllegalStateException,
                                       IllegalArgumentException
Updates an array of SearchableDataObject items in the search index if they exist

Parameters:
items - and array of SearchableDataObject to update
listener - the AppContentListener callback to notify about the transaction
Throws:
IllegalStateException - If the System is in a state that does not allow the operation to proceed
IllegalArgumentException - If the parameters are malformed, or not correctly configured
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

removeAllData

public final void removeAllData()
Removes all data associated with this SearchableDataSource instance

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

defineSupportedSearchFields

public final SearchField[] defineSupportedSearchFields()
Deprecated. Provide an overload of EntityBasedSearchableProvider.getSupportedSearchFields() instead

Returns an array of searchable fields controlled by this Searchable. Allows the Unified Search Framework to discover and optimize what fields are queryable.

Specified by:
defineSupportedSearchFields in interface Searchable
Returns:
An Array of SearchField objects that describe the fields this Searchable supports.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

getSupportedSearchFields

public SearchField[] getSupportedSearchFields()
Returns the array of SearchFields that the SearchableDataObject belonging to this EntityBasedSearchableProvider may have. This method must be overloaded to provide at least one field.

Returns:
an array of SearchField objects
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

setSupportedSearchFields

public void setSupportedSearchFields(SearchField[] fields)
Initializes the list of supported SearchField objects for this EntityBasedSearchableProvider

Parameters:
fields - the array of SearchField objects
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

getComparator

public Comparator getComparator()
Returns an application-specific comparator for the searches performed on the data within that application.

Specified by:
getComparator in interface Searchable
Returns:
The Comparator used by the Unified Search Framework to sort search results from this Searchable.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

setIcon

public void setIcon(Image icon)
Sets the Image used to represent this EntityBasedSearchableProvider

Parameters:
icon - the Image instance to set
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

getIcon

public Image getIcon()
Returns an icon for the Searchable.

Specified by:
getIcon in interface Searchable
Returns:
An Image used to distinguish the Searchable in the user interface.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

setName

public void setName(String name)
Sets the name of this EntityBasedSearchableProvider instance

Parameters:
name - the name of the EntityBasedSearchableProvider to set
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

setName

public void setName(StringProvider name)
Sets the name of this EntityBasedSearchableProvider instance

Parameters:
name - the StringProvider to use for setting the name of the EntityBasedSearchableProvider
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

getName

public String getName()
Returns a human-readable string that represents the Searchable component.

Specified by:
getName in interface Searchable
Returns:
A string that represents the Searchable.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

getPriority

public int getPriority()
Returns the preferred priority level for the Searchable.

Specified by:
getPriority in interface Searchable
Returns:
A value between Searchable.PRIORITY_MIN and Searchable.PRIORITY_MAX
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

setPriority

public void setPriority(int priority)
                 throws IllegalArgumentException
Sets the priority of the EntityBasedSearchableProvider

Parameters:
priority - the priority rating for the EntityBasedSearchableProvider
Throws:
IllegalArgumentException - If the priority is outside the accepted range
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

getPrivacyLevel

public int getPrivacyLevel()
Returns the ExposureLevel of this Searchable.

Specified by:
getPrivacyLevel in interface Searchable
Returns:
The ExposureLevel
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

setPrivacyLevel

public void setPrivacyLevel(int level)
Sets the exposure level of the data. See ExposureLevel for possible values.

Parameters:
level - the privacy level of data owned by the EntityBasedSearchableProvider.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

setType

public void setType(long type)
Sets the content type. See SearchableContentTypeConstants for possible values.

Parameters:
type - The content type.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

getType

public long getType()
Returns the location and content type of the Searchable.

Specified by:
getType in interface Searchable
Returns:
See SearchableContentTypeConstants for more information about content type masks.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

pause

public final void pause()
Deprecated. This feature is no longer provided by EntityBasedSearchProvider.

Pauses any outstanding load operations. Searchable must halt the loading operation as soon as possible. It is preferred that the object enter a wait state using Object.wait(). If resume() is invoked after pause(), the load operation should continue from where it left off.

Specified by:
pause in interface Searchable
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

resume

public final void resume()
Deprecated. This feature is no longer provided by EntityBasedSearchProvider.

Resumes any outstanding load operations.

Specified by:
resume in interface Searchable
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

getUiActions

public UiAction getUiActions(SearchableEntity[] entities,
                             Object contextObject,
                             UiAction[] uiActions)
Returns a UiAction for multiple SearchableEntity objects.

Specified by:
getUiActions in interface Searchable
Parameters:
entities - An Array of SearchableEntity objects.
contextObject - The context of the search. Used to determine the appropriate list of available UiAction.
uiActions - An array of UiAction objects. Initially this Array, is empty and will be filled with all applicable UiActions, including the default UiAction if not null.
Returns:
The default UiAction for the SearchableEntities; or null if the list of UiActions does not contain an applicable UiAction.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

getSearchableEntities

public final SearchableEntity[] getSearchableEntities()
Deprecated. The framework will not invoke this method. Use EntityBasedSearchableProvider.addSearchableData(SearchableDataObject[]) or AppContentManager.insertContent(SearchableEntity[], AppContentListener, RegistrationToken) to add data to the search framework

Returns an array of SearchableEntity objects that a Searchable wants to publish.

Specified by:
getSearchableEntities in interface EntityBasedSearchable
Returns:
An array of searchable entities. If there are no SearchableEntity objects to return, return a zero-length array (e.g. return new SearchableEntity[0];).
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0

toString

public String toString()
Default String representation of this object

Overrides:
toString in class Object
Returns:
A string describing this object
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 7.0.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal