Class BaseSearchResultPageBean
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.BasePortletPageBean
com.webmethods.caf.faces.bean.search.BaseSearchResultPageBean
- All Implemented Interfaces:
IPageFlowScopeAdapter
,ISearchPageBean
,ISearchResultsPageBean
,Serializable
,EventListener
,PhaseListener
,HttpSessionBindingListener
- Direct Known Subclasses:
BaseSearchBarPlusTableResultPageBean
,BaseSearchBarPlusTreeResultPageBean
,BaseTableSearchResultPageBean
,BaseTreeSearchResultPageBean
public abstract class BaseSearchResultPageBean
extends BasePortletPageBean
implements ISearchPageBean, ISearchResultsPageBean
Base page bean for search result pages
- Since:
- 7.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.webmethods.caf.faces.bean.BaseViewBean
BaseViewBean.ClientIdsContentProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ISearchQuery
Holds the active search query for the search results table controlprotected String
holds the query string for the previous requestprotected boolean
indicates if current query has changed and new search is neededprotected List<SelectItem>
Temporary list of sortable columnsprotected List<SelectItem>
Temporary list of viewable columnsprotected 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 TypeMethodDescriptionprotected void
applyUserPreferences
(DataTable dataTable) Apply the user preferences to the data table.protected void
Overrides the default behavior to destroy old cached query object if the query string has changed.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.Gets the active search query object for the SearchBar control.Return the active search query string.abstract UIComponent
Return the active search results component (table, tree, whatever).Return the column widths preference.String[]
Return the display column preference.int
Return the initialPageSize preference value.Return the initialSortBy preference.Return the initialSortBy preference.Returns the list of sortable columnsReturns the list of viewable columnsprotected boolean
Returns wheter the user options need to be applied to the search result controlboolean
Returns whether the query has changed from the previous requestboolean
Returns true if there is a wired search bar portlet to drive results portlet.Action handler for the drag-to-resize/reorder-columns updates.protected void
setActiveSearchQuery
(ISearchQuery activeSearchQuery) Sets the active search query object for the SearchBar control.void
setColumnWidthsPreference
(String columnWidths) Sets the column widths preference.void
setDisplayColumnsPreference
(String[] columnDisplay) Sets the display column preference.void
setInitialPageSize
(int value) Sets the initial page size preferencevoid
Sets the initialSortAscendinbg preference.void
setInitialSortByPreference
(String value) Sets the initialSortBy preference.Methods inherited from class com.webmethods.caf.faces.bean.BasePortletPageBean
beforeWorkspaceLoad, callInitialize, clearNavigationState, createActionUrl, createRenderUrl, getActivePreferencesBean, getPreferences, getRequestID, gotoPage, switchToPortletMode
Methods inherited from class com.webmethods.caf.faces.bean.BaseViewBean
afterApplyRequestValues, afterInvokeApplication, afterPhase, afterProcessValidations, afterRenderResponse, afterRestoreView, afterUpdateModelValues, beforeInvokeApplication, beforePhase, beforeProcessValidations, beforeRestoreView, beforeUpdateModelValues, findComponent, findComponentInRoot, getApplicationScope, getClientIds, getPhaseId, getRealPath, getRequestParam, getRequestScope, getSessionScope, 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:
-
fViewableColumns
Temporary list of viewable columns -
fSortableColumns
Temporary list of sortable columns -
fPreviousRequestSearchQuery
holds the query string for the previous request -
fActiveSearchQuery
Holds the active search query for the search results table control -
fQueryChanged
protected boolean fQueryChangedindicates if current query has changed and new search is needed
-
-
Constructor Details
-
BaseSearchResultPageBean
public BaseSearchResultPageBean()
-
-
Method Details
-
getActiveSearchQuery
Gets the active search query object for the SearchBar control.- Specified by:
getActiveSearchQuery
in interfaceISearchPageBean
- Returns:
- Returns the activeSearchQuery.
-
setActiveSearchQuery
Sets the active search query object for the SearchBar control.- Parameters:
activeSearchQuery
- The activeSearchQuery to set.
-
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
-
isQueryChanged
public boolean isQueryChanged()Returns whether the query has changed from the previous request- Returns:
- true if the query has changed, false otherwise
-
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:
-
beforeApplyRequestValues
protected void beforeApplyRequestValues()Overrides the default behavior to destroy old cached query object if the query string has changed.- Overrides:
beforeApplyRequestValues
in classBaseViewBean
- See Also:
-
isApplyPreferencesNeeded
protected boolean isApplyPreferencesNeeded()Returns wheter the user options need to be applied to the search result control- Returns:
- true if apply prefererences is needed, false otherwise
-
applyUserPreferences
Apply the user preferences to the data table.- Parameters:
dataTable
- the search result table control
-
getActiveSearchQueryString
Return the active search query string. Usually via a portlet property that is wired to a search bar portlet.- Returns:
- the search query string
-
getActiveSearchResultsControl
Return the active search results component (table, tree, whatever).- Returns:
- active search results component
-
getDisplayColumnsPreference
Return the display column preference. Usually via a portlet property that is configured from the portlet edit mode.- Returns:
- array of column ids that should be displayed in the given order
-
setDisplayColumnsPreference
Sets the display column preference. Usually via a portlet property that is configured from the portlet edit mode. param array of column ids that should be displayed in the given order -
getColumnWidthsPreference
Return the column widths preference. Usually via a portlet property that is configured from the portlet edit mode.- Returns:
- csv-style map of column ids to column widths (ie "colOne=60%,colTwo=40%,colThree=20px")
-
setColumnWidthsPreference
Sets the column widths preference. Usually via a portlet property that is configured from the portlet edit mode. param csv-style map of column ids to column widths (ie "colOne=60%,colTwo=40%,colThree=20px") -
setInitialSortByPreference
Sets the initialSortBy preference.- Parameters:
value
- the column id to sort by
-
getInitialSortByPreference
Return the initialSortBy preference. Usually via a portlet property that is configured from the portlet edit mode.- Returns:
- id of the column to sort by initially
-
setInitialSortAscendingPreference
Sets the initialSortAscendinbg preference.- Parameters:
value
- true to sort in ascending order, false otherwise
-
getInitialSortAscendingPreference
Return the initialSortBy preference. Usually via a portlet property that is configured from the portlet edit mode.- Returns:
- id of the column to sort by initially
-
setInitialPageSize
public void setInitialPageSize(int value) Sets the initial page size preference- Parameters:
value
- number of rows to display on each page of search results
-
getInitialPageSize
public int getInitialPageSize()Return the initialPageSize preference value. Usually via a portlet property that is configured from the portlet edit mode. -
persistDisplayOptions
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:
javax.portlet.PortletModeException
Exception
-
getSortableColumnList
Returns the list of sortable columns- Returns:
- list of sortable columns
-
getViewableColumnList
Returns the list of viewable columns- Returns:
- list of viewable columns
-
isSearchBarAvailable
Returns true if there is a wired search bar portlet to drive results portlet. It may be used to implement a Refresh button on the search result screen if there is no search bar available- Throws:
Exception
-