Class BaseSearchPageBean
java.lang.Object
com.webmethods.caf.faces.bean.BaseFacesBean
com.webmethods.caf.faces.bean.BaseFacesSessionBean
com.webmethods.caf.faces.bean.BaseViewBean
com.webmethods.caf.faces.bean.BaseWebPageBean
com.webmethods.caf.faces.bean.search.BaseSearchPageBean
- All Implemented Interfaces:
IPageFlowScopeAdapter
,ISearchBarPageBean
,ISearchPageBean
,ISearchResultsPageBean
,Serializable
,EventListener
,PhaseListener
,HttpSessionBindingListener
public abstract class BaseSearchPageBean
extends BaseWebPageBean
implements ISearchBarPageBean, ISearchResultsPageBean, ISearchPageBean
Base class for a CAF view that contains both a searchbar and search results table
in the same view.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.webmethods.caf.faces.bean.BaseViewBean
BaseViewBean.ClientIdsContentProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
Holds the search invocation ID for the previous requestprotected boolean
indicates if current query has changed and new search is neededprotected ISavedSearchProvider
Reference to the current saved search providerprotected ISearchOptionsManager
Reference to the current search options managerprotected ISearchQueryFactory
Reference to the current search query factoryprotected ISearchResultsOptionsManager
Reference to the current search result options managerprotected List<SelectItem>
Temporary list of sortable columnsprotected List<SelectItem>
Temporary list of viewable columnsprotected ISearchQuery
Holds the active search query for the search results table controlprotected static final String
Attribute name used to flag whether the search result preferences have been applied to the search result table control.Fields inherited from class com.webmethods.caf.faces.bean.BaseViewBean
clientIds, initialized
Fields inherited from class com.webmethods.caf.faces.bean.BaseFacesSessionBean
fExpireWithPageFlow
Fields inherited from class com.webmethods.caf.faces.bean.BaseFacesBean
DATA_BINDING_CLIENTS, EMPTY_RESOURCES, OUTCOME_ERROR, OUTCOME_OK, resourcesProviders
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
applyUserPreferences
(DataTable dataTable, String[] columnDisplay, String initialSortBy, String columnWidth, boolean initialSortAscending) Apply the user preferences to the data table.protected void
Overrides the default behavior to detect when a search query has changed and apply user preferences to the search result table control before rendering.protected ISearchQuery
Creates and returns a new SearchQuery object for the SearchBar control.doSearch()
Action handler for executing a searchGets the active saved search object for the SearchBar control.Gets the active search query object for the SearchBar control.Controls may use this method to determine if there is an active queryabstract UIComponent
Return the active search results component (table, tree, whatever).Delegates to the same API on the current search result options managerString[]
Delegates to the same API on the current search result options managerint
int
Delegates to the same API on the current search result options managerDelegates to the same API on the current search result options managerDelegates to the same API on the current search result options managerGets the active search query object for the SearchResults control.protected SearchBar
Wrapper around the getSearchBarControl method that throws an exception if the SearchBar value is nullCreates and returns implementation of ISavedSearchProviderabstract SearchBar
Retrieves the SearchBar control for this pageCreates and returns implementation of ISearchOptionsManagerCreates and returns implementation of ISearchQueryFactoryGets the search results options managerReturns the list of sortable columnsReturns the list of viewable columnsboolean
Returns whether the query has changed from the previous requestboolean
Returns true if the active searchbar tab is the the 'Advanced' tabboolean
Returns true if the active searchbar tab is the the 'Options' tabboolean
Returns true if the active searchbar tab is the the 'Saved' tabboolean
Returns true if the active searchbar tab is the the 'Search' tabstatic void
loadColumnInfoForControl
(DataTable dataTable, List<SelectItem> viewableColumnList, List<SelectItem> sortableColumnList) Loads the column info for the requested controlvoid
Page bean may load default values into search query objectAction handler for the drag-to-resize/reorder-columns updates.void
setColumnWidthsPreference
(String columnWidths) Delegates to the same API on the current search result options managervoid
setDisplayColumnsPreference
(String[] columnDisplay) Delegates to the same API on the current search result options managervoid
setInitialExportPageSize
(int pageSize) void
setInitialPageSize
(int pageSize) Delegates to the same API on the current search result options managervoid
setInitialSortAscendingPreference
(Boolean ascending) Delegates to the same API on the current search result options managervoid
setInitialSortByPreference
(String sortBy) Delegates to the same API on the current search result options managerMethods inherited from class com.webmethods.caf.faces.bean.BaseWebPageBean
getAppNavBean
Methods inherited from class com.webmethods.caf.faces.bean.BaseViewBean
afterApplyRequestValues, afterInvokeApplication, afterPhase, afterProcessValidations, afterRenderResponse, afterRestoreView, afterUpdateModelValues, beforeApplyRequestValues, beforeInvokeApplication, beforePhase, beforeProcessValidations, beforeRestoreView, beforeUpdateModelValues, callInitialize, findComponent, findComponentInRoot, getApplicationScope, getClientIds, getPhaseId, getRealPath, getRequestParam, getRequestScope, getSessionScope, gotoPage, gotoPage, initialize, isAsyncRequest, preRenderResponse, release, resetPageFlowStorage, streamFileDataToResponse
Methods inherited from class com.webmethods.caf.faces.bean.BaseFacesSessionBean
getExpireWithPageFlow, setExpireWithPageFlow, valueBound, valueUnbound
Methods inherited from class com.webmethods.caf.faces.bean.BaseFacesBean
createMethodBinding, createMethodExpression, createValueBinding, createValueExpression, createValueExpression, error, error, error, error, error, getBean, getFacesContext, getLocale, getResourceInputStream, getResources, getResourcesProvider, getRootCause, getStackTrace, getTreeAttribute, isUserInRole, log, log, log, putTreeAttribute, resetDataBindingClients, resolveDataBinding, resolveDataBinding, resolveExpression, setValue
-
Field Details
-
SEARCH_RESULT_PREFERENCES_APPLIED_KEY
Attribute name used to flag whether the search result preferences have been applied to the search result table control.- See Also:
-
fSavedSearchProvider
Reference to the current saved search provider -
fSearchQueryFactory
Reference to the current search query factory -
fSearchOptionsManager
Reference to the current search options manager -
fSearchResultsOptionsManager
Reference to the current search result options manager -
fViewableColumns
Temporary list of viewable columns -
fSortableColumns
Temporary list of sortable columns -
fPreviousInvocationID
protected int fPreviousInvocationIDHolds the search invocation ID for the previous request -
fQueryChanged
protected boolean fQueryChangedindicates if current query has changed and new search is needed -
resultsSearchQuery
Holds the active search query for the search results table control
-
-
Constructor Details
-
BaseSearchPageBean
public BaseSearchPageBean()
-
-
Method Details
-
getSearchResultsOptionsManager
Gets the search results options manager- Returns:
- searh results options manager
-
getSavedSearchProvider
Description copied from interface:ISearchBarPageBean
Creates and returns implementation of ISavedSearchProvider- Specified by:
getSavedSearchProvider
in interfaceISearchBarPageBean
-
getSearchOptionsManager
Description copied from interface:ISearchBarPageBean
Creates and returns implementation of ISearchOptionsManager- Specified by:
getSearchOptionsManager
in interfaceISearchBarPageBean
-
getSearchQueryFactory
Description copied from interface:ISearchBarPageBean
Creates and returns implementation of ISearchQueryFactory- Specified by:
getSearchQueryFactory
in interfaceISearchBarPageBean
-
loadSearchQueryDefaults
Description copied from interface:ISearchBarPageBean
Page bean may load default values into search query object- Specified by:
loadSearchQueryDefaults
in interfaceISearchBarPageBean
-
persistDisplayOptions
Description copied from interface:ISearchResultsPageBean
Action handler for the drag-to-resize/reorder-columns updates. By default, it will persist the search results options via the portlet's preference beans' storePreferences() method.- Specified by:
persistDisplayOptions
in interfaceISearchResultsPageBean
- Returns:
- status of the action handler
- Throws:
Exception
-
getActiveSearchQueryString
Controls may use this method to determine if there is an active query- Returns:
- empty string if there is not an active query, or "non-empty" if there is an active query
-
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
-
getSearchBarControl
Retrieves the SearchBar control for this page- Returns:
- SearchBar control for the page
-
getActiveSearchResultsControl
Return the active search results component (table, tree, whatever).- Returns:
- active search results component
-
getSafeSearchBarControl
Wrapper around the getSearchBarControl method that throws an exception if the SearchBar value is null- Returns:
- SearchBar control for the page
-
getActiveSearchQuery
Gets the active search query object for the SearchBar control.- Specified by:
getActiveSearchQuery
in interfaceISearchPageBean
- Returns:
- Returns the activeSearchQuery.
-
getResultsSearchQuery
Gets the active search query object for the SearchResults control.- Returns:
- Returns the resultsSearchQuery.
-
getActiveSavedSearch
Gets the active saved search object for the SearchBar control.- Returns:
- Returns the activeSavedSearch.
-
createSearchQuery
Creates and returns a new SearchQuery object for the SearchBar control. Sub-classes may override to provide an alternate ISearchQuery implementation.- Returns:
- Returns a new ISearchQuery object
-
beforeRenderResponse
protected void beforeRenderResponse()Overrides the default behavior to detect when a search query has changed and apply user preferences to the search result table control before rendering.- Overrides:
beforeRenderResponse
in classBaseViewBean
- See Also:
-
isQueryChanged
public boolean isQueryChanged()Returns whether the query has changed from the previous request- Returns:
- true if the query has changed, false otherwise
-
getDisplayColumnsPreference
Delegates to the same API on the current search result options manager -
setDisplayColumnsPreference
Delegates to the same API on the current search result options manager -
getInitialPageSize
public int getInitialPageSize()Delegates to the same API on the current search result options manager -
setInitialPageSize
public void setInitialPageSize(int pageSize) Delegates to the same API on the current search result options manager -
getInitialExportPageSize
public int getInitialExportPageSize() -
setInitialExportPageSize
public void setInitialExportPageSize(int pageSize) -
getColumnWidthsPreference
Delegates to the same API on the current search result options manager -
setColumnWidthsPreference
Delegates to the same API on the current search result options manager -
getInitialSortByPreference
Delegates to the same API on the current search result options manager -
setInitialSortByPreference
Delegates to the same API on the current search result options manager -
getInitialSortAscendingPreference
Delegates to the same API on the current search result options manager -
setInitialSortAscendingPreference
Delegates to the same API on the current search result options manager -
getSortableColumnList
Returns the list of sortable columns- Returns:
- list of sortable columns
-
getViewableColumnList
Returns the list of viewable columns- Returns:
- list of viewable columns
-
loadColumnInfoForControl
public static void loadColumnInfoForControl(DataTable dataTable, List<SelectItem> viewableColumnList, List<SelectItem> sortableColumnList) Loads the column info for the requested control- Parameters:
viewableColumnList
- list where the viewable columns are addedsortableColumnList
- list where the sortable columns are added
-
applyUserPreferences
public static void applyUserPreferences(DataTable dataTable, String[] columnDisplay, String initialSortBy, String columnWidth, boolean initialSortAscending) Apply the user preferences to the data table.- Parameters:
dataTable
- the search result table controlcolumnDisplay
- array of columns to displayinitialSortBy
- column id to sort bycolumnWidth
- widths of the displayed columnsinitialSortAscending
- sort order
-
doSearch
Action handler for executing a search- Returns:
- outcome of the actions
-