com.webmethods.caf.faces.bean
Class BasePortletPageBean

java.lang.Object
  extended by com.webmethods.caf.faces.bean.BaseFacesBean
      extended by com.webmethods.caf.faces.bean.BaseFacesSessionBean
          extended by com.webmethods.caf.faces.bean.BaseViewBean
              extended by com.webmethods.caf.faces.bean.BasePortletPageBean
All Implemented Interfaces:
IPageFlowScopeAdapter
Direct Known Subclasses:
BasePageBean, BaseSearchBarPageBean, BaseSearchResultOptionsPageBean, BaseSearchResultPageBean

public class BasePortletPageBean
extends BaseViewBean

Bean for representing a portlet page, used for navigation of the page.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.webmethods.caf.faces.bean.BaseViewBean
BaseViewBean.ClientIdsContentProvider
 
Field Summary
 
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, OUTCOME_ERROR, OUTCOME_OK, resourcesProviders
 
Constructor Summary
BasePortletPageBean()
           
 
Method Summary
 void beforeWorkspaceLoad(ActionRequest request, ActionResponse response, String navigationType)
          Handle state initialization updates for a workspace load request.
protected  void callInitialize()
          Initializes the bean if not already done.
protected  void clearNavigationState()
          Clear the portlet navigation state cache.
protected  IPortletURL createActionUrl()
          Creates action portletUrl for the current portlet
protected  IPortletURL createRenderUrl()
          Creates render portletUrl for the current portlet.
protected  BaseFacesPreferencesBean getActivePreferencesBean()
          Returns action preferences bean.
protected  PortletPreferences getPreferences()
          Obtains instance of the Portlet Preferences for the current portlet
 String getRequestID()
          Returns the request ID used to invoke reach this page.
 void gotoPage(String pageURI, boolean redirect)
          Switches to the specified view page.
protected  void switchToPortletMode(PortletMode mode)
          Switches the current portlet mode to the requested mode.
 
Methods inherited from class com.webmethods.caf.faces.bean.BaseViewBean
afterApplyRequestValues, afterInvokeApplication, afterPhase, afterProcessValidations, afterRenderResponse, afterRestoreView, afterUpdateModelValues, beforeApplyRequestValues, beforeInvokeApplication, beforePhase, beforeProcessValidations, beforeRenderResponse, beforeRestoreView, beforeUpdateModelValues, findComponent, findComponentInRoot, getApplicationScope, getClientIds, getPhaseId, getRealPath, getRequestParam, getRequestScope, getSessionScope, gotoPage, initialize, isAsyncRequest, 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, createValueBinding, error, error, error, error, error, getBean, getFacesContext, getLocale, getResourceInputStream, getResources, getResourcesProvider, getRootCause, getStackTrace, getTreeAttribute, isUserInRole, log, log, log, putTreeAttribute, resetDataBindingClients, resolveDataBinding, resolveDataBinding, resolveExpression, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasePortletPageBean

public BasePortletPageBean()
Method Detail

getActivePreferencesBean

protected BaseFacesPreferencesBean getActivePreferencesBean()
Returns action preferences bean. May return null for pages that are not associated with any portlet

Returns:
actual preference bean references for this portlet page or null for application pages

switchToPortletMode

protected void switchToPortletMode(PortletMode mode)
                            throws PortletModeException
Switches the current portlet mode to the requested mode.

Parameters:
mode - the portlet mode to switch to
Throws:
PortletModeException - if the requested portlet mode is not supported or allowed

gotoPage

public void gotoPage(String pageURI,
                     boolean redirect)
Switches to the specified view page. If redirect is false it will simply change the faces context view root to the contents of the specified viewId. If redirect is true, it will redirect to the URL of the specified view. This method should be called inside an action method to set the page URI for the next rendering request.

Overrides:
gotoPage in class BaseViewBean
Parameters:
pageURI - the uri of the page, for example: /portlet1/mypage.view
redirect - true to redirect to the page, false to just change the FacesContext view root

createRenderUrl

protected IPortletURL createRenderUrl()
                               throws Exception
Creates render portletUrl for the current portlet.

Returns:
instance of IPortletURL
Throws:
Exception - if portlet url cannot be created

createActionUrl

protected IPortletURL createActionUrl()
                               throws Exception
Creates action portletUrl for the current portlet

Returns:
instance of IPortletURL
Throws:
Exception - if portlet url cannot be created

getPreferences

protected PortletPreferences getPreferences()
                                     throws Exception
Obtains instance of the Portlet Preferences for the current portlet

Returns:
portlet preferences object
Throws:
Exception - if this is made outside of the PortletContext

callInitialize

protected void callInitialize()
Description copied from class: BaseViewBean
Initializes the bean if not already done.

Overrides:
callInitialize in class BaseViewBean

getRequestID

public String getRequestID()
Returns the request ID used to invoke reach this page.

Returns:
String request ID.

beforeWorkspaceLoad

public void beforeWorkspaceLoad(ActionRequest request,
                                ActionResponse response,
                                String navigationType)
Handle state initialization updates for a workspace load request. If the 'MWS_CLEAR_NAV_STATE_BEFORE_WORKSPACE_LOAD' portlet INIT_PARAM == true, this will restore the portlet mode, window state and current .view back to the original persisted values.

Parameters:
navigationType - the navigation type. usually 'mws_lhs' or 'mws_tab'

clearNavigationState

protected void clearNavigationState()
Clear the portlet navigation state cache. This will restore the portlet mode, window state and current .view back to the original persisted values on the next render request. This can only be called while processing a portlet action request.