|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.liferay.faces.bridge.context.BridgeContext
com.liferay.faces.bridge.context.BridgeContextCompatImpl
com.liferay.faces.bridge.context.BridgeContextImpl
public class BridgeContextImpl
| Nested Class Summary | |
|---|---|
protected class |
BridgeContextImpl.StringWrapper
|
| Field Summary | |
|---|---|
static String |
ATTR_RESPONSE_NAMESPACE
|
| Constructor Summary | |
|---|---|
BridgeContextImpl(BridgeConfig bridgeConfig,
BridgeRequestScope bridgeRequestScope,
javax.portlet.PortletConfig portletConfig,
javax.portlet.PortletContext portletContext,
javax.portlet.PortletRequest portletRequest,
javax.portlet.PortletResponse portletResponse,
Bridge.PortletPhase portletPhase,
PortletContainer portletContainer,
IncongruityContext incongruityContext)
|
|
| Method Summary | |
|---|---|
void |
dispatch(String path)
Creates a PortletRequestDispatcher for the specified path and issues a forward/include as
appropriate. |
BridgeActionURL |
encodeActionURL(String url)
Encodes a bridge "action" URL, meaning a URL that conforms to the deviation requirements of ExternalContext.encodeActionURL(String) listed in Section 6.1.3.1 of the Bridge Spec. |
BridgePartialActionURL |
encodePartialActionURL(String url)
Encodes a bridge "partial action" URL, meaning a URL that is intended to be used for Ajax (partial request) processing. |
BridgeRedirectURL |
encodeRedirectURL(String baseUrl,
Map<String,List<String>> parameters)
Encodes a bridge "redirect" URL, meaning a URL that conforms to the deviation requirements of ExternalContext.redirect(String) listed in Section 6.1.3.1 of the Bridge Spec. |
BridgeResourceURL |
encodeResourceURL(String url)
Encodes a bridge "resource" URL, meaning a URL that conforms to the deviation requirements of ExternalContext.encodeResourceURL(String) listed in Section 6.1.3.1 of the Bridge Spec. |
Map<String,Object> |
getAttributes()
Returns the attribute map associated with this context. |
BridgeConfig |
getBridgeConfig()
Convenience method that returns the BridgeConfig for this context. |
BridgeRequestScope |
getBridgeRequestScope()
Convenience method that returns the BridgeRequestScope for this context. |
String |
getDefaultRenderKitId()
Returns the default Render Kit ID, which is optionally specified by developers with the in the WEB-INF/portlet.xml descriptor. |
Map<String,String> |
getDefaultViewIdMap()
Returns an immutable Map whose keys are determined by PortletMode.toString() and whose values
are retrieved from the following sections of the WEB-INF/portlet.xml descriptor. |
protected FacesView |
getFacesView()
Returns an instance of FacesView that represents the target view (and optional query string) as described
in section 5.2.3 of the Bridge Spec titled "Determining the Target View". |
String |
getFacesViewId()
Returns the target view (and optional query string) as described in section 5.2.3 of the Bridge Spec titled "Determining the Target View". |
protected String |
getFacesViewIdAndQueryString()
This method returns the target view (and optional query string) as described in section 5.2.3 of the Bridge Spec titled "Determining the Target View". |
String |
getFacesViewIdFromPath(String viewPath)
Returns the viewId associated with the specified viewPath by examining the servlet-mapping entries
from the WEB-INF/web.xml descriptor. |
String |
getFacesViewIdFromPath(String viewPath,
boolean mustExist)
Returns the viewId associated with the specified viewPath by examining the servlet-mapping entries
from the WEB-INF/web.xml descriptor. |
String |
getFacesViewQueryString()
Returns the query-string part of the to-view-id of the last navigation-rule that fired, or the query-string part of the Bridge.VIEW_ID request attribute. |
IncongruityContext |
getIncongruityContext()
|
String |
getInitParameter(String name)
NOTE: PROPOSE-FOR-BRIDGE3-API Returns the value of the specified initialization parameter. |
javax.portlet.PortletConfig |
getPortletConfig()
Return the current PortletConfig. |
PortletContainer |
getPortletContainer()
Returns the PortletContainer associated with the current request. |
javax.portlet.PortletContext |
getPortletContext()
Returns the PortletContext associated with the current portlet. |
javax.portlet.PortletRequest |
getPortletRequest()
Returns the PortletRequest associated with the current request. |
Bridge.PortletPhase |
getPortletRequestPhase()
Returns the Bridge.PortletPhase associated with the current portlet lifecycle phase. |
javax.portlet.PortletResponse |
getPortletResponse()
Returns the PortletResponse associated with the current response. |
List<String> |
getPreFacesRequestAttrNames()
Returns a list of attribute names that existed prior to the FacesContext being created. |
Map<String,String[]> |
getPreservedActionParams()
Returns the Map of preserved action parameters. |
BridgeRedirectURL |
getRenderRedirectURL()
Gets the render-redirect URL that was set during a render-redirect. |
Map<String,String> |
getRequestHeaderMap()
|
Map<String,String[]> |
getRequestHeaderValuesMap()
|
Map<String,String> |
getRequestParameterMap()
|
protected RequestParameterMapFactory |
getRequestParameterMapFactory()
|
Map<String,String[]> |
getRequestParameterValuesMap()
|
String |
getRequestPathInfo()
Returns the pathInfo associated with the current viewId. |
String |
getRequestServletPath()
Returns the servletPath associated with the current viewId. |
String |
getResponseNamespace()
|
Writer |
getResponseOutputWriter()
Returns a Writer that is meant to be used as a return value for ExternalContext.getResponseOutputWriter(). |
String |
getSavedViewState()
Returns the saved view state. |
boolean |
isBridgeRequestScopePreserved()
Returns the flag indicating whether or not the current BridgeRequestScope is preserved at the end of the
RenderRequest. |
boolean |
isPreserveActionParams()
Determines whether or not the "javax.portlet.faces.preserveActionParams" init-param has been configured in the WEB-INF/portlet.xml descriptor. |
boolean |
isProcessingAfterViewContent()
Flag indicating whether or not the bridge is processing Bridge.AFTER_VIEW_CONTENT. |
boolean |
isRenderRedirect()
Returns the flag indicating whether or not a render redirect occurred. |
boolean |
isRenderRedirectAfterDispatch()
Returns a flag indicating whether or not a render-redirect has occurred after dispatching to a JSP. |
void |
redirect(String url)
If the specified url is external to this portlet context, then calling this method causes a
redirection to the specified url. |
void |
release()
Performs any necessary cleanup. |
void |
setBridgeRequestScopePreserved(boolean bridgeRequestScopePreserved)
|
void |
setPortletRequest(javax.portlet.PortletRequest portletRequest)
Preserves the PortletRequest associated with the current request. |
void |
setPortletResponse(javax.portlet.PortletResponse portletResponse)
Preserves the PortletResponse associated with the current response. |
void |
setPreFacesRequestAttrNames(List<String> preFacesRequestAttrNames)
|
void |
setPreservedActionParams(Map<String,String[]> preservedActionParams)
|
void |
setProcessingAfterViewContent(boolean processingAfterViewContent)
Sets the flag indicating whether or not the bridge is processing Bridge.AFTER_VIEW_CONTENT. |
void |
setRenderRedirectAfterDispatch(boolean renderRedirectAfterDispatch)
Sets a flag indicating whether or not a render-redirect has occurred after dispatching to a JSP. |
void |
setRenderRedirectURL(BridgeRedirectURL renderRedirectURL)
Sets the render-redirect URL that is associated with a render-redirect. |
void |
setSavedViewState(String savedViewState)
Preserves the saved view state. |
| Methods inherited from class com.liferay.faces.bridge.context.BridgeContextCompatImpl |
|---|
partialViewContextRenderAll |
| Methods inherited from class com.liferay.faces.bridge.context.BridgeContext |
|---|
getCurrentInstance, setCurrentInstance |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String ATTR_RESPONSE_NAMESPACE
| Constructor Detail |
|---|
public BridgeContextImpl(BridgeConfig bridgeConfig,
BridgeRequestScope bridgeRequestScope,
javax.portlet.PortletConfig portletConfig,
javax.portlet.PortletContext portletContext,
javax.portlet.PortletRequest portletRequest,
javax.portlet.PortletResponse portletResponse,
Bridge.PortletPhase portletPhase,
PortletContainer portletContainer,
IncongruityContext incongruityContext)
| Method Detail |
|---|
public void dispatch(String path)
throws IOException
BridgeContextPortletRequestDispatcher for the specified path and issues a forward/include as
appropriate.
dispatch in class BridgeContextIOExceptionpublic BridgeActionURL encodeActionURL(String url)
BridgeContextExternalContext.encodeActionURL(String) listed in Section 6.1.3.1 of the Bridge Spec.
encodeActionURL in class BridgeContexturl - The URL to be encoded.
BrideActionURL that conforms to the proper encoding.public BridgePartialActionURL encodePartialActionURL(String url)
BridgeContextExternalContext.encodePartialActionURL(String) was added in JSF 2.0 which means
there are no Bridge Spec deviation requirements yet.
encodePartialActionURL in class BridgeContexturl - The URL to be encoded.
BridgePartialActionURL that conforms to the proper encoding.
public BridgeRedirectURL encodeRedirectURL(String baseUrl,
Map<String,List<String>> parameters)
BridgeContextExternalContext.redirect(String) listed in Section 6.1.3.1 of the Bridge Spec.
encodeRedirectURL in class BridgeContextbaseUrl - The URL to be encoded.parameters - The URL parameters that are to be included as part of the encoding.
BridgeRedirectURL that conforms to the proper encoding.public BridgeResourceURL encodeResourceURL(String url)
BridgeContextExternalContext.encodeResourceURL(String) listed in Section 6.1.3.1 of the Bridge Spec.
encodeResourceURL in class BridgeContexturl - The URL to be encoded.
BridgeResourceURL that conforms to the proper encoding.
public void redirect(String url)
throws IOException
BridgeContexturl is external to this portlet context, then calling this method causes a
redirection to the specified url. Otherwise, this method will effectively "navigate" to the Faces
viewId found in the URL path.
redirect in class BridgeContextIOExceptionpublic void release()
BridgeContext
release in class BridgeContextpublic Map<String,Object> getAttributes()
BridgeContext
getAttributes in class BridgeContextpublic BridgeConfig getBridgeConfig()
BridgeContextBridgeConfig for this context.
getBridgeConfig in class BridgeContextpublic BridgeRequestScope getBridgeRequestScope()
BridgeContextBridgeRequestScope for this context.
getBridgeRequestScope in class BridgeContextpublic void setBridgeRequestScopePreserved(boolean bridgeRequestScopePreserved)
public boolean isBridgeRequestScopePreserved()
BridgeContextBridgeRequestScope is preserved at the end of the
RenderRequest.
isBridgeRequestScopePreserved in class BridgeContexttrue if the scope is to be preserved, otherwise false. Default value is
false which is an optimization for JSF 2 that deviates from the Bridge Spec. See FACES-219.public String getDefaultRenderKitId()
BridgeContext
getDefaultRenderKitId in class BridgeContextpublic Map<String,String> getDefaultViewIdMap()
BridgeContextReturns an immutable Map whose keys are determined by PortletMode.toString() and whose values
are retrieved from the following sections of the WEB-INF/portlet.xml descriptor.
<init-param>
<name>javax.portlet.faces.defaultViewId.view</name>
<value>/xhtml/portletViewMode.xhtml</value>
</init-param>
<init-param>
<name>javax.portlet.faces.defaultViewId.edit</name>
<value>/xhtml/portletEditMode.xhtml</value>
</init-param>
<init-param>
<name>javax.portlet.faces.defaultViewId.help</name>
<value>/xhtml/portletHelpMode.xhtml</value>
</init-param>
getDefaultViewIdMap in class BridgeContext
protected FacesView getFacesView()
throws BridgeDefaultViewNotSpecifiedException,
BridgeInvalidViewPathException
FacesView that represents the target view (and optional query string) as described
in section 5.2.3 of the Bridge Spec titled "Determining the Target View".
{@link - BridgeDefaultViewNotSpecifiedException} when the default view is not specified in the
WEB-INF/portlet.xml descriptor.
{@link - BridgeInvalidViewPathException} when the Bridge.VIEW_PATH request attribute contains an
invalid path such that the target view cannot be determined.
BridgeDefaultViewNotSpecifiedException
BridgeInvalidViewPathException
public String getFacesViewId()
throws BridgeDefaultViewNotSpecifiedException,
BridgeInvalidViewPathException
BridgeContext
getFacesViewId in class BridgeContextBridgeDefaultViewNotSpecifiedException
BridgeInvalidViewPathException
protected String getFacesViewIdAndQueryString()
throws BridgeDefaultViewNotSpecifiedException,
BridgeInvalidViewPathException
This method returns the target view (and optional query string) as described in section 5.2.3 of the Bridge Spec titled "Determining the Target View".
Try#1: Get the viewId from the Bridge.VIEW_ID (javax.portlet.faces.viewId) request attribute. As
described in sections 3.4 and 4.2.5 of the bridge spec, this attribute is set by the GenericFacesPortlet
when it encounters the Bridge.FACES_VIEW_ID_PARAMETER request parameter.
Try#2: Get the viewId from the Bridge.VIEW_PATH (javax.portlet.faces.viewPath) request attribute. As
described in sections 3.4 and 4.2.5 of the bridge spec, this attribute is set by the GenericFacesPortlet
when it encounters the Bridge.FACES_VIEW_PATH_PARAMETER request parameter. If the viewId cannot be
determined, then BridgeInvalidViewPathException is thrown.
Try#3: Get the viewId from a prior render-redirect (if one has occurred).
Try#4: Get the viewId from a request parameter, the name of which is dynamic depending on the Bridge.PortletPhase.
Try#5:Get the viewId from the init-param value in the portlet.xml descriptor according the current PortletMode.
{@link - BridgeDefaultViewNotSpecifiedException} when the default view is not specified in the
WEB-INF/portlet.xml descriptor.
{@link - BridgeInvalidViewPathException} when the Bridge.VIEW_PATH request attribute contains an
invalid path such that the target view cannot be determined.
BridgeDefaultViewNotSpecifiedException
BridgeInvalidViewPathExceptionpublic String getFacesViewIdFromPath(String viewPath)
BridgeContextviewPath by examining the servlet-mapping entries
from the WEB-INF/web.xml descriptor.
getFacesViewIdFromPath in class BridgeContextviewPath - The path to the view.
viewPath (providing that the view physically
exists). Otherwise returns null.
public String getFacesViewIdFromPath(String viewPath,
boolean mustExist)
BridgeContextviewPath by examining the servlet-mapping entries
from the WEB-INF/web.xml descriptor.
getFacesViewIdFromPath in class BridgeContextviewPath - The path to the view.mustExist - Flag indicating whether or not the view must physically exist in order for the viewId to be
returned.
viewPath. Otherwise returns null.public String getFacesViewQueryString()
BridgeContextBridge.VIEW_ID request attribute.
getFacesViewQueryString in class BridgeContextpublic boolean isRenderRedirectAfterDispatch()
BridgeContext
isRenderRedirectAfterDispatch in class BridgeContexttrue if a render-redirect has occurred after dispatching to a JSP, otherwise
false.public IncongruityContext getIncongruityContext()
getIncongruityContext in class BridgeContextpublic String getInitParameter(String name)
BridgeContextPortletConfig.getInitParameter(String) method. Otherwise, return the value of the PortletContext.getInitParameter(String) method. This provides a way for init-param values found in the
WEB-INF/portlet.xml descriptor to override context-param values found in the WEB-INF/web.xml descriptor.
getInitParameter in class BridgeContextpublic javax.portlet.PortletConfig getPortletConfig()
BridgeContextPortletConfig.
getPortletConfig in class BridgeContextpublic PortletContainer getPortletContainer()
BridgeContextPortletContainer associated with the current request.
getPortletContainer in class BridgeContextpublic javax.portlet.PortletContext getPortletContext()
BridgeContextPortletContext associated with the current portlet.
getPortletContext in class BridgeContextpublic javax.portlet.PortletRequest getPortletRequest()
BridgeContextPortletRequest associated with the current request.
getPortletRequest in class BridgeContextpublic void setPortletRequest(javax.portlet.PortletRequest portletRequest)
BridgeContextPortletRequest associated with the current request.
setPortletRequest in class BridgeContextpublic Bridge.PortletPhase getPortletRequestPhase()
BridgeContextBridge.PortletPhase associated with the current portlet lifecycle phase.
getPortletRequestPhase in class BridgeContextpublic javax.portlet.PortletResponse getPortletResponse()
BridgeContextPortletResponse associated with the current response.
getPortletResponse in class BridgeContextpublic void setPortletResponse(javax.portlet.PortletResponse portletResponse)
BridgeContextPortletResponse associated with the current response.
setPortletResponse in class BridgeContextpublic List<String> getPreFacesRequestAttrNames()
BridgeContext
getPreFacesRequestAttrNames in class BridgeContextpublic void setPreFacesRequestAttrNames(List<String> preFacesRequestAttrNames)
public Map<String,String[]> getPreservedActionParams()
BridgeContextMap of preserved action parameters.
getPreservedActionParams in class BridgeContextpublic void setPreservedActionParams(Map<String,String[]> preservedActionParams)
public void setProcessingAfterViewContent(boolean processingAfterViewContent)
BridgeContextBridge.AFTER_VIEW_CONTENT.
setProcessingAfterViewContent in class BridgeContextprocessingAfterViewContent - true if processing, otherwise false.public void setRenderRedirectAfterDispatch(boolean renderRedirectAfterDispatch)
BridgeContext
setRenderRedirectAfterDispatch in class BridgeContextpublic BridgeRedirectURL getRenderRedirectURL()
BridgeContext
getRenderRedirectURL in class BridgeContextpublic void setRenderRedirectURL(BridgeRedirectURL renderRedirectURL)
BridgeContext
setRenderRedirectURL in class BridgeContextpublic Map<String,String> getRequestHeaderMap()
getRequestHeaderMap in class BridgeContextpublic Map<String,String[]> getRequestHeaderValuesMap()
getRequestHeaderValuesMap in class BridgeContextpublic Map<String,String> getRequestParameterMap()
getRequestParameterMap in class BridgeContextprotected RequestParameterMapFactory getRequestParameterMapFactory()
public Map<String,String[]> getRequestParameterValuesMap()
getRequestParameterValuesMap in class BridgeContextpublic String getRequestPathInfo()
BridgeContext
getRequestPathInfo in class BridgeContextpublic String getRequestServletPath()
BridgeContext
getRequestServletPath in class BridgeContextpublic String getResponseNamespace()
getResponseNamespace in class BridgeContext
public Writer getResponseOutputWriter()
throws IOException
BridgeContextWriter that is meant to be used as a return value for ExternalContext.getResponseOutputWriter().
getResponseOutputWriter in class BridgeContextIOExceptionpublic boolean isPreserveActionParams()
BridgeContext
isPreserveActionParams in class BridgeContexttrue if the "javax.portlet.faces.preserveActionParams" init-param has a value of true,
otherwise false.public String getSavedViewState()
BridgeContext
getSavedViewState in class BridgeContextpublic void setSavedViewState(String savedViewState)
BridgeContext
setSavedViewState in class BridgeContextsavedViewState - The saved view state.public boolean isProcessingAfterViewContent()
BridgeContextBridge.AFTER_VIEW_CONTENT.
isProcessingAfterViewContent in class BridgeContexttrue if processing, otherwise falsepublic boolean isRenderRedirect()
BridgeContext
isRenderRedirect in class BridgeContext
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||