Class SearchBarControlBean

All Implemented Interfaces:
IPageFlowScopeAdapter, ICompositeViewControlPageBean, Serializable, EventListener, PhaseListener, HttpSessionBindingListener
Direct Known Subclasses:
PeopleSearchBarBean

public class SearchBarControlBean extends BaseCompositeViewControlPageBean
JSF Managed Bean that backs a SearchBar control
Since:
7.0
See Also:
  • Field Details

    • TAB_VALUE_SAVED_SEARCHES

      public static final String TAB_VALUE_SAVED_SEARCHES
      Value for the saved search tab
      See Also:
    • TAB_VALUE_SEARCH_OPTIONS

      public static final String TAB_VALUE_SEARCH_OPTIONS
      Value for the search options tab
      See Also:
    • CONTROL_ID_KEYWORDS_TEXT_INPUT

      protected static final String CONTROL_ID_KEYWORDS_TEXT_INPUT
      See Also:
    • CONTROL_ID_SIMPLE_SEARCH_ASYNC_GO_BUTTON

      protected static final String CONTROL_ID_SIMPLE_SEARCH_ASYNC_GO_BUTTON
      See Also:
    • CONTROL_ID_SIMPLE_SEARCH_GO_BUTTON

      protected static final String CONTROL_ID_SIMPLE_SEARCH_GO_BUTTON
      See Also:
    • CONTROL_ID_REFINED_SEARCH_GO_BUTTON

      protected static final String CONTROL_ID_REFINED_SEARCH_GO_BUTTON
      See Also:
    • CONTROL_ID_REFINED_SEARCH_ASYNC_GO_BUTTON

      protected static final String CONTROL_ID_REFINED_SEARCH_ASYNC_GO_BUTTON
      See Also:
    • CONTROL_ID_SAVE_SEARCH_ASYNC_GO_BUTTON

      protected static final String CONTROL_ID_SAVE_SEARCH_ASYNC_GO_BUTTON
      See Also:
    • CONTROL_ID_SAVE_SEARCH_GO_BUTTON

      protected static final String CONTROL_ID_SAVE_SEARCH_GO_BUTTON
      See Also:
    • CONTROL_ID_SAVE_SEARCH_OPTIONS_BUTTON

      protected static final String CONTROL_ID_SAVE_SEARCH_OPTIONS_BUTTON
      See Also:
    • CONTROL_ID_SAVED_SEARCHES_DROPDOWN

      protected static final String CONTROL_ID_SAVED_SEARCHES_DROPDOWN
      See Also:
    • CONTROL_ID_INITIAL_SEARCHTAB_DROPDOWN

      protected static final String CONTROL_ID_INITIAL_SEARCHTAB_DROPDOWN
      See Also:
    • CONTROL_ID_MAX_RESULTS

      protected static final String CONTROL_ID_MAX_RESULTS
      See Also:
    • CONTROL_ID_SIMPLE_SUBMIT_BUTTONS_PANEL

      protected static final String CONTROL_ID_SIMPLE_SUBMIT_BUTTONS_PANEL
      See Also:
    • fActiveTabValue

      protected String fActiveTabValue
    • fPreviousTabValue

      protected String fPreviousTabValue
    • fSearchQueryFactory

      protected ISearchQueryFactory fSearchQueryFactory
    • fActiveSearchQuery

      protected ISearchQuery fActiveSearchQuery
    • fResultSearchQuery

      protected ISearchQuery fResultSearchQuery
    • fActiveSavedSearch

      protected ISavedSearch fActiveSavedSearch
    • fSavedSearchProvider

      protected ISavedSearchProvider fSavedSearchProvider
    • fSearchOptionsManager

      protected ISearchOptionsManager fSearchOptionsManager
    • fCurrentSearchOptions

      protected Map<String,Object> fCurrentSearchOptions
    • fNeedsUserOptionsApplied

      protected boolean fNeedsUserOptionsApplied
    • fRandomNumberGenerator

      protected SecureRandom fRandomNumberGenerator
    • fUseAsyncGoButton

      protected Boolean fUseAsyncGoButton
    • fAsyncGoRefresh

      protected String fAsyncGoRefresh
    • fSimpleSearchAvailable

      protected Boolean fSimpleSearchAvailable
    • fRefineSearchButtonAvailable

      protected Boolean fRefineSearchButtonAvailable
    • fAdvancedSearchAvailable

      protected Boolean fAdvancedSearchAvailable
    • fSaveSearchAvailable

      protected Boolean fSaveSearchAvailable
    • fUserSearchOptionsAvailable

      protected Boolean fUserSearchOptionsAvailable
    • fMaxResultsFieldAvailable

      protected Boolean fMaxResultsFieldAvailable
    • fMaxResultsMaxValue

      protected Long fMaxResultsMaxValue
    • fKeywordsFieldAvailable

      protected Boolean fKeywordsFieldAvailable
    • fClearFormButtonAvailable

      protected Boolean fClearFormButtonAvailable
    • fUseOrConditionAvailable

      protected Boolean fUseOrConditionAvailable
    • fEncodersBean

      protected transient EncodersBean fEncodersBean
    • fSaveSearchCompleted

      protected transient Boolean fSaveSearchCompleted
  • Constructor Details

    • SearchBarControlBean

      public SearchBarControlBean()
  • Method Details

    • getResultSearchQuery

      public ISearchQuery getResultSearchQuery()
    • getSaveSearchCompleted

      public Boolean getSaveSearchCompleted()
      Returns:
      the saveSearchCompleted
    • setSaveSearchCompleted

      public void setSaveSearchCompleted(Boolean saveSearchCompleted)
      Parameters:
      saveSearchCompleted - the saveSearchCompleted to set
    • afterRenderResponse

      protected void afterRenderResponse()
      Description copied from class: BaseViewBean
      Clients should overwrite this method to perform custom actions after the view got rendered.
      Overrides:
      afterRenderResponse in class BaseViewBean
    • getEncodersBean

      public EncodersBean getEncodersBean()
      Returns:
      the encodersBean
    • setEncodersBean

      public void setEncodersBean(EncodersBean encodersBean)
      Parameters:
      encodersBean - the encodersBean to set
    • getDefaultCommandId

      public String getDefaultCommandId()
      Return the ID for the default searchbar command
      Returns:
      the ID for the default searchbar command
    • getDefaultFocusId

      public String getDefaultFocusId()
      Return the ID for the searchbar control that should have the initial focus
      Returns:
      the ID for the searchbar control that should have the initial focus
    • reset

      public String reset()
      Helper method mostly for debugging that will reset the state of the page bean to the default values
      Returns:
      "ok"
    • setSearchQueryFactory

      public void setSearchQueryFactory(ISearchQueryFactory searchQueryFactory)
      Parameters:
      searchQueryFactory - the searchQueryFactory to set
    • getSearchQueryFactory

      public ISearchQueryFactory getSearchQueryFactory()
    • getActiveSearchQuery

      public ISearchQuery getActiveSearchQuery()
      Gets the active search query object for the SearchBar control.
      Returns:
      Returns the activeSearchQuery.
    • setActiveSearchQuery

      public void setActiveSearchQuery(ISearchQuery activeSearchQuery)
      Sets the active search query object for the SearchBar control.
      Parameters:
      activeSearchQuery - The activeSearchQuery to set.
    • getActiveSavedSearch

      public ISavedSearch getActiveSavedSearch()
      Gets the active saved search object for the SearchBar control.
      Returns:
      Returns the activeSavedSearch.
    • setActiveSavedSearch

      public void setActiveSavedSearch(ISavedSearch activeSavedSearch)
      Sets the active saved search object for the SearchBar control.
      Parameters:
      activeSavedSearch - The activeSavedSearch to set.
    • setSavedSearchProvider

      public void setSavedSearchProvider(ISavedSearchProvider savedSearchProvider)
      Parameters:
      savedSearchProvider - The savedSearchProvider to set.
    • getSavedSearchProvider

      public ISavedSearchProvider getSavedSearchProvider()
    • getSearchOptionsManager

      public ISearchOptionsManager getSearchOptionsManager()
      Returns:
      the searchOptionsManager
    • setSearchOptionsManager

      public void setSearchOptionsManager(ISearchOptionsManager searchOptionsManager)
      Parameters:
      searchOptionsManager - the searchOptionsManager to set
    • getActiveTabValue

      public String getActiveTabValue()
    • setActiveTabValue

      public void setActiveTabValue(String activeTabValue)
      Parameters:
      activeTabValue - the activeTabValue to set
    • getCurrentSearchOptions

      public Map<String,Object> getCurrentSearchOptions()
      Returns:
      the currentSearchOptions
    • isSearchBarOnSimpleTab

      public boolean isSearchBarOnSimpleTab()
      Returns true if the active searchbar tab is the the 'Search' tab
      Returns:
      true if the active searchbar tab is the 'Search' tab
    • isSearchBarOnAdvancedTab

      public boolean isSearchBarOnAdvancedTab()
      Returns true if the active searchbar tab is the the 'Advanced' tab
      Returns:
      true if the active searchbar tab is the 'Advanced' tab
    • isSearchBarOnOptionsTab

      public boolean isSearchBarOnOptionsTab()
      Returns true if the active searchbar tab is the the 'Options' tab
      Returns:
      true if the active searchbar tab is the 'Options' tab
    • isSearchBarOnSavedTab

      public boolean isSearchBarOnSavedTab()
      Returns true if the active searchbar tab is the the 'Saved' tab
      Returns:
      true if the active searchbar tab is the 'Saved' tab
    • isKeywordsBlockVisible

      public boolean isKeywordsBlockVisible()
      Returns true if the keywords block should be rendered
    • isRefinePanelVisible

      public boolean isRefinePanelVisible()
    • setRefinePanelVisible

      public void setRefinePanelVisible(boolean isVisible)
    • isSavedSearchesEmpty

      public boolean isSavedSearchesEmpty()
    • setupVisibleControls

      protected void setupVisibleControls()
    • beforeInvokeApplication

      protected void beforeInvokeApplication()
      Description copied from class: BaseViewBean
      Clients should overwrite this method to perform custom actions before an action method is invoked.
      Overrides:
      beforeInvokeApplication in class BaseViewBean
    • beforeRenderResponse

      protected void beforeRenderResponse()
      Description copied from class: BaseViewBean
      Clients should overwrite this method to perform custom actions before the view gets rendered.
      Overrides:
      beforeRenderResponse in class BaseViewBean
    • getInitialSearchTab

      protected String getInitialSearchTab()
      Return the initial search tab value for the current user
      Returns:
      initial search tab value,
    • getInitialSelectedSavedSearch

      protected String getInitialSelectedSavedSearch()
      Return the initial selected saved search value for the current user
      Returns:
      initial selected saved search value
    • getRunSearchOnDisplay

      protected Boolean getRunSearchOnDisplay()
      Return the runSearchOnDisplay value for the current user
      Returns:
      runSearchOnDisplay value for the current user
    • applySearchOptionPreferences

      protected void applySearchOptionPreferences()
      Apply the search option preferences for the current user
    • persistSearchOptions

      public String persistSearchOptions()
      Action Handler for the 'Save' button on the 'Options' tab of the SearchBar control
      Returns:
      outcome of the action handler
    • cancelSearchOptions

      public String cancelSearchOptions()
      Action Handler for the 'Cancel' button on the 'Options' tab of the SearchBar control
      Returns:
      outcome of the action handler
    • saveSearchQuery

      public String saveSearchQuery()
      Action Handler for the 'Save' icon on the 'Search' and 'Advanced' tab of the SearchBar control
      Returns:
      outcome of the action handler
    • updateSavedSearchQuery

      public String updateSavedSearchQuery()
      Action Handler for the 'Save' icon on the 'Saved' tab of the SearchBar control
      Returns:
      outcome of the action handler
    • changeActiveSavedSearch

      public String changeActiveSavedSearch()
      Action Handler for the 'onchange' hidden command associated with the saved searches dropdown on the 'Saved' tab
    • constructSearchQueryString

      public String constructSearchQueryString()
      Action Handler for the 'Go' button on all tabs of the SearchBar control
      Returns:
      outcome of the action handler
    • deleteSavedSearch

      public String deleteSavedSearch()
      Action Handler for the 'Delete' button on the 'Saved' tab of the SearchBar control
      Returns:
      outcome of the action handler
    • clearSearchForm

      public String clearSearchForm()
      Action Handler for the 'Clear' button on all tabs of the SearchBar control
      Returns:
      outcome of the action handler
    • getActiveQueryStateString

      protected String getActiveQueryStateString()
    • getActiveQueryStateString

      protected String getActiveQueryStateString(ISearchStateOptions searchStateOptions)
    • setLastSearchState

      protected void setLastSearchState(String lastSearchState)
      Setter for the query string preference
      Parameters:
      lastSearchState - the new value for the lastsearchstate preference
    • createSearchStateOptions

      protected ISearchStateOptions createSearchStateOptions()
    • createSearchStateOptions

      protected ISearchStateOptions createSearchStateOptions(boolean forSearchOnDisplay)
    • addInfoMessage

      protected void addInfoMessage(String message)
      Helper method for adding an info message to the faces context
      Parameters:
      message -
    • isAdvancedSearchAvailable

      public boolean isAdvancedSearchAvailable()
      Returns:
      the advancedSearchAvailable
    • setAdvancedSearchAvailable

      public void setAdvancedSearchAvailable(boolean advancedSearchAvailable)
      Parameters:
      advancedSearchAvailable - the advancedSearchAvailable to set
    • getAsyncGoRefresh

      public String getAsyncGoRefresh()
      Returns:
      the asyncGoRefresh
    • setAsyncGoRefresh

      public void setAsyncGoRefresh(String asyncGoRefresh)
      Parameters:
      asyncGoRefresh - the asyncGoRefresh to set
    • isClearFormButtonAvailable

      public boolean isClearFormButtonAvailable()
      Returns:
      the clearFormButtonAvailable
    • setClearFormButtonAvailable

      public void setClearFormButtonAvailable(boolean clearFormButtonAvailable)
      Parameters:
      clearFormButtonAvailable - the clearFormButtonAvailable to set
    • isKeywordsFieldAvailable

      public boolean isKeywordsFieldAvailable()
      Returns:
      the keywordsFieldAvailable
    • setKeywordsFieldAvailable

      public void setKeywordsFieldAvailable(boolean keywordsFieldAvailable)
      Parameters:
      keywordsFieldAvailable - the keywordsFieldAvailable to set
    • isMaxResultsFieldAvailable

      public boolean isMaxResultsFieldAvailable()
      Returns:
      the maxResultsFieldAvailable
    • setMaxResultsFieldAvailable

      public void setMaxResultsFieldAvailable(boolean maxResultsFieldAvailable)
      Parameters:
      maxResultsFieldAvailable - the maxResultsFieldAvailable to set
    • getMaxResultsMaxValue

      public long getMaxResultsMaxValue()
      Returns:
      the maxResultsMaxValue
    • setMaxResultsMaxValue

      public void setMaxResultsMaxValue(long maxResultsMaxValue)
      Parameters:
      maxResultsMaxValue - the maxResultsMaxValue to set
    • isRefineSearchButtonAvailable

      public boolean isRefineSearchButtonAvailable()
      Returns:
      the refineSearchButtonAvailable
    • setRefineSearchButtonAvailable

      public void setRefineSearchButtonAvailable(boolean refineSearchButtonAvailable)
      Parameters:
      refineSearchButtonAvailable - the refineSearchButtonAvailable to set
    • isSaveSearchAvailable

      public boolean isSaveSearchAvailable()
      Returns:
      the saveSearchAvailable
    • setSaveSearchAvailable

      public void setSaveSearchAvailable(boolean saveSearchAvailable)
      Parameters:
      saveSearchAvailable - the saveSearchAvailable to set
    • isSimpleSearchAvailable

      public boolean isSimpleSearchAvailable()
      Returns:
      the simpleSearchAvailable
    • setSimpleSearchAvailable

      public void setSimpleSearchAvailable(boolean simpleSearchAvailable)
      Parameters:
      simpleSearchAvailable - the simpleSearchAvailable to set
    • isUseAsyncGoButton

      public boolean isUseAsyncGoButton()
      Returns:
      the useAsyncGoButton
    • setUseAsyncGoButton

      public void setUseAsyncGoButton(boolean useAsyncGoButton)
      Parameters:
      useAsyncGoButton - the useAsyncGoButton to set
    • isUseOrConditionAvailable

      public boolean isUseOrConditionAvailable()
      Returns:
      the useOrConditionAvailable
    • setUseOrConditionAvailable

      public void setUseOrConditionAvailable(boolean useOrConditionAvailable)
      Parameters:
      useOrConditionAvailable - the useOrConditionAvailable to set
    • isUserSearchOptionsAvailable

      public boolean isUserSearchOptionsAvailable()
      Returns:
      the userSearchOptionsAvailable
    • setUserSearchOptionsAvailable

      public void setUserSearchOptionsAvailable(boolean userSearchOptionsAvailable)
      Parameters:
      userSearchOptionsAvailable - the userSearchOptionsAvailable to set
    • isShowingSavedDetails

      public boolean isShowingSavedDetails()
      Returns:
      the showingSavedDetails
    • setShowingSavedDetails

      public void setShowingSavedDetails(boolean showingSavedDetails)
      Parameters:
      showingSavedDetails - the showingSavedDetails to set
    • isSimpleSearchRefining

      public boolean isSimpleSearchRefining()
      Returns:
      the simpleSearchRefining
    • setSimpleSearchRefining

      public void setSimpleSearchRefining(boolean simpleSearchRefining)
      Parameters:
      simpleSearchRefining - the simpleSearchRefining to set
    • getSimpleSearchTabText

      public String getSimpleSearchTabText()
    • getSimpleSearchRefinedTabText

      public String getSimpleSearchRefinedTabText()
    • getCategorizedSavedSearches

      public ISelectItemProvider[] getCategorizedSavedSearches()