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

E22562-07

oracle.apps.fnd.applcore.globalSearch.ui.managed
Class GlobalSearchSessionBean

java.lang.Object
  extended by oracle.apps.fnd.applcore.globalSearch.ui.managed.GlobalSearchSessionBean
All Implemented Interfaces:
java.io.Serializable

public class GlobalSearchSessionBean
extends java.lang.Object
implements java.io.Serializable

Session related bean for global search. This bean caches Categories and Saved Searches based on a callerContext. This caller context is user defined, however the GLOBAL context GlobalSearchBean.GLOBAL_SEARCH_CALLER_CONTEXT is defined for the global Search fields in the UIShell header.

See Also:
Serialized Form

Field Summary
static java.lang.String GLOBAL_SEARCH_CALLER_CONTEXT
          Default Global Search Context.
static java.lang.String ZERO_COUNT_FACET_ITEMS_SYSPROP
          Do we add facet items with zero count.
 
Constructor Summary
GlobalSearchSessionBean()
          Construct the bean.
 
Method Summary
 void addSavedSearch(java.lang.String callerContext, java.lang.String searchName)
          Add the current search to the saved searches under the given name .
 boolean containsSavedSearch(java.lang.String callerContext, java.lang.String searchName)
          Does the named saved search exist?
 void defineCallerContext(java.lang.String callerContext, java.util.List<SearchCategory> allSearchableCategories, java.awt.Dimension d, boolean isTaskFlow)
          Define the caller Context, telling our store of categories what are the full list of available categories, and potentially how big to open the results window, if it will be opened as a popup.
 void deleteSavedSearch(BaseSavedSearch searchToDelete)
          Delete the named saved search.
 void ensureConfigurationAndLoadCategories()
          Worker method that will test the search setup to determine if it will work, and if so load the list of categories.
 java.util.List<SearchCategory> getAllCategories()
          Get all the categories, regardless of the caller context.
 java.util.List<SearchCategory> getAllCategories(java.lang.String callerContext)
          Get all the categories the user is allowed to see in the current caller context.
 java.util.List<SearchCategory> getAllGlobalCategories()
          Get all the Global categories the user is allowed to see.
 java.lang.String getCallerContext()
          Get the current Caller Context for the "current search".
 SearchError getCurrentError()
          Get the current error.
 SplitSearchResult getCurrentSearchResult()
          Get the current search result.
 WindowSize getCustomWindowSize()
          Get the window size for the current context.
 SearchError getKeywordError()
          Get the "no keywords entered" error.
 int getLastSelectedSearchTabIndex()
          Get the last selected search tab index.
 int getMaxRecentSearches()
          Get the maximum number of recent searches allowed.
 BaseRecentSearch getRecentSearch(int index)
          Get the recent search for the given index.
 java.util.List<BaseRecentSearch> getRecentSearches()
          Retrieves the list of recent searches.
 BaseSavedSearch getSavedSearch(java.lang.String callerContext, int index)
          Get the saved search for the given index.
 BaseSavedSearch getSavedSearchById(java.lang.String callerContext, java.lang.String searchId)
          Get the saved search under the given id.
 BaseSavedSearch getSavedSearchByName(java.lang.String callerContext, java.lang.String searchName)
          Get the saved search under the given name.
 java.util.List<BaseSavedSearch> getSavedSearches(java.lang.String callerContext)
          Get the list of saved searches for the given caller context.
