Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 7 (11.1.7)

E22562-07

oracle.apps.fnd.applcore.globalSearch.ui
Interface SearchResult

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
AbstractSearchResult, ECSFSearchResultAdapter

public interface SearchResult
extends java.io.Serializable

A Search Result.

See Also:
AbstractSearchResult

Field Summary
static int BACKGROUND_SEARCH_BLOCK_SIZE
          The size of a background search.
static int BACKGROUND_SEARCH_MAX_POLL_COUNT
          The maximum number of polls for background searches.
static int BACKGROUND_SEARCH_POLL_INTERVAL
          The time in milliseconds between polls for background searches.
static int BLOCK_SIZE
          The number of results requested from SES via ECSF.
static java.lang.String LAST_UPDATED_DATE_ORDER_ATTRIBUTE
          The attribute name used in a search result to "order by Last Updated Date".
static java.lang.String RELEVANCE_ORDER_ATTRIBUTE
          The mock attribute name used in a search result to "order by relevance".
static long serialVersionUID
          Serial version id for serialization.
 
Method Summary
 void addWarning(java.lang.String warning)
          Add a warning to the search result.
 boolean allResultsRetrieved()
          Have all results been obtained from the search engine?
 void backgroundSearch(GlobalSearchSessionBean gssb)
          Run a background search given the existing set of criteria, that is categories, search string and filters.
 boolean containsAllSearchableCategories(java.util.List<SearchCategory> categories)
          Does the passed list of categories contain all of the Searchable categories.
 SearchResult copySearch()
          Copy the search criteria, but do not perform a search.
 boolean extendSearchResults()
          Extend the search results by calling the search engine.
 java.util.List<SearchCategory> getAllSearchableCategories()
          Get the list of all allowed categories the user can pick from.
 java.util.List<java.lang.String> getAlternateWords()
          Get the alternate words for this search.
 int getApproxNumResults()
          Get the heuristic number of results the searh engine estimates it can return.
 java.lang.String getApproxNumResultsStr()
          Get the heuristic number of results the searh engine estimates it can return as a String "1234 Resuts".
 java.util.List<TreeItem> getAttributeTreeItems()
          Get the attribute tree items for this search.
 org.apache.myfaces.trinidad.model.TreeModel getAttributeTreeModel()
          Get the attribute Tree Model.
 java.lang.String getCallerContext()
          Get the caller Search Context for this Search.
 TreeItem getCategoryTreeItem(SearchCategory group)
          Get the root level Tree Item for given category.
 org.apache.myfaces.trinidad.model.RowKeySet getCommonTreeDisclosedRowKeys()
          Get the disclosed row keys for the Common filters tree.
 java.util.List<BaseTreeItem> getCommonTreeItems()
          Get the common tree items for this search.
 org.apache.myfaces.trinidad.model.TreeModel getCommonTreeModel()
          Get the common Tree Model.
 int getCurrentNumberOfResults()
          Get the current number of group results.
 org.apache.myfaces.trinidad.model.RowKeySet getDisclosedRowKeys()
          Get the disclosed row keys for this result.
 java.lang.String getErrorMessageName()
          Obtain an error message name for the search, for cases where isInError() == true.
 SearchResultItem getItem(int index)
          Get the search results result item at index i.
 org.apache.myfaces.trinidad.model.CollectionModel getItemsCM()
          Get the CollectionModel used by the UI to show the results.
 java.lang.String getOrderingAttribute()
          Get the ordering attribute for this result.
 java.util.List<AdvancedSearchAttribute> getOrderingAttributes()
          Get Attribute names for those attributes currently returned by the search result.
 java.util.List<SearchResultItem> getResultItems()
          Get the result items.
 long getSearchCreationTime()
          Get the time this class was created.
 java.util.List<SearchCategory> getSearchedCategories()
          Get the list of categories used in the search.
 SearchFilterItems getSearchFilterItems()
          Get the current Search FIlter Items, this will include the categories, search text, topic and attribute filters.
 java.lang.String getSearchString()
          Get the Search String as entered by the user.
 java.lang.String getSearchTabName()
          Get the search tab name.
 java.util.List<java.lang.String> getWarningsList()
          Get any warnings from the search result.
 boolean isBackgroundSearched()
          Has a background search been performed?
 boolean isBackgroundSearchPollCountExceeded()
          Has the background poll count been exceeded? This method will prevent infinite polls (even though this is unlikely as search engine should exception after some period, even in worst case scnarios), even after the results window has been removed.
 boolean isInError()
          Is this search in error, that is could not be performed and should not be shown.
 boolean isOrderingAsc()
          Is the order ascending?
 boolean isSaved()
          Was this search result originally a saved search? It may have been refreshed due to an attribute filter re-search, but this would not change the fact that it was originally run as a seved search.
 boolean isSearched()
          Has the search been performed?
 boolean isSearchExhausted()
          Has the search been exhausted, that is all results retrieved and in memory?
 boolean isUsesFilters()
          Does this Search result support Attribute Filters?
 boolean isWarnings()
          Are there any warnings to show the user?
 void onBackgroundSearchPoll()
          Method to call when a background search poll is performed.
 void reOrder()
          Sort the results, based on current sort algorith, if any.
 void search()
          Run a search given the existing set of criteria, that is categories, search string and filters.
 void setBackgroundSearched(boolean backgroundSearched)
          Set the a background search status?
 void setDisclosedRowKeys(org.apache.myfaces.trinidad.model.RowKeySet disclosedRowKeys)
          Set the disclosed row keys for this result.
 void setOrderingAsc(boolean orderingAsc)
          Set the ordering direction for this result.
 void setOrderingAttribute(java.lang.String attr)
          Set the ordering attribute for this result.
 void setSaved(boolean wasSaved)
          Set the initial saved stateof this search? It may have been refreshed due to an attribute filter re-search, but this would not change the fact that it was originally run as a seved search.
 

