com.liferay.faces.bridge.container
Interface PortletContainer

All Superinterfaces:
EventListener, javax.faces.event.PhaseListener, Serializable
All Known Implementing Classes:
PortletContainerCompatImpl, PortletContainerImpl, PortletContainerLiferayCompatImpl, PortletContainerLiferayImpl, PortletContainerPlutoImpl

public interface PortletContainer
extends javax.faces.event.PhaseListener

Author:
Neil Griffin

Method Summary
 javax.portlet.PortletURL createActionURL(String fromURL)
          Creates a portlet action URL and copies query parameters that might be present in the specified URL.
 javax.portlet.ResourceURL createPartialActionURL(String fromURL)
          Creates a portlet resource URL that is suitable for partial requests (Ajax).
 javax.portlet.PortletURL createRedirectURL(String fromURL, Map<String,List<String>> parameters)
          Creates a portlet redirect URL and copies query parameters that might be present in the specified URL.
 javax.portlet.PortletURL createRenderURL(String fromURL)
          Creates a portlet render URL and copies query parameters that might be present in the specified URL.
 javax.portlet.ResourceURL createResourceURL(String fromURL)
          Creates a portlet resource URL and copies the javax.faces.resource value and query parameters that might be present in the specified URL.
 String fixRequestParameterValue(String value)
          This method provides the portlet conainer with an opportunity to fix/correct/massage the specified request parameter value.
 String[] getHeader(String name)
          Returns the value of the header with the specified name from the underlying HttpServletRequest.
 javax.faces.context.ResponseWriter getHeadResponseWriter(javax.faces.context.ResponseWriter wrappableResponseWriter)
           
 long getHttpServletRequestDateHeader(String name)
          Returns the value of the specified header name from the HttpServletRequest that is wrapped by the current PortletRequest.
 String getRequestParameter(String name)
          This is a convenience method that gets the specified request parameter value.
 String[] getRequestParameterValues(String name)
          This is a convenience method that gets the specified request parameter values.
 String getRequestQueryString()
          Gets the query string part of the URL requested by the user-agent (browser) by getting the attribute named "javax.servlet.forward.query_string" from the request.
 String getRequestURL()
          Returns the URL requested by the user-agent (browser).
 String getResponseNamespace()
          Returns the response namespace.
 boolean isAbleToAddScriptResourceToHead()
          Determines whether or not the portlet container has the ability (standard or vendor-specific) to add <script src=".." /> resource to the <head>...</head> section of the rendered portal page.
 boolean isAbleToAddScriptTextToHead()
          Determines whether or not the portlet container has the ability (standard or vendor-specific) to add <script> text to the <head>...</head> section of the rendered portal page.
 boolean isAbleToAddStyleSheetResourceToHead()
          Determines whether or not the portlet container has the ability (standard or vendor-specific) to add stylesheet <link> tags to the <head>...</head> section of the rendered portal page.
 boolean isAbleToForwardOnDispatch()
          Determines whether or not the portlet container has the ability to issue a forward when a dispatch occurs.
 boolean isAbleToSetHttpStatusCode()
          Determines whether or not the portlet container has the ability to support the Portlet 2.0 standard mechanism of setting the ResourceResponse.HTTP_STATUS_CODE property on the ResourceResponse.
 boolean isAbleToSetResourceResponseBufferSize()
          Determines whether or not the portlet container has the ability to set the buffer size on its javax.portlet.ResourceResponse implementation.
 boolean isNamespacedParameters()
          Determines whether or not the portlet container requires parameters to be namespaced.
 boolean isPostRedirectGetSupported()
          Flag indicating whether or not the portlet container supports/implements the POST-REDIRECT-GET design pattern, meaning that the ACTION_PHASE originates from an HTTP POST request, and the RENDER_PHASE is a subsequent HTTP GET request.
 void maintainRenderParameters(javax.portlet.EventRequest eventRequest, javax.portlet.EventResponse eventResponse)
          Maintains (copies) the render parameters found in the specified EventRequest to the specified EventResponse.
 void redirect(String url)
          Delegates to the underlying ActionResponse to perform a redirect to the specified URL.
 void setMimeResponseContentType(javax.portlet.MimeResponse mimeResponse, String contentType)
          Layer of abstraction over the MimeResponse.setContentType(String) method.
 
Methods inherited from interface javax.faces.event.PhaseListener
afterPhase, beforePhase, getPhaseId
 

Method Detail

createActionURL

javax.portlet.PortletURL createActionURL(String fromURL)
                                         throws MalformedURLException
Creates a portlet action URL and copies query parameters that might be present in the specified URL.

Parameters:
fromURL - The URL to copy from.
Returns:
The resulting portlet action URL.
Throws:
MalformedURLException

createPartialActionURL

javax.portlet.ResourceURL createPartialActionURL(String fromURL)
                                                 throws MalformedURLException
Creates a portlet resource URL that is suitable for partial requests (Ajax).

Parameters:
fromURL - The URL to copy from.
Returns:
The resulting partial action resource URL.
Throws:
MalformedURLException

createRedirectURL

javax.portlet.PortletURL createRedirectURL(String fromURL,
                                           Map<String,List<String>> parameters)
                                           throws MalformedURLException
Creates a portlet redirect URL and copies query parameters that might be present in the specified URL.

Parameters:
fromURL - The URL to copy from.
Returns:
The resulting portlet action URL.
Throws:
MalformedURLException

createRenderURL

javax.portlet.PortletURL createRenderURL(String fromURL)
                                         throws MalformedURLException