static AbstractSearchableFactory getSearchableFactory()
          Get the searchable factory that allows us to create search results.
 java.lang.String getSearchResultTabDC0()
          Get the DC name for results tab 0.
 java.lang.String getSearchResultTabDC1()
          Get the DC name for results tab 1.
 java.lang.String getSearchResultTabDC2()
          Get the DC name for results tab 2.
 java.lang.String getSearchResultTabDC3()
          Get the DC name for results tab 3.
 java.lang.String getSearchResultTabDC4()
          Get the DC name for results tab 4.
 java.lang.String getSearchResultTabDC5()
          Get the DC name for results tab 5.
 java.lang.String getSearchResultTabDC6()
          Get the DC name for results tab 6.
 java.lang.String getSearchResultTabDC7()
          Get the DC name for results tab 7.
 java.lang.String getSearchResultTabDC8()
          Get the DC name for results tab 8.
 java.lang.String getSearchResultTabDC9()
          Get the DC name for results tab 9.
 java.lang.Object getSearchSession()
          Get the SearchSession.
 java.lang.String getSearchString()
          Binding for the Search String from the UIShell page.
 int getSearchTabCount()
          Get the number of search tabs.
 java.util.List<SearchCategory> getSelectedGlobalCategories()
          Get the selected global categories.
 BaseSavedSearch getTmpPersonalizeSavedSearch()
          Getter for a temporary value to store which save search the user selected in the personalize popup.
 java.lang.String getTmpPersonalizeSavedSearchRenameValue()
          Getter for a temporary value to store what the user entered into the personalize popup when renaming a saved search.
 boolean isIncompleteCategories()
          Are the categories we have loaded incomplete?
 boolean isInTaskflow(java.lang.String callerContext)
          Is the current callerContext for the global search task flow?
 boolean isRecentSearchesEnabled()
          Is the recent search feature enabled? This is determined by whether the user is authenticated (no recent searches for non-authenticated users), and whether the search provider has recent search enabled, or indeed supports recent search at all.
 boolean isSearchConfigurationTested()
          Have we even tested that search is setup and enabled.
 boolean isSearchConfigured()
          Is ecsf setup and enabled.
 boolean isSearchEnabled()
          Is search present, and setup so the user can see the search fields?
 boolean isShowZeroCountFacetItems()
          Do we add facet items with zero item count.
 void renameSavedSearch(java.lang.String callerContext, java.lang.String searchId, java.lang.String searchName)
          Rename old search given by oldSearchId to new name searchName in the given callerContext.
 void setCurrentError(SearchError currentError)
          Set the curent error to show the user.
 void setGlobalWindowSize(WindowSize w)
          Sets the window Size for the Global caller context.
 void setKeywordError(SearchError keywordError)
          Set the keyword error.
 void setLastSelectedSearchTabIndex(int lastSelectedSearchTabIndex)
          Set the last selected search tab index, as determined by the user disclosing tabs.
static void setSearchableFactory(AbstractSearchableFactory searchableFactory)
          The SearchableFactory to be used, if null defaults to ECSF.
 void setSearchSession(java.lang.Object searchSession)
          Get the SearchSession.
 void setSearchString(java.lang.String newSearchString)
          Binding for the Search String from the UIShell page.
 void setSelectedGlobalCategories(java.util.List<SearchCategory> selectedGlobalCategories)
          set the selected global categories.
 void setShowZeroCountFacetItems(boolean val)
          Set the status of the zero count fact item status.
 void setTmpPersonalizeSavedSearch(BaseSavedSearch tmpPersonalizeSavedSearch)
          Setter for a temporary value to store which save search the user selected in the personalize popup.
 void setTmpPersonalizeSavedSearchRenameValue(java.lang.String tmpPersonalizeSavedSearchRenameValue)
          Setter for a temporary value to store what the user entered into the personalize popup when renaming a saved search.
 void storeRecentSearch(SplitSearchResult ssr)
          Either adds or updates a recent search for the search performed that produced the provided search result.
 java.lang.String taskFlowSearch()
          Backing bean method for search called in our taskflow.
 void updateSavedSearch(BaseSavedSearch searchToUpdate)
          Deletes the previous search passed in and replaces it with the current search using the same search name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GLOBAL_SEARCH_CALLER_CONTEXT

public static final java.lang.String GLOBAL_SEARCH_CALLER_CONTEXT
Default Global Search Context. All searches done in UIShell global area will use this context.

See Also:
Constant Field Values

ZERO_COUNT_FACET_ITEMS_SYSPROP

public static final java.lang.String ZERO_COUNT_FACET_ITEMS_SYSPROP
Do we add facet items with zero count.

See Also:
Constant Field Values
Constructor Detail

GlobalSearchSessionBean

public GlobalSearchSessionBean()
Construct the bean. Categories and saved searches will be loaded and the default caller context set.

Method Detail

ensureConfigurationAndLoadCategories

public void ensureConfigurationAndLoadCategories()
Worker method that will test the search setup to determine if it will work, and if so load the list of categories.

This logic is deliberately separate to avoid inline loading of ECSF code which cannot be relied upon (may throw unchecked exceptions or stall for interterminate amounts of time).


getSearchableFactory

public static AbstractSearchableFactory getSearchableFactory()
Get the searchable factory that allows us to create search results.

