Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 1 (11.1.1.6)

E22562-05

oracle.apps.fnd.applcore.globalSearch.ui
Class AbstractSearchResult

java.lang.Object
  extended by oracle.apps.fnd.applcore.globalSearch.ui.AbstractSearchResult
All Implemented Interfaces:
java.io.Serializable, SearchResult
Direct Known Subclasses:
ECSFSearchResultAdapter

public abstract class AbstractSearchResult
extends java.lang.Object
implements SearchResult, java.io.Serializable

An abstract base class for Search Results. All implementation classes MUST extend this abstract class and not implement the interface directly to allow for future interface changes.

Author:
David Groves <david.groves@oracle.com>
See Also:
Serialized Form

Field Summary
protected  java.util.List<SearchCategory> _allSearchableCategories
          All categories that can be searched upon, not necessarily the ones the user picked to search on.
protected  java.util.List<TreeItem> _attributeTreeItems
          The root tree items wrapped by _attributeTreeModel for our JSF tree.
protected  org.apache.myfaces.trinidad.model.TreeModel _attributeTreeModel
           
protected  java.lang.String _callerContext
           
protected  java.util.List<BaseTreeItem> _commonTreeItems
          The root tree items wrapped by _commonTreeModel for our common filters JSF tree.
protected  org.apache.myfaces.trinidad.model.TreeModel _commonTreeModel
           
protected  java.lang.String _errorMessageName
          Error message name in cases where _inError == true.
protected  boolean _inError
           
protected  java.util.Locale _locale
          Locale to do formatting on.
protected  java.util.List<AdvancedSearchAttribute> _orderingAttributes
          The set of attribute names we can order by.
protected  boolean _rtl
          Is this result in Right-to-Left order.
protected  boolean _searched
          Has this search been performed?
protected  java.util.List<SearchCategory> _searchedCategories
          The basic set of searched categories selected by the user from the Category list in the UI.
protected  boolean _searchExhausted
          Has the search been exhausted, that is all results retrieved and in memory?
protected  SearchFilterItems _searchFilterItems
           
protected  java.lang.String _searchString
           
 
Fields inherited from interface oracle.apps.fnd.applcore.globalSearch.ui.SearchResult
BACKGROUND_SEARCH_BLOCK_SIZE, BACKGROUND_SEARCH_MAX_POLL_COUNT, BACKGROUND_SEARCH_POLL_INTERVAL, BLOCK_SIZE, LAST_UPDATED_DATE_ORDER_ATTRIBUTE, RELEVANCE_ORDER_ATTRIBUTE
 
Constructor Summary
AbstractSearchResult(AbstractSearchResult base, java.lang.String searchTabName, java.util.List<SearchCategory> searchCategories, java.util.List<SearchCategory> allSearchableCategories, java.lang.String searchString, java.lang.String callerContext, boolean usesFilters)
          Construct this class.
AbstractSearchResult(java.lang.String searchTabName, java.util.List<SearchCategory> searchCategories, java.util.List<SearchCategory> allSearchableCategories, java.lang.String searchString, java.lang.String callerContext, boolean usesFilters)
          Construct this class.
 
Method Summary
 void addAlternateWords(java.lang.String alternateWords)
          Set the alternate words from a csv String.
 void addWarning(java.lang.String warning)
          Add a warning to the search result.
 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.
 boolean equals(java.lang.Object obj)
          
 void generatePersistentFilters(java.util.List<PersistentSearchFilter> searchFilters, java.util.List<SearchCategory> allCats)
          Add persistent filters into the searchFilters arguement from the current search result.
 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.
 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.
 java.util.List<SearchCategory> getCategoriesUsedInSearchQuery()
          Get the categories actually used in the search query, this is not necessarily _searchCategories, in cases where a narrowing of the query is done using filters.
 TreeItem getCategoryTreeItem(SearchCategory cat)
          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.util.Locale getLocale()
          Get the Locale for this result.
 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.
 int hashCode()
          
 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 isRtl()
          Get the reading direction for this result.
 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 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.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.apps.fnd.applcore.globalSearch.ui.SearchResult
allResultsRetrieved, copySearch, extendSearchResults, getApproxNumResults, search
 

Field Detail

_searched

protected boolean _searched
Has this search been performed?


_searchExhausted

protected boolean _searchExhausted
Has the search been exhausted, that is all results retrieved and in memory?


_inError

protected boolean _inError

_errorMessageName

protected java.lang.String _errorMessageName
Error message name in cases where _inError == true.


_searchFilterItems

protected SearchFilterItems _searchFilterItems

_searchedCategories

protected java.util.List<SearchCategory> _searchedCategories
The basic set of searched categories selected by the user from the Category list in the UI. It does not represent any narrowing of the search using filters.


_allSearchableCategories