Field Detail

BLOCK_SIZE

static final int BLOCK_SIZE
The number of results requested from SES via ECSF. If this number is too large, there will be significant initial overhead in bringing up the search result. If it is too small, multiple search extensions will be performed, also slowing down the results coming up. This value MUST be at least twice the table fetchSize.

Refer: SearchResultCM AF_TABLE_FETCHSIZE and GlobalSearchResultTabDC.jsff af:table fetchSize attribute.

See Also:
SearchResultCM, Constant Field Values

BACKGROUND_SEARCH_BLOCK_SIZE

static final int BACKGROUND_SEARCH_BLOCK_SIZE
The size of a background search. Background searches are performed to give larger result sizes to the user for sorting, and to prevent delays on scrolling. It is necessarily > BLOCK_SIZE

See Also:
Constant Field Values

BACKGROUND_SEARCH_POLL_INTERVAL

static final int BACKGROUND_SEARCH_POLL_INTERVAL
The time in milliseconds between polls for background searches.

See Also:
Constant Field Values

BACKGROUND_SEARCH_MAX_POLL_COUNT

static final int BACKGROUND_SEARCH_MAX_POLL_COUNT
The maximum number of polls for background searches.

See Also:
Constant Field Values

RELEVANCE_ORDER_ATTRIBUTE

static final java.lang.String RELEVANCE_ORDER_ATTRIBUTE
The mock attribute name used in a search result to "order by relevance".

See Also:
Constant Field Values

LAST_UPDATED_DATE_ORDER_ATTRIBUTE

static final java.lang.String LAST_UPDATED_DATE_ORDER_ATTRIBUTE
The attribute name used in a search result to "order by Last Updated Date".

See Also:
Constant Field Values

serialVersionUID

static final long serialVersionUID
Serial version id for serialization.

See Also:
Constant Field Values
Method Detail

getSearchCreationTime

long getSearchCreationTime()
Get the time this class was created.

Returns:
millsecs since opoc since creation.

copySearch

SearchResult copySearch()
Copy the search criteria, but do not perform a search. It is expected that a search will be performed soon after this call.

Returns:
a copy of the search, containing the search string, categories, and any other filters, but no search results.

getSearchFilterItems

SearchFilterItems getSearchFilterItems()
Get the current Search FIlter Items, this will include the categories, search text, topic and attribute filters.

Returns:
search filter items.

getSearchedCategories