Returns:
specific AbstractSearchableFactory.

setSearchableFactory

public static void setSearchableFactory(AbstractSearchableFactory searchableFactory)
The SearchableFactory to be used, if null defaults to ECSF. Used extensively by the unit testing framework to plug in mock factories for testing.

Parameters:
searchableFactory - factory to use. Use null to reset to the default.

getAllCategories

public java.util.List<SearchCategory> getAllCategories()
Get all the categories, regardless of the caller context.

Returns:
all categories.

getAllGlobalCategories

public java.util.List<SearchCategory> getAllGlobalCategories()
Get all the Global categories the user is allowed to see.

Returns:
all categories.

getAllCategories

public java.util.List<SearchCategory> getAllCategories(java.lang.String callerContext)
Get all the categories the user is allowed to see in the current caller context.

Parameters:
callerContext - context of caller.
Returns:
all categories for the current caller context.

getSavedSearches

public java.util.List<BaseSavedSearch> getSavedSearches(java.lang.String callerContext)
Get the list of saved searches for the given caller context. If this has not been asked before, a List will be created and added to our Map of saves searches by caller context.

Parameters:
callerContext - The context/stripting the user is running in.
Returns:
Possible empty, but never null list of saved searches for the current caller context.

deleteSavedSearch

public void deleteSavedSearch(BaseSavedSearch searchToDelete)
Delete the named saved search.

Parameters:
searchToDelete - search to delete.

containsSavedSearch

public boolean containsSavedSearch(java.lang.String callerContext,
                                   java.lang.String searchName)
Does the named saved search exist?

Parameters:
callerContext - The context/stripting the user is running in.
searchName - name of search.
Returns:
true iff exists, false otherwise.

getSavedSearchById

public BaseSavedSearch getSavedSearchById(java.lang.String callerContext,
                                          java.lang.String searchId)
Get the saved search under the given id.

Parameters:
callerContext - The context/stripting the user is running in.
searchId - id of search.
Returns:
saved search of this name, null if not found.

getSavedSearch

public BaseSavedSearch getSavedSearch(java.lang.String callerContext,
                                      int index)
Get the saved search for the given index.

Parameters:
callerContext - context.
index - of search.
Returns:
saved search for this index.

getSavedSearchByName

public BaseSavedSearch getSavedSearchByName(java.lang.String callerContext,
                                            java.lang.String searchName)
Get the saved search under the given name.

Parameters:
callerContext - The context/stripting the user is running in.
searchName - name of search.
Returns:
saved search of this name, null if not found.

addSavedSearch

public void addSavedSearch(java.lang.String callerContext,
                           java.lang.String searchName)
Add the current search to the saved searches under the given name .

Parameters:
callerContext - The context/stripting the user is running in.
searchName - name to use.

renameSavedSearch

public void renameSavedSearch(java.lang.String callerContext,
                              java.lang.String searchId,
                              java.lang.String searchName)
Rename old search given by oldSearchId to new name searchName in the given callerContext.

Parameters:
callerContext - The context/stripting the user is running in.
searchId - id of existing search.
searchName - new name.

updateSavedSearch

public void updateSavedSearch(BaseSavedSearch searchToUpdate)
Deletes the previous search passed in and replaces it with the current search using the same search name.

Parameters:
searchToUpdate - search to update.

isSearchConfigured

public boolean isSearchConfigured()
Is ecsf setup and enabled.

Returns:
true if search is setup and enabled, false otherwise.

isSearchConfigurationTested

public boolean isSearchConfigurationTested()
Have we even tested that search is setup and enabled. Use this method to test whether search is setup, without triggering search code.

Returns:
true if search config has been tested, false otherwise.

defineCallerContext

public void defineCallerContext(java.lang.String callerContext,
                                java.util.List<SearchCategory> allSearchableCategories,
                                java.awt.Dimension d,
                                boolean isTaskFlow)
Define the caller Context, telling our store of categories what are the full list of available categories, and potentially how big to open the results window, if it will be opened as a popup.

Parameters:
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.
allSearchableCategories - all the categories that are relevant for this callerContext.
d - windowSize to use, potentially null.
isTaskFlow - true if defining from a taskflow, false otherwise. This enables us to know whether to save the result to pageflow or session scope.

setGlobalWindowSize

public void setGlobalWindowSize(WindowSize w)
Sets the window Size for the Global caller context.

Parameters:
w - window size.