protected java.util.List<SearchCategory> _allSearchableCategories
All categories that can be searched upon, not necessarily the ones the user picked to search on.


_searchString

protected java.lang.String _searchString

_callerContext

protected java.lang.String _callerContext

_attributeTreeItems

protected java.util.List<TreeItem> _attributeTreeItems
The root tree items wrapped by _attributeTreeModel for our JSF tree.


_attributeTreeModel

protected transient org.apache.myfaces.trinidad.model.TreeModel _attributeTreeModel

_commonTreeItems

protected java.util.List<BaseTreeItem> _commonTreeItems
The root tree items wrapped by _commonTreeModel for our common filters JSF tree.


_commonTreeModel

protected transient org.apache.myfaces.trinidad.model.TreeModel _commonTreeModel

_rtl

protected boolean _rtl
Is this result in Right-to-Left order.


_locale

protected java.util.Locale _locale
Locale to do formatting on.


_orderingAttributes

protected java.util.List<AdvancedSearchAttribute> _orderingAttributes
The set of attribute names we can order by. #relevance# is never in this list, it always exists.

Constructor Detail

AbstractSearchResult

public AbstractSearchResult(java.lang.String searchTabName,
                            java.util.List<SearchCategory> searchCategories,
                            java.util.List<SearchCategory> allSearchableCategories,
                            java.lang.String searchString,
                            java.lang.String callerContext,
                            boolean usesFilters)
Construct this class.

Parameters:
searchTabName - Search Tab name.
searchCategories - search categories.
allSearchableCategories - list of allowed categories to search on. A superset of searchCategories.
searchString - Search String.
callerContext - 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.
usesFilters - does this search use filters.

AbstractSearchResult

public AbstractSearchResult(AbstractSearchResult base,
                            java.lang.String searchTabName,
                            java.util.List<SearchCategory> searchCategories,
                            java.util.List<SearchCategory> allSearchableCategories,
                            java.lang.String searchString,
                            java.lang.String callerContext,
                            boolean usesFilters)
Construct this class.

Parameters:
base - base search to take items from.
searchTabName - Search Tab name.
searchCategories - search categories.
allSearchableCategories - list of allowed categories to search on. A superset of searchCategories.
searchString - Search String.
callerContext - 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.
usesFilters - does this search use filters.
Method Detail

getSearchFilterItems

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

Specified by:
getSearchFilterItems in interface SearchResult
Returns:
search filter items.

getSearchedCategories

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

Specified by:
getSearchedCategories in interface SearchResult
Returns:
categories used in the search.

getAllSearchableCategories

public 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.

Specified by:
getAllSearchableCategories in interface SearchResult
Returns:
categories used in the search.

containsAllSearchableCategories

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

Specified by:
containsAllSearchableCategories in interface SearchResult
Parameters:
categories - non-null List of SearchCategory.
Returns:
true if all, false otherwise.

getSearchString

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

Specified by:
getSearchString in interface SearchResult
Returns:
search String.

getCallerContext

public 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.

Specified by:
getCallerContext in interface SearchResult
Returns:
caller context.

getAttributeTreeModel

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

Specified by:
getAttributeTreeModel in interface SearchResult
Returns:
attribute Tree Model.

getCategoryTreeItem

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

Specified by:
getCategoryTreeItem in interface SearchResult
Parameters:
cat - group to find.
Returns:
relevant tree item, one will be created if it does not exist.

getItemsCM

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

Specified by:
getItemsCM in interface SearchResult
Returns:
CollectionModel

getAttributeTreeItems

public 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.

Specified by:
getAttributeTreeItems in interface SearchResult
Returns:
the list of tree items for the search

getCommonTreeItems

public 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.

Specified by:
getCommonTreeItems in interface SearchResult
Returns:
the list of tree items for the search

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

getSearchTabName

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

Specified by:
getSearchTabName in interface SearchResult
Returns:
search tab name.

isSearched

public boolean isSearched()
Has the search been performed?

Specified by:
isSearched in interface SearchResult
Returns:
true is any search has been performed, false otherwise.

isSearchExhausted

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

Specified by:
isSearchExhausted in interface SearchResult
Returns:
true if search complete.

isUsesFilters

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

Specified by:
isUsesFilters in interface SearchResult
Returns:
true is supports attribute filters.

setDisclosedRowKeys

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

Specified by:
setDisclosedRowKeys in interface SearchResult
Parameters:
disclosedRowKeys - disclosed row keys.

getDisclosedRowKeys

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

Specified by:
getDisclosedRowKeys in interface SearchResult
Returns:
disclosed row keys.

isSaved

public 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.

Specified by:
isSaved in interface SearchResult
Returns:
true if was originally run as a saved search, false otherwise.

setSaved

public 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.

