|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.liferay.faces.bridge.context.BridgeContext
public abstract class BridgeContext
This is an abstract class modeled after the JSF FacesContext in that it encapsulates a ThreadLocal
singleton instance. The instance contains contextual information related to the bridge.
| Constructor Summary | |
|---|---|
BridgeContext()
|
|
| Method Summary | |
|---|---|
abstract void |
dispatch(String path)
Creates a PortletRequestDispatcher for the specified path and issues a forward/include as
appropriate. |
abstract 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. |
abstract BridgePartialActionURL |
encodePartialActionURL(String url)
Encodes a bridge "partial action" URL, meaning a URL that is intended to be used for Ajax (partial request) processing. |
abstract 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. |
abstract 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. |
abstract Map<String,Object> |
getAttributes()
Returns the attribute map associated with this context. |
abstract BridgeConfig |
getBridgeConfig()
Convenience method that returns the BridgeConfig for this context. |
abstract BridgeRequestScope |
getBridgeRequestScope()
Convenience method that returns the BridgeRequestScope for this context. |
static BridgeContext |
getCurrentInstance()
|
abstract String |
getDefaultRenderKitId()
Returns the default Render Kit ID, which is optionally specified by developers with the in the WEB-INF/portlet.xml descriptor. |
abstract 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. |
abstract 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". |
abstract 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. |
abstract 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. |
abstract 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. |
abstract IncongruityContext |
getIncongruityContext()
|
abstract String |
getInitParameter(String name)
NOTE: PROPOSE-FOR-BRIDGE3-API Returns the value of the specified initialization parameter. |
abstract javax.portlet.PortletConfig |
getPortletConfig()
Return the current PortletConfig. |
abstract PortletContainer |
getPortletContainer()
Returns the PortletContainer associated with the current request. |
abstract javax.portlet.PortletContext |
getPortletContext()
Returns the PortletContext associated with the current portlet. |
abstract javax.portlet.PortletRequest |
getPortletRequest()
Returns the PortletRequest associated with the current request. |
abstract Bridge.PortletPhase |
getPortletRequestPhase()
Returns the Bridge.PortletPhase associated with the current portlet lifecycle phase. |
abstract javax.portlet.PortletResponse |
getPortletResponse()
Returns the PortletResponse associated with the current response. |
abstract List<String> |
getPreFacesRequestAttrNames()
Returns a list of attribute names that existed prior to the FacesContext being created. |
abstract Map<String,String[]> |
getPreservedActionParams()
Returns the Map of preserved action parameters. |
abstract BridgeRedirectURL |
getRenderRedirectURL()
Gets the render-redirect URL that was set during a render-redirect. |
abstract Map<String,String> |
getRequestHeaderMap()
|
abstract Map<String,String[]> |
getRequestHeaderValuesMap()
|
abstract Map<String,String> |
getRequestParameterMap()
|
abstract Map<String,String[]> |
getRequestParameterValuesMap()
|
abstract String |
getRequestPathInfo()
Returns the pathInfo associated with the current viewId. |
abstract String |
getRequestServletPath()
Returns the servletPath associated with the current viewId. |
abstract String |
getResponseNamespace()
|
abstract Writer |
getResponseOutputWriter()
Returns a Writer that is meant to be used as a return value for ExternalContext.getResponseOutputWriter(). |
abstract String |
getSavedViewState()
Returns the saved view state. |
abstract boolean |
isBridgeRequestScopePreserved()
Returns the flag indicating whether or not the current BridgeRequestScope is preserved at the end of the
RenderRequest. |
abstract boolean |
isPreserveActionParams()
Determines whether or not the "javax.portlet.faces.preserveActionParams" init-param has been configured in the WEB-INF/portlet.xml descriptor. |
abstract boolean |
isProcessingAfterViewContent()
Flag indicating whether or not the bridge is processing Bridge.AFTER_VIEW_CONTENT. |
abstract boolean |
isRenderRedirect()
Returns the flag indicating whether or not a render redirect occurred. |
abstract boolean |
isRenderRedirectAfterDispatch()
Returns a flag indicating whether or not a render-redirect has occurred after dispatching to a JSP. |
abstract 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. |
abstract void |
release()
Performs any necessary cleanup. |
static void |
setCurrentInstance(BridgeContext bridgeContext)
|
abstract void |
setPortletRequest(javax.portlet.PortletRequest portletRequest)
Preserves the PortletRequest associated with the current request. |
abstract void |
setPortletResponse(javax.portlet.PortletResponse portletResponse)
Preserves the PortletResponse associated with the current response. |
abstract void |
setProcessingAfterViewContent(boolean processingAfterViewContent)
Sets the flag indicating whether or not the bridge is processing Bridge.AFTER_VIEW_CONTENT. |
abstract void |
setRenderRedirectAfterDispatch(boolean renderRedirectAfterDispatch)
Sets a flag indicating whether or not a render-redirect has occurred after dispatching to a JSP. |
abstract void |
setRenderRedirectURL(BridgeRedirectURL renderRedirectURL)
Sets the render-redirect URL that is associated with a render-redirect. |
abstract void |
setSavedViewState(String savedViewState)
Preserves the saved view state. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BridgeContext()
| Method Detail |
|---|
public static BridgeContext getCurrentInstance()
public static void setCurrentInstance(BridgeContext bridgeContext)
public abstract void dispatch(String path)
throws IOException
PortletRequestDispatcher for the specified path and issues a forward/include as
appropriate.
IOExceptionpublic abstract BridgeActionURL encodeActionURL(String url)
ExternalContext.encodeActionURL(String) listed in Section 6.1.3.1 of the Bridge Spec.
url - The URL to be encoded.
BrideActionURL that conforms to the proper encoding.public abstract BridgePartialActionURL encodePartialActionURL(String url)
ExternalContext.encodePartialActionURL(String) was added in JSF 2.0 which means
there are no Bridge Spec deviation requirements yet.
url - The URL to be encoded.
BridgePartialActionURL that conforms to the proper encoding.
public abstract BridgeRedirectURL encodeRedirectURL(String baseUrl,
Map<String,List<String>> parameters)
ExternalContext.redirect(String) listed in Section 6.1.3.1 of the Bridge Spec.
baseUrl - 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 abstract BridgeResourceURL encodeResourceURL(String url)
ExternalContext.encodeResourceURL(String) listed in Section 6.1.3.1 of the Bridge Spec.
url - The URL to be encoded.
BridgeResourceURL that conforms to the proper encoding.
public abstract void redirect(String url)
throws IOException
url 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.
IOExceptionpublic abstract void release()
public abstract Map<String,Object> getAttributes()
public abstract BridgeConfig getBridgeConfig()
BridgeConfig for this context.
public abstract BridgeRequestScope getBridgeRequestScope()
BridgeRequestScope for this context.
public abstract boolean isBridgeRequestScopePreserved()
BridgeRequestScope is preserved at the end of the
RenderRequest.
true 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 abstract String getDefaultRenderKitId()
public abstract 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.
<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>
public abstract String getFacesViewId()
throws BridgeDefaultViewNotSpecifiedException,
BridgeInvalidViewPathException
{@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 abstract String getFacesViewIdFromPath(String viewPath)
viewPath by examining the servlet-mapping entries
from the WEB-INF/web.xml descriptor.
viewPath - The path to the view.
viewPath (providing that the view physically
exists). Otherwise returns null.
public abstract String getFacesViewIdFromPath(String viewPath,
boolean mustExist)
viewPath by examining the servlet-mapping entries
from the WEB-INF/web.xml descriptor.
viewPath - 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 abstract String getFacesViewQueryString()
Bridge.VIEW_ID request attribute.
public abstract boolean isRenderRedirectAfterDispatch()
true if a render-redirect has occurred after dispatching to a JSP, otherwise
false.public abstract IncongruityContext getIncongruityContext()
public abstract String getInitParameter(String name)
PortletConfig.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.
public abstract javax.portlet.PortletConfig getPortletConfig()
PortletConfig.
public abstract PortletContainer getPortletContainer()
PortletContainer associated with the current request.
public abstract javax.portlet.PortletContext getPortletContext()
PortletContext associated with the current portlet.
public abstract javax.portlet.PortletRequest getPortletRequest()
PortletRequest associated with the current request.
public abstract void setPortletRequest(javax.portlet.PortletRequest portletRequest)
PortletRequest associated with the current request.
public abstract Bridge.PortletPhase getPortletRequestPhase()
Bridge.PortletPhase associated with the current portlet lifecycle phase.
public abstract javax.portlet.PortletResponse getPortletResponse()
PortletResponse associated with the current response.
public abstract void setPortletResponse(javax.portlet.PortletResponse portletResponse)
PortletResponse associated with the current response.
public abstract List<String> getPreFacesRequestAttrNames()
public abstract Map<String,String[]> getPreservedActionParams()
Map of preserved action parameters.
public abstract void setProcessingAfterViewContent(boolean processingAfterViewContent)
Bridge.AFTER_VIEW_CONTENT.
processingAfterViewContent - true if processing, otherwise false.public abstract void setRenderRedirectAfterDispatch(boolean renderRedirectAfterDispatch)
public abstract BridgeRedirectURL getRenderRedirectURL()
public abstract void setRenderRedirectURL(BridgeRedirectURL renderRedirectURL)
public abstract Map<String,String> getRequestHeaderMap()
public abstract Map<String,String[]> getRequestHeaderValuesMap()
public abstract Map<String,String> getRequestParameterMap()
public abstract Map<String,String[]> getRequestParameterValuesMap()
public abstract String getRequestPathInfo()
public abstract String getRequestServletPath()
public abstract String getResponseNamespace()
public abstract Writer getResponseOutputWriter()
throws IOException
Writer that is meant to be used as a return value for ExternalContext.getResponseOutputWriter().
IOExceptionpublic abstract boolean isPreserveActionParams()
true if the "javax.portlet.faces.preserveActionParams" init-param has a value of true,
otherwise false.public abstract String getSavedViewState()
public abstract void setSavedViewState(String savedViewState)
savedViewState - The saved view state.public abstract boolean isProcessingAfterViewContent()
Bridge.AFTER_VIEW_CONTENT.
true if processing, otherwise falsepublic abstract boolean isRenderRedirect()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||