Creates a portlet render URL and copies query parameters that might be present in the specified URL.

Parameters:
fromURL - The URL to copy from.
Returns:
The resulting portlet action URL.
Throws:
MalformedURLException

createResourceURL

javax.portlet.ResourceURL createResourceURL(String fromURL)
                                            throws MalformedURLException
Creates a portlet resource URL and copies the javax.faces.resource value and query parameters that might be present in the specified URL.

Parameters:
fromURL - The URL to copy from. Example expected value: /portlet-context-path/*\/javax.faces.resource/jsf.js?ln=javax.faces
Returns:
The resulting portlet resource URL.
Throws:
MalformedURLException

fixRequestParameterValue

String fixRequestParameterValue(String value)
This method provides the portlet conainer with an opportunity to fix/correct/massage the specified request parameter value.

Parameters:
value - The request parameter value that needs to be fixed.
Returns:
The fixed value.

maintainRenderParameters

void maintainRenderParameters(javax.portlet.EventRequest eventRequest,
                              javax.portlet.EventResponse eventResponse)
Maintains (copies) the render parameters found in the specified EventRequest to the specified EventResponse.


redirect

void redirect(String url)
              throws IOException
Delegates to the underlying ActionResponse to perform a redirect to the specified URL.

Throws:
IOException

isAbleToAddScriptResourceToHead

boolean isAbleToAddScriptResourceToHead()
Determines whether or not the portlet container has the ability (standard or vendor-specific) to add <script src=".." /> resource to the <head>...</head> section of the rendered portal page.

Returns:
True if the portlet container supports it.

isAbleToAddScriptTextToHead

boolean isAbleToAddScriptTextToHead()
Determines whether or not the portlet container has the ability (standard or vendor-specific) to add <script> text to the <head>...</head> section of the rendered portal page.

Returns:
True if the portlet container supports it.

isAbleToAddStyleSheetResourceToHead

boolean isAbleToAddStyleSheetResourceToHead()
Determines whether or not the portlet container has the ability (standard or vendor-specific) to add stylesheet <link> tags to the <head>...</head> section of the rendered portal page.

Returns:
True if the portlet container supports it.

isPostRedirectGetSupported

boolean isPostRedirectGetSupported()
Flag indicating whether or not the portlet container supports/implements the POST-REDIRECT-GET design pattern, meaning that the ACTION_PHASE originates from an HTTP POST request, and the RENDER_PHASE is a subsequent HTTP GET request.

Returns:
true if the POST-REDIRECT-GET design pattern is supported, otherwise false.

isAbleToSetHttpStatusCode

boolean isAbleToSetHttpStatusCode()
Determines whether or not the portlet container has the ability to support the Portlet 2.0 standard mechanism of setting the ResourceResponse.HTTP_STATUS_CODE property on the ResourceResponse.


isAbleToSetResourceResponseBufferSize

boolean isAbleToSetResourceResponseBufferSize()
Determines whether or not the portlet container has the ability to set the buffer size on its javax.portlet.ResourceResponse implementation.

Returns:
True if the portlet container supports it.

isAbleToForwardOnDispatch

boolean isAbleToForwardOnDispatch()
Determines whether or not the portlet container has the ability to issue a forward when a dispatch occurs. If unable to forward, then an include must happen during the dispatch instead.

Returns:
true if able, otherwise false.

getHeader

String[] getHeader(String name)
Returns the value of the header with the specified name from the underlying HttpServletRequest.


getHeadResponseWriter

javax.faces.context.ResponseWriter getHeadResponseWriter(javax.faces.context.ResponseWriter wrappableResponseWriter)

getHttpServletRequestDateHeader

long getHttpServletRequestDateHeader(String name)
Returns the value of the specified header name from the HttpServletRequest that is wrapped by the current PortletRequest.


setMimeResponseContentType

void setMimeResponseContentType(javax.portlet.MimeResponse mimeResponse,
                                String contentType)
Layer of abstraction over the MimeResponse.setContentType(String) method.

Parameters:
contentType - The contentType that is to be set on the specified MimeResponse.

getRequestParameter

String getRequestParameter(String name)
This is a convenience method that gets the specified request parameter value. While this could normally be done by simply calling PortletRequest.getParameter(String), this method provides the portlet container abstraction layer with an opportunity to fix/correct/massage the parameter value as required. Therefore, any implementing class of this method must call the getRequestParameter(String) method before returning a value.

Parameters:
name - The request parameter name.
Returns:
The request parameter value.

getRequestParameterValues

String[] getRequestParameterValues(String name)
This is a convenience method that gets the specified request parameter values. While this could normally be done by simply calling PortletRequest.getParameterValues(String), this method provides the portlet container abstraction layer with an opportunity to fix/correct/massage the parameter values as required. Therefore, any implementing class of this method must call the getRequestParameter(String) method before returning a value.

Parameters:
name - The request parameter name.
Returns:
The request parameter value.

getRequestQueryString

String getRequestQueryString()
Gets the query string part of the URL requested by the user-agent (browser) by getting the attribute named "javax.servlet.forward.query_string" from the request.

Returns:
The query_string part of the URL requested by the user-agent (browser).

getRequestURL

String getRequestURL()
Returns the URL requested by the user-agent (browser).


getResponseNamespace

String getResponseNamespace()
Returns the response namespace.


isNamespacedParameters

boolean isNamespacedParameters()
Determines whether or not the portlet container requires parameters to be namespaced.

Returns:
True if the portlet container requires parameters to be namespaced. Otherwise, returns false.


Copyright © 2014 Liferay, Inc.. All Rights Reserved.