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

E22562-01

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 Searchs 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. To set a new caller context, use the setCallerContext() or setGlobalCallerContext() methods. At construction the caller context is set to default.

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

Field Summary
static java.lang.String _RESULT_TAB_DC
          Default DC to use for showing results.
static java.lang.String GLOBAL_SEARCH_CALLER_CONTEXT
          Default Global Search Context.
static java.lang.String GS_EMPTY_DC
          Empty DC id for popups, used to conserve memory before popups are shown.
 
Constructor Summary
GlobalSearchSessionBean()
          Construct the bean.
 
Method Summary
 void addSavedSearch(java.lang.String searchName)
          Add the current search to the saved searches under the given name within the current callerContext.
 boolean containsSavedSearch(java.lang.String searchName)
          Does the named saved search exist?
 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> getAllCallerContextCategories()
          Get all the categories the user is allowed to see in the current caller context.
 java.util.List<SearchCategory> getAllCategories()
          Get all the categories, regardless of the 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.
 SearchError getCurrentError()
          Get the current error.
 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.
 BaseSavedSearch getSavedSearchById(java.lang.String searchId)
          Get the saved search under the given id.
 BaseSavedSearch getSavedSearchByName(java.lang.String searchName)
          Get the saved search under the given name.
 java.util.List<BaseSavedSearch> getSavedSearches()
          Get a list of all saved searches.
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.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 isAllCategoriesSelected()
          Whether all of the categories that have been loaded are selected or when there are no categories loaded (i.e.
 boolean isIncompleteCategories()
          Are the categories we have loaded incomplete?
 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?
 void renameSavedSearch(java.lang.String searchId, java.lang.String searchName)
          Rename old search given by oldSearchId to new name searchName in the current callerContext.
 void setCallerContext(java.lang.String callerContext, java.util.List<SearchCategory> allSearchableCategories)
          Set the current caller Context.
 void setCallerContext(java.lang.String callerContext, java.util.List<SearchCategory> allSearchableCategories, java.awt.Dimension d)
          Set the current caller Context.
 void setCurrentError(SearchError currentError)
          Set the curent error to show the user.
 void setGlobalCallerContext()
          Set the current caller Context to that of global.
 void setKeywordError(SearchError keywordError)
           
 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 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 setWindowSize(WindowSize w)
          Sets the window Size for the caller Global context.
 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.

See Also:
Constant Field Values

GS_EMPTY_DC

public static final java.lang.String GS_EMPTY_DC
Empty DC id for popups, used to conserve memory before popups are shown.

See Also:
Constant Field Values

_RESULT_TAB_DC

public static final java.lang.String _RESULT_TAB_DC
Default DC to use for showing results.

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.

getAllCallerContextCategories

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

Returns:
all categories for the current caller context.

getSavedSearches

public java.util.List<BaseSavedSearch> getSavedSearches()
Get a list of all saved searches.

Returns:
list of saves searches.

deleteSavedSearch

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

Parameters:
searchToDelete - search to delete.

containsSavedSearch

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

Parameters:
searchName - name of search.
Returns:
true iff exists, false otherwise.

getSavedSearchById

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

Parameters:
searchId - id of search.
Returns:
saved search of this name, null if not found.

getSavedSearchByName

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

Parameters:
searchName - name of search.
Returns:
saved search of this name, null if not found.

addSavedSearch

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

Parameters:
searchName - name to use.

renameSavedSearch

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

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

setCallerContext

public void setCallerContext(java.lang.String callerContext,
                             java.util.List<SearchCategory> allSearchableCategories)
Set the current caller Context.

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.

setCallerContext

public void setCallerContext(java.lang.String callerContext,
                             java.util.List<SearchCategory> allSearchableCategories,
                             java.awt.Dimension d)
Set the current caller Context.

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.

setWindowSize

public void setWindowSize(WindowSize w)
Sets the window Size for the caller Global 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.

setGlobalCallerContext

public void setGlobalCallerContext()
Set the current caller Context to that of global.


getCallerContext

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

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.

isAllCategoriesSelected

public boolean isAllCategoriesSelected()
Whether all of the categories that have been loaded are selected or when there are no categories loaded (i.e. lazy load of categories using ensureConfigurationAndLoadCategories has not been occured)

Returns:
true if all categories are selected

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.

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)

isIncompleteCategories

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

Returns:
true if problems loading, false otherwise.

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

E22562-01

Copyright © 2011 Oracle. All Rights Reserved.