org.jboss.portal.portlet.test
Class PortletController.ActionContextImpl

java.lang.Object
  extended by org.jboss.portal.common.invocation.AbstractInvocationContext
      extended by org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext
          extended by org.jboss.portal.portlet.test.PortletController.PortletInvocationContextImpl
              extended by org.jboss.portal.portlet.test.PortletController.ActionContextImpl
All Implemented Interfaces:
InvocationContext, ActionContext, PortletInvocationContext
Enclosing class:
PortletController

protected class PortletController.ActionContextImpl
extends PortletController.PortletInvocationContextImpl
implements ActionContext


Field Summary
 
Fields inherited from class org.jboss.portal.portlet.test.PortletController.PortletInvocationContextImpl
invocation, portlet
 
Fields inherited from class org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext
markupInfo, mode, navigationalState, windowState
 
Constructor Summary
PortletController.ActionContextImpl(Portlet portlet, ServerInvocation invocation, StateString navigationalState, WindowState windowState, Mode mode, StateString interactionState, PortletParameters form)
           
 
Method Summary
 java.lang.String getCharacterEncoding()
          Returns the name of the character encoding used in the body of this request.
 int getContentLength()
          Returns the length, in bytes, of the request body which is made available by the input stream, or -1 if the length is not known.
 java.lang.String getContentType()
          Returns the MIME type of the body of the request, or null if the type is not known.
 PortletParameters getForm()
          Returns the form parameters of the request or null if no form could be decoded by the caller.
 java.io.InputStream getInputStream()
          Retrieves the body of the HTTP request from client to portal as binary data using an InputStream.
 StateString getInteractionState()
          Returns the interaction state of the request.
 java.io.BufferedReader getReader()
          Retrieves the body of the HTTP request from the client to the portal as character data using a BufferedReader.
 
Methods inherited from class org.jboss.portal.portlet.test.PortletController.PortletInvocationContextImpl
encodeResourceURL, getClientRequest, getClientResponse, renderURL
 
Methods inherited from class org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext
getMarkupInfo, getMode, getNavigationalState, getWindowState
 
Methods inherited from class org.jboss.portal.common.invocation.AbstractInvocationContext
addResolver, addResolver, getAttribute, getAttributeResolver, removeAttribute, setAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.portal.portlet.spi.PortletInvocationContext
encodeResourceURL, getMarkupInfo, getMode, getNavigationalState, getWindowState, renderURL
 
Methods inherited from interface org.jboss.portal.common.invocation.InvocationContext
getAttribute, getAttributeResolver, removeAttribute, setAttribute
 

Constructor Detail

PortletController.ActionContextImpl

public PortletController.ActionContextImpl(Portlet portlet,
                                           ServerInvocation invocation,
                                           StateString navigationalState,
                                           WindowState windowState,
                                           Mode mode,
                                           StateString interactionState,
                                           PortletParameters form)
Method Detail

getCharacterEncoding

public java.lang.String getCharacterEncoding()
Description copied from interface: ActionContext
Returns the name of the character encoding used in the body of this request. This method returns null if the request does not specify a character encoding.

Specified by:
getCharacterEncoding in interface ActionContext
Returns:
a String containing the name of the chararacter encoding, or null if the request does not specify a character encoding.

getReader

public java.io.BufferedReader getReader()
                                 throws java.io.IOException
Description copied from interface: ActionContext
Retrieves the body of the HTTP request from the client to the portal as character data using a BufferedReader. The reader translates the character data according to the character encoding used on the body. Either this method or ActionContext.getInputStream() may be called to read the body, not both.

For HTTP POST data of type application/x-www-form-urlencoded this method throws an IllegalStateException as this data has been already processed by the portal/portlet-container and is available as request parameters.

Specified by:
getReader in interface ActionContext
Returns:
a BufferedReader containing the body of the request
Throws:
java.io.UnsupportedEncodingException - if the character set encoding used is not supported and the text cannot be decoded
java.io.IOException - if an input or output exception occurred
See Also:
ActionContext.getInputStream()

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Description copied from interface: ActionContext
Retrieves the body of the HTTP request from client to portal as binary data using an InputStream. Either this method or ActionContext.getReader() may be called to read the body, but not both.

For HTTP POST data of type application/x-www-form-urlencoded this method throws an IllegalStateException as this data has been already processed by the portal/portlet-container and is available as request parameters.

Specified by:
getInputStream in interface ActionContext
Returns:
an input stream containing the body of the request
Throws:
java.io.IOException - if an input or output exception occurred

getContentLength

public int getContentLength()
Description copied from interface: ActionContext
Returns the length, in bytes, of the request body which is made available by the input stream, or -1 if the length is not known.

Specified by:
getContentLength in interface ActionContext
Returns:
an integer containing the length of the request body or -1 if the length is not known

getContentType

public java.lang.String getContentType()
Description copied from interface: ActionContext
Returns the MIME type of the body of the request, or null if the type is not known.

Specified by:
getContentType in interface ActionContext
Returns:
a String containing the name of the MIME type of the request, or null if the type is not known.

getInteractionState

public StateString getInteractionState()
Description copied from interface: ActionContext
Returns the interaction state of the request.

Specified by:
getInteractionState in interface ActionContext
Returns:
the interaction state

getForm

public PortletParameters getForm()
Description copied from interface: ActionContext
Returns the form parameters of the request or null if no form could be decoded by the caller.

Specified by:
getForm in interface ActionContext
Returns:
the request form