Specified by:
setSaved in interface SearchResult
Parameters:
wasSaved - if was originally run as a saved search, false otherwise.

getSearchCreationTime

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

Specified by:
getSearchCreationTime in interface SearchResult
Returns:
millsecs since opoc since creation.

getApproxNumResultsStr

public 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.

Specified by:
getApproxNumResultsStr in interface SearchResult
Returns:
String representing the estimated number of results it is possible to search.
See Also:
SearchResult.getApproxNumResults()

isInError

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

Specified by:
isInError in interface SearchResult
Returns:
true if in error, false otherwise.

getErrorMessageName

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

Specified by:
getErrorMessageName in interface SearchResult
Returns:
error message name from fnd_messages.

getWarningsList

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

Specified by:
getWarningsList in interface SearchResult
Returns:
any warnings.

addWarning

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

Specified by:
addWarning in interface SearchResult
Parameters:
warning - the warning text to show the user.

isWarnings

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

Specified by:
isWarnings in interface SearchResult
Returns:
true if any warnings, false if not.

addAlternateWords

public void addAlternateWords(java.lang.String alternateWords)
Set the alternate words from a csv String.

Parameters:
alternateWords - csv string of alternate words.

isRtl

public boolean isRtl()
Get the reading direction for this result.

Returns:
true if right-to-left, false if left-to-left (US).

getLocale

public java.util.Locale getLocale()
Get the Locale for this result.

Returns:
Locale.

getAlternateWords

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

Specified by:
getAlternateWords in interface SearchResult
Returns:
possibly empty, but not null list of alternate words.

getCurrentNumberOfResults

public 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.

Specified by:
getCurrentNumberOfResults in interface SearchResult
Returns:
current number of group results

getResultItems

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

Specified by:
getResultItems in interface SearchResult
Returns:
result items, possibly empty but never null.

getItem

public 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.

Specified by:
getItem in interface SearchResult
Parameters:
index - 0 based index into results.
Returns:
valid item if available, null otherwise.

getCategoriesUsedInSearchQuery

public java.util.List<SearchCategory> getCategoriesUsedInSearchQuery()
Get the categories actually used in the search query, this is not necessarily _searchCategories, in cases where a narrowing of the query is done using filters.

Returns:
categories actually used in search.

isBackgroundSearched

public boolean isBackgroundSearched()
Has a background search been performed?

Specified by:
isBackgroundSearched in interface SearchResult
Returns:
true is a background search has been performed, false otherwise.

setBackgroundSearched

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

Specified by:
setBackgroundSearched in interface SearchResult
Parameters:
backgroundSearched - true if a background search has been performed, false otherwise.

backgroundSearch

public 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.

Specified by:
backgroundSearch in interface SearchResult
Parameters:
gssb - session bean, not available from session in new thread.

getOrderingAttributes

public 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.

Specified by:
getOrderingAttributes in interface SearchResult
Returns:
List of attributes.

setOrderingAsc

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

Specified by:
setOrderingAsc in interface SearchResult
Parameters:
orderingAsc - true for ascending, false for descending.

isOrderingAsc

public boolean isOrderingAsc()
Is the order ascending?

Specified by:
isOrderingAsc in interface SearchResult
Returns:
true if ascending, false if descending.

setOrderingAttribute

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

Specified by:
setOrderingAttribute in interface SearchResult
Parameters:
attr - name of attribute.

getOrderingAttribute

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

Specified by:
getOrderingAttribute in interface SearchResult
Returns:
attr name of attribute.

reOrder

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

Specified by:
reOrder in interface SearchResult

getCommonTreeModel

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

Specified by:
getCommonTreeModel in interface SearchResult
Returns:
common Tree Model.

getCommonTreeDisclosedRowKeys

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

Specified by:
getCommonTreeDisclosedRowKeys in interface SearchResult
Returns:
disclosed row key set.

onBackgroundSearchPoll

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

Specified by:
onBackgroundSearchPoll in interface SearchResult

isBackgroundSearchPollCountExceeded

public 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.

Specified by:
isBackgroundSearchPollCountExceeded in interface SearchResult
Returns:
true if time to stop polling.

generatePersistentFilters

public void generatePersistentFilters(java.util.List<PersistentSearchFilter> searchFilters,
                                      java.util.List<SearchCategory> allCats)
Add persistent filters into the searchFilters arguement from the current search result. This method is the basic translation mechanism of SearchFilterItems (the search tiles, which are in effect the PK of the search) to Persistent filters, which are Global Search's addition to ecsf QueryMetaData, and act as a simple, ordered, fast way of showing search filters to the user. They also add metadata missing from qmd.

Parameters:
searchFilters - filters list to fill.
allCats - all possible categories.

Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 1 (11.1.1.6)

E22562-05

Copyright © 2012 Oracle. All Rights Reserved.