getCustomWindowSize

public WindowSize getCustomWindowSize()
Get the window size for the current context. Will default if otherwise unset.

Returns:
context window size.

getCallerContext

public java.lang.String getCallerContext()
Get the current Caller Context for the "current search".

Returns:
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.

setSelectedGlobalCategories

public void setSelectedGlobalCategories(java.util.List<SearchCategory> selectedGlobalCategories)
set the selected global categories. These are the values from the top of the UIShell page and are implicitly for callerContext of global.

Parameters:
selectedGlobalCategories - selected global caller scope categories.

getSelectedGlobalCategories

public java.util.List<SearchCategory> getSelectedGlobalCategories()
Get the selected global categories. These are the values from the top of the UIShell page and are implicitly for callerContext of global.

Returns:
selected global caller scope categories.

setSearchString

public void setSearchString(java.lang.String newSearchString)
Binding for the Search String from the UIShell page.

Parameters:
newSearchString - Binding for the Search String.

getSearchString

public java.lang.String getSearchString()
Binding for the Search String from the UIShell page.

Returns:
Binding for the Search String.

setLastSelectedSearchTabIndex

public void setLastSelectedSearchTabIndex(int lastSelectedSearchTabIndex)
Set the last selected search tab index, as determined by the user disclosing tabs.

Parameters:
lastSelectedSearchTabIndex - last selected search tab index.

getLastSelectedSearchTabIndex

public int getLastSelectedSearchTabIndex()
Get the last selected search tab index. This is the best information on which tab to show by default, however as the number of tabs shown will change based on the categories selected, this raw value should be used with caution.

Returns:
last selected search tab index.

setTmpPersonalizeSavedSearchRenameValue

public void setTmpPersonalizeSavedSearchRenameValue(java.lang.String tmpPersonalizeSavedSearchRenameValue)
Setter for a temporary value to store what the user entered into the personalize popup when renaming a saved search. This property exists to stop the entered value from being lost between page navigations. This value should not be used in any other place besides the personalization bean.

Parameters:
tmpPersonalizeSavedSearchRenameValue - the name the user wants to rename a saved search to

getTmpPersonalizeSavedSearchRenameValue

public java.lang.String getTmpPersonalizeSavedSearchRenameValue()
Getter for a temporary value to store what the user entered into the personalize popup when renaming a saved search. This property exists to stop the entered value from being lost between page navigations. This value should not be used in any other place besides the personalization bean.

Returns:
the name the user wants to rename a saved search to

setTmpPersonalizeSavedSearch

public void setTmpPersonalizeSavedSearch(BaseSavedSearch tmpPersonalizeSavedSearch)
Setter for a temporary value to store which save search the user selected in the personalize popup. This property exists to stop the selected search from being lost between page navigations. This value should not be used in any other place besides the personalization bean.

Parameters:
tmpPersonalizeSavedSearch - the selected search on the personalize dialog

getTmpPersonalizeSavedSearch

public BaseSavedSearch getTmpPersonalizeSavedSearch()
Getter for a temporary value to store which save search the user selected in the personalize popup. This property exists to stop the selected search from being lost between page navigations. This value should not be used in any other place besides the personalization bean.

Returns:
the selected search on the personalize dialog

getSearchTabCount

public int getSearchTabCount()
Get the number of search tabs.

Returns:
search tab count

getSearchResultTabDC0

public java.lang.String getSearchResultTabDC0()
Get the DC name for results tab 0. If there is no current search result, return the empty DC.

Returns:
DC name.

getSearchResultTabDC1

public java.lang.String getSearchResultTabDC1()
Get the DC name for results tab 1. If there is no current search result, return the empty DC.

Returns:
DC name.

getSearchResultTabDC2

public java.lang.String getSearchResultTabDC2()
Get the DC name for results tab 2. If there is no current search result, return the empty DC.

Returns:
DC name.

getSearchResultTabDC3

public java.lang.String getSearchResultTabDC3()
Get the DC name for results tab 3. If there is no current search result, return the empty DC.

Returns:
DC name.

getSearchResultTabDC4

public java.lang.String getSearchResultTabDC4()
Get the DC name for results tab 4. If there is no current search result, return the empty DC.

Returns:
DC name.

getSearchResultTabDC5

public java.lang.String getSearchResultTabDC5()
Get the DC name for results tab 5. If there is no current search result, return the empty DC.