java.util.List<SearchCategory> getSearchedCategories()
Get the list of categories used in the search. Expect that there will be 1 searched category per group.

Returns:
categories used in the search.

getAllSearchableCategories

java.util.List<SearchCategory> getAllSearchableCategories()
Get the list of all allowed categories the user can pick from. This should be a superset of the searchedCategories.

Returns:
categories used in the search.

containsAllSearchableCategories

boolean containsAllSearchableCategories(java.util.List<SearchCategory> categories)
Does the passed list of categories contain all of the Searchable categories.

Parameters:
categories - non-null List of SearchCategory.
Returns:
true if all, false otherwise.

getSearchString

java.lang.String getSearchString()
Get the Search String as entered by the user.

Returns:
search String.

getCallerContext

java.lang.String getCallerContext()
Get the caller Search Context for this Search. The Search Context is a String which represents to the caller, the context in which the search result will be called. This primarily relates to saved searches, which will be saved with this context, and only saved searches with this context shown to the user.

Returns:
caller context.

getAttributeTreeModel

org.apache.myfaces.trinidad.model.TreeModel getAttributeTreeModel()
Get the attribute Tree Model.

Returns:
attribute Tree Model.

getCategoryTreeItem

TreeItem getCategoryTreeItem(SearchCategory group)
Get the root level Tree Item for given category.

Parameters:
group - group to find.
Returns:
relevant tree item, one will be created if it does not exist.

getItemsCM

org.apache.myfaces.trinidad.model.CollectionModel getItemsCM()
Get the CollectionModel used by the UI to show the results.

Returns:
CollectionModel

getApproxNumResults

int getApproxNumResults()
Get the heuristic number of results the searh engine estimates it can return. This number is likely to be accurate for small numbers of results, but an estimate only for large results.

Returns:
estimated number of results it is possible to search.

getApproxNumResultsStr

java.lang.String getApproxNumResultsStr()
Get the heuristic number of results the searh engine estimates it can return as a String "1234 Resuts". This number is likely to be accurate for small numbers of results, but an estimate only for large results.

Returns:
String representing the estimated number of results it is possible to search.
See Also:
getApproxNumResults()

getCurrentNumberOfResults

int getCurrentNumberOfResults()
Get the current number of group results. This is the number that has already been obtained by the search engine, not the total number of heuristic hits the search engine may be able to return if asked.

Returns:
current number of group results

getItem

SearchResultItem getItem(int index)
Get the search results result item at index i. If this item is not available (i >= getCurrentNumberOfGroupResults()) null will be returned. In this case extendSearchResults() should be used to obtain more results.

Parameters:
index - 0 based index into results.
Returns:
valid item if available, null otherwise.

allResultsRetrieved

boolean allResultsRetrieved()
Have all results been obtained from the search engine?

Returns:
true iff all results retrieved, false otherwise.

extendSearchResults

boolean extendSearchResults()
Extend the search results by calling the search engine.

Returns:
true if no error, false if major problem extending.

isSearched

boolean isSearched()
Has the search been performed?

Returns:
true is any search has been performed, false otherwise.

search

void search()
Run a search given the existing set of criteria, that is categories, search string and filters.


getAttributeTreeItems

java.util.List<TreeItem> getAttributeTreeItems()
Get the attribute tree items for this search. This method may return a copy, but is more likely to return the base structure so it can be passed between searches as the tree grows through user searches.

Returns:
the list of tree items for the search

getSearchTabName

java.lang.String getSearchTabName()
Get the search tab name.

Returns:
search tab name.

isUsesFilters

boolean isUsesFilters()
Does this Search result support Attribute Filters?

Returns:
true is supports attribute filters.

setDisclosedRowKeys

void setDisclosedRowKeys(org.apache.myfaces.trinidad.model.RowKeySet disclosedRowKeys)
Set the disclosed row keys for this result.

Parameters:
disclosedRowKeys - disclosed row keys.

getDisclosedRowKeys

org.apache.myfaces.trinidad.model.RowKeySet getDisclosedRowKeys()
Get the disclosed row keys for this result.

Returns:
disclosed row keys.

isSaved

boolean isSaved()
Was this search result originally a saved search? It may have been refreshed due to an attribute filter re-search, but this would not change the fact that it was originally run as a seved search.

