|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.rim.device.api.unifiedsearch.searchables.adapters.RegisterableDataSource
net.rim.device.api.unifiedsearch.searchables.adapters.EntityBasedSearchableProvider
public class EntityBasedSearchableProvider
The EntityBasedSearchableProvider is the base class from which data sources should inherit in order to publish "findable" data into the Unified Search framework.
| Field Summary |
|---|
| Fields inherited from interface net.rim.device.api.unifiedsearch.searchables.Searchable |
|---|
PRIORITY_MAX, PRIORITY_MIN, PRIORITY_NORMAL |
| Constructor Summary | ||
|---|---|---|
|
EntityBasedSearchableProvider()
Creates an EntityBasedSearchableProvider instance. |
|
| Method Summary | ||
|---|---|---|
|
void |
addSearchableData(SearchableDataObject[] items)
Adds an array of SearchableDataObject items to the search index. |
|
void |
addSearchableData(SearchableDataObject[] items,
AppContentListener listener)
Adds an array of SearchableDataObject items to the search index. |
|
SearchField[] |
defineSupportedSearchFields()
Deprecated. Provide an overload of EntityBasedSearchableProvider.getSupportedSearchFields() instead |
|
Comparator |
getComparator()
Returns an application-specific comparator for the searches performed on the data within that application. |
|
Image |
getIcon()
Returns an icon for the Searchable. |
|
String |
getName()
Returns a human-readable string that represents the Searchable component. |
|
int |
getPriority()
Returns the preferred priority level for the Searchable. |
|
int |
getPrivacyLevel()
Returns the ExposureLevel of this Searchable. |
|
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 |
|
SearchField[] |
getSupportedSearchFields()
Returns the array of SearchFields that the SearchableDataObject belonging to this
EntityBasedSearchableProvider may have. |
|
long |
getType()
Returns the location and content type of the Searchable. |
|
UiAction |
getUiActions(SearchableEntity[] entities,
Object contextObject,
UiAction[] uiActions)
Returns a UiAction for multiple SearchableEntity objects. |
|
void |
load(NotificationListener observer,
int loadType)
Deprecated. Please use #addSearchableData(SearchableDataObject[] or another overload of that method instead. |
|
void |
pause()
Deprecated. This feature is no longer provided by EntityBasedSearchProvider. |
|
void |
removeAllData()
Removes all data associated with this SearchableDataSource instance. |
|
void |
removeSearchableData(SearchableDataObject[] items)
Removes an array of SearchableDataObject items from the search index if they exist. |
|
void |
removeSearchableData(SearchableDataObject[] items,
AppContentListener listener)
Removes an array of SearchableDataObject items from the search index if they exist. |
|
void |
resume()
Deprecated. This feature is no longer provided by EntityBasedSearchProvider. |
|
void |
setIcon(Image icon)
Sets the Image used to represent this EntityBasedSearchableProvider. |
|
void |
setName(String name)
Sets the name of this EntityBasedSearchableProvider instance. |
|
void |
setName(StringProvider name)
Sets the name of this EntityBasedSearchableProvider instance. |
|
void |
setPriority(int priority)
Sets the priority of the EntityBasedSearchableProvider. |
|
void |
setPrivacyLevel(int level)
Sets the exposure level of the data. |
|
void |
setSupportedSearchFields(SearchField[] fields)
Initializes the list of supported SearchField objects for this EntityBasedSearchableProvider. |
|
void |
setType(long type)
Sets the content type. |
|
String |
toString()
Default String representation of this object. |
|
void |
updateSearchableData(SearchableDataObject[] items)
Updates an array of SearchableDataObject items in the search index if they exist. |
|
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 |
|---|
public EntityBasedSearchableProvider()
EntityBasedSearchableProvider instance.
| Method Detail |
|---|
public final void load(NotificationListener observer,
int loadType)
#addSearchableData(SearchableDataObject[] or another overload of that method instead.
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.
load in interface Searchableobserver - 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.
public final void addSearchableData(SearchableDataObject[] items)
throws IllegalStateException,
IllegalArgumentException
items - an array of SearchableDataObject
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
NullPointerException - If items contains any null elements
public final void addSearchableData(SearchableDataObject[] items,
AppContentListener listener)
throws IllegalStateException,
IllegalArgumentException
items - an array of SearchableDataObjectlistener - the AppContentListener callback to notify about the transaction
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
NullPointerException - If items contains any null elements
public final void removeSearchableData(SearchableDataObject[] items)
throws IllegalStateException,
IllegalArgumentException
items - and array of SearchableDataObject to remove
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
public final void removeSearchableData(SearchableDataObject[] items,
AppContentListener listener)
throws IllegalStateException,
IllegalArgumentException
items - and array of SearchableDataObject to removelistener - the AppContentListener callback to notify about the transaction
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
public final void updateSearchableData(SearchableDataObject[] items)
throws IllegalStateException,
IllegalArgumentException
items - and array of SearchableDataObject to update
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
public final void updateSearchableData(SearchableDataObject[] items,
AppContentListener listener)
throws IllegalStateException,
IllegalArgumentException
items - and array of SearchableDataObject to updatelistener - the AppContentListener callback to notify about the transaction
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 configuredpublic final void removeAllData()
public final SearchField[] defineSupportedSearchFields()
EntityBasedSearchableProvider.getSupportedSearchFields() instead
Searchable. Allows the Unified Search Framework to discover
and optimize what fields are queryable.
defineSupportedSearchFields in interface SearchableArray of SearchField objects that describe
the fields this Searchable supports.public SearchField[] getSupportedSearchFields()
SearchableDataObject belonging to this
EntityBasedSearchableProvider may have. This method must be overloaded to provide at least one field.
SearchField objectspublic void setSupportedSearchFields(SearchField[] fields)
EntityBasedSearchableProvider.
fields - the array of SearchField objectspublic Comparator getComparator()
getComparator in interface SearchableComparator used by the Unified Search Framework
to sort search results from this Searchable.public void setIcon(Image icon)
EntityBasedSearchableProvider.
icon - the Image instance to setpublic Image getIcon()
Searchable.
getIcon in interface SearchableImage used to distinguish the Searchable in the user interface.public void setName(String name)
EntityBasedSearchableProvider instance.
name - the name of the EntityBasedSearchableProvider to setpublic void setName(StringProvider name)
EntityBasedSearchableProvider instance.
name - the StringProvider to use for setting the name of the EntityBasedSearchableProviderpublic String getName()
Searchable component.
getName in interface SearchableSearchable.public int getPriority()
Searchable.
getPriority in interface SearchableSearchable.PRIORITY_MIN and Searchable.PRIORITY_MAX
public void setPriority(int priority)
throws IllegalArgumentException
EntityBasedSearchableProvider.
priority - the priority rating for the EntityBasedSearchableProvider
IllegalArgumentException - If the priority is outside the accepted rangepublic int getPrivacyLevel()
ExposureLevel of this Searchable.
getPrivacyLevel in interface SearchableExposureLevelpublic void setPrivacyLevel(int level)
ExposureLevel for possible values.
level - the privacy level of data owned by the EntityBasedSearchableProvider.public void setType(long type)
SearchableContentTypeConstants for possible values.
type - The content type.public long getType()
Searchable.
getType in interface SearchableSearchableContentTypeConstants for more information about content type masks.public final void pause()
EntityBasedSearchProvider.
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.
pause in interface Searchablepublic final void resume()
EntityBasedSearchProvider.
resume in interface Searchable
public UiAction getUiActions(SearchableEntity[] entities,
Object contextObject,
UiAction[] uiActions)
UiAction for multiple SearchableEntity objects.
getUiActions in interface Searchableentities - 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.
null if the list of UiActions does not
contain an applicable UiAction.public final SearchableEntity[] getSearchableEntities()
EntityBasedSearchableProvider.addSearchableData(SearchableDataObject[]) or
AppContentManager.insertContent(SearchableEntity[], AppContentListener, RegistrationToken) to add data
to the search framework
SearchableEntity objects that a Searchable
wants to publish.
getSearchableEntities in interface EntityBasedSearchableSearchableEntity
objects to return, return a zero-length array (e.g. return new SearchableEntity[0];).public String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
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