Returns:
DC name.

getSearchResultTabDC6

public java.lang.String getSearchResultTabDC6()
Get the DC name for results tab 6. If there is no current search result, return the empty DC.

Returns:
DC name.

getSearchResultTabDC7

public java.lang.String getSearchResultTabDC7()
Get the DC name for results tab 7. If there is no current search result, return the empty DC.

Returns:
DC name.

getSearchResultTabDC8

public java.lang.String getSearchResultTabDC8()
Get the DC name for results tab 8. If there is no current search result, return the empty DC.

Returns:
DC name.

getSearchResultTabDC9

public java.lang.String getSearchResultTabDC9()
Get the DC name for results tab 9. If there is no current search result, return the empty DC.

Returns:
DC name.

setSearchSession

public void setSearchSession(java.lang.Object searchSession)
Get the SearchSession.

Parameters:
searchSession - SearchSession.

getSearchSession

public java.lang.Object getSearchSession()
Get the SearchSession.

Returns:
SearchSession.

isSearchEnabled

public boolean isSearchEnabled()
Is search present, and setup so the user can see the search fields?

Returns:
true if search fields should be shown, false otherwise.

setCurrentError

public void setCurrentError(SearchError currentError)
Set the curent error to show the user.

Parameters:
currentError - the current error.

getCurrentError

public SearchError getCurrentError()
Get the current error.

Returns:
current error.

getKeywordError

public SearchError getKeywordError()
Get the "no keywords entered" error.

Returns:
error.

setKeywordError

public void setKeywordError(SearchError keywordError)
Set the keyword error. This method exists only for compatibility with EL javabeans API.

Parameters:
keywordError - keyword error.

isIncompleteCategories

public boolean isIncompleteCategories()
Are the categories we have loaded incomplete?

Returns:
true if problems loading, false otherwise.

isRecentSearchesEnabled

public boolean isRecentSearchesEnabled()
Is the recent search feature enabled? This is determined by whether the user is authenticated (no recent searches for non-authenticated users), and whether the search provider has recent search enabled, or indeed supports recent search at all.

Returns:
true if enabled, false otherwise.

getMaxRecentSearches

public int getMaxRecentSearches()
Get the maximum number of recent searches allowed. It is assumed isRecentSearchesEnabled() returns true.

Returns:
maximum number of recent searches allowed, by default 10;
See Also:
isRecentSearchesEnabled()

getRecentSearches

public java.util.List<BaseRecentSearch> getRecentSearches()
Retrieves the list of recent searches.

Returns:
the list of recent searches.

storeRecentSearch

public void storeRecentSearch(SplitSearchResult ssr)
Either adds or updates a recent search for the search performed that produced the provided search result.

Parameters:
ssr - search result for the recent search.

getRecentSearch

public BaseRecentSearch getRecentSearch(int index)
Get the recent search for the given index.

Parameters:
index - of search.
Returns:
recent search for this index.

isShowZeroCountFacetItems

public boolean isShowZeroCountFacetItems()
Do we add facet items with zero item count. Defined by system property applcore.globalsearch.addzerocountfacetitems. If unset, defaults to false.

Returns:
true if add items with zero count.

setShowZeroCountFacetItems

public void setShowZeroCountFacetItems(boolean val)
Set the status of the zero count fact item status.

Parameters:
val - true if to show zare count items, false otherwise.

getCurrentSearchResult

public SplitSearchResult getCurrentSearchResult()
Get the current search result.

Returns:
current search result, null if no search performed.

isInTaskflow

public boolean isInTaskflow(java.lang.String callerContext)
Is the current callerContext for the global search task flow?

Parameters:
callerContext - caller context.
Returns:
true if for task flow, false otherwise.

taskFlowSearch

public java.lang.String taskFlowSearch()
Backing bean method for search called in our taskflow.

Search parameters are passed as pageflowScope variables:

  1. SearchCallerContext
  2. SearchString
  3. SearchCategories
  4. SearchAllCategories
The first two are required, while the categories may be left null, but if so will default to all categories. SearchCategories must be a subset of SearchAllCategories, otherwise categories will be discarded to make it so. If there are no possible categories to search on (SearchCategories and SearchAllCategories are distinct), an exception will be thrown.

Returns:
outcome for navigation, "ok" or "error".

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

E22562-07

Copyright © 2013 Oracle. All Rights Reserved.