Returns:
true if was originally run as a saved search, false otherwise.

setSaved

void setSaved(boolean wasSaved)
Set the initial saved stateof this search? It may have been refreshed due to an attribute filter re-search, but this would not change the fact that it was originally run as a seved search.

Parameters:
wasSaved - if was originally run as a saved search, false otherwise.

isInError

boolean isInError()
Is this search in error, that is could not be performed and should not be shown.

Returns:
true if in error, false otherwise.

getErrorMessageName

java.lang.String getErrorMessageName()
Obtain an error message name for the search, for cases where isInError() == true.

Returns:
error message name from fnd_messages.

getWarningsList

java.util.List<java.lang.String> getWarningsList()
Get any warnings from the search result.

Returns:
any warnings.

addWarning

void addWarning(java.lang.String warning)
Add a warning to the search result.

Parameters:
warning - the warning text to show the user.

isWarnings

boolean isWarnings()
Are there any warnings to show the user?

Returns:
true if any warnings, false if not.

getAlternateWords

java.util.List<java.lang.String> getAlternateWords()
Get the alternate words for this search.

Returns:
possibly empty, but not null list of alternate words.

getResultItems

java.util.List<SearchResultItem> getResultItems()
Get the result items.

Returns:
result items, possibly empty but never null.

isSearchExhausted

boolean isSearchExhausted()
Has the search been exhausted, that is all results retrieved and in memory?

Returns:
true if search complete.

isBackgroundSearched

boolean isBackgroundSearched()
Has a background search been performed?

Returns:
true is a background search has been performed, false otherwise.

setBackgroundSearched

void setBackgroundSearched(boolean backgroundSearched)
Set the a background search status?

Parameters:
backgroundSearched - true if a background search has been performed, false otherwise.

backgroundSearch

void backgroundSearch(GlobalSearchSessionBean gssb)
Run a background search given the existing set of criteria, that is categories, search string and filters. This is used to append to the small set of originally obtained results for grouping and filtering.

Parameters:
gssb - session bean, not available from session in new thread.

onBackgroundSearchPoll

void onBackgroundSearchPoll()
Method to call when a background search poll is performed. This method will update the poll count.


isBackgroundSearchPollCountExceeded

boolean isBackgroundSearchPollCountExceeded()
Has the background poll count been exceeded? This method will prevent infinite polls (even though this is unlikely as search engine should exception after some period, even in worst case scnarios), even after the results window has been removed.

Returns:
true if time to stop polling.

getOrderingAttributes

java.util.List<AdvancedSearchAttribute> getOrderingAttributes()
Get Attribute names for those attributes currently returned by the search result. This List is expected to change as the result is extended.

Returns:
List of attributes.

setOrderingAsc

void setOrderingAsc(boolean orderingAsc)
Set the ordering direction for this result.

Parameters:
orderingAsc - true for ascending, false for descending.

isOrderingAsc

boolean isOrderingAsc()
Is the order ascending?

Returns:
true if ascending, false if descending.

getOrderingAttribute

java.lang.String getOrderingAttribute()
Get the ordering attribute for this result.

Returns:
attr name of attribute.

setOrderingAttribute

void setOrderingAttribute(java.lang.String attr)
Set the ordering attribute for this result.

Parameters:
attr - name of attribute.

reOrder

void reOrder()
Sort the results, based on current sort algorith, if any.


getCommonTreeItems

java.util.List<BaseTreeItem> getCommonTreeItems()
Get the common tree items for this search. This method may return a copy, but is more likely to return the base structure so it can be passed between searches as the tree grows through user searches.

Returns:
the list of tree items for the search

getCommonTreeModel

org.apache.myfaces.trinidad.model.TreeModel getCommonTreeModel()
Get the common Tree Model.

Returns:
common Tree Model.

getCommonTreeDisclosedRowKeys

org.apache.myfaces.trinidad.model.RowKeySet getCommonTreeDisclosedRowKeys()
Get the disclosed row keys for the Common filters tree.

Returns:
disclosed row key set.

Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 7 (11.1.7)

E22562-07

Copyright © 2013 Oracle. All Rights Reserved.