org.pentaho.platform.web.http
Class HttpOutputHandler

java.lang.Object
  extended by org.pentaho.platform.web.http.HttpOutputHandler
All Implemented Interfaces:
IMimeTypeListener, IOutputHandler

public class HttpOutputHandler
extends Object
implements IOutputHandler, IMimeTypeListener


Field Summary
 
Fields inherited from interface org.pentaho.platform.api.engine.IOutputHandler
CONTENT, FILE, OUTPUT_TYPE_CONTENT, OUTPUT_TYPE_DEFAULT, OUTPUT_TYPE_PARAMETERS, RESPONSE
 
Constructor Summary
HttpOutputHandler(javax.servlet.http.HttpServletResponse response, OutputStream outputStream, boolean allowFeedback)
           
 
Method Summary
 boolean allowFeedback()
          Determines whether this output handler can send feedback ContentItems or not.
 boolean contentDone()
          Deprecated. 
 IContentItem getFeedbackContentItem()
          Retrieve the ContentItem that describes the request interface for additional or missing information (missing from the original request)
 IMimeTypeListener getMimeTypeListener()
           
 IContentItem getOutputContent()
          Deprecated. use getOutputContentItem(String, String, String, String, String)
 IContentItem getOutputContentItem(String objectName, String contentName, String solution, String instanceId, String mimeType)
          Retrieve the ContentItem that describes the output from this request's component execution.
 IContentItem getOutputContentItem(String objectName, String contentName, String title, String url, String solution, String instanceId, String mimeType)
          Retrieve the ContentItem that describes the output from this request's component execution.
 IOutputDef getOutputDef(String name)
          Retrieve a single output parameter definition by name
 Map getOutputDefs()
          Returns a map of the valid output parameter definitions for this request.
 int getOutputPreference()
          Gets the output type prefered by the handler.
 javax.servlet.http.HttpServletResponse getResponse()
           
 IPentahoSession getSession()
           
 boolean isResponseExpected()
          Indicates whether or not the handler is expected to have data written to a response output stream managed by the handler.
 boolean isWritable()
           
 void setContentItem(IContentItem content, String objectName, String contentName)
          Sets the output ContentItem for this handler.
 void setMimeType(String mimeType)
           
 void setMimeTypeListener(IMimeTypeListener mimeTypeListener)
           
 void setName(String name)
           
 void setOutput(String name, Object value)
          Sets an output of the handler.
 void setOutputPreference(int outputType)
          Sets the output type that is wanted by the handler.
 void setResponse(javax.servlet.http.HttpServletResponse response)
           
 void setRuntimeContext(IRuntimeContext runtimeContext)
           
 void setSession(IPentahoSession session)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpOutputHandler

public HttpOutputHandler(javax.servlet.http.HttpServletResponse response,
                         OutputStream outputStream,
                         boolean allowFeedback)
Method Detail

setSession

public void setSession(IPentahoSession session)
Specified by:
setSession in interface IOutputHandler

getSession

public IPentahoSession getSession()
Specified by:
getSession in interface IOutputHandler

setOutputPreference

public void setOutputPreference(int outputType)
Description copied from interface: IOutputHandler
Sets the output type that is wanted by the handler. Valid values are OUTPUT_TYPE_PARAMETERS, OUTPUT_TYPE_CONTENT, OUTPUT_TYPE_DEFAULT

Specified by:
setOutputPreference in interface IOutputHandler
Parameters:
outputType - Output type requested

getOutputPreference

public int getOutputPreference()
Description copied from interface: IOutputHandler
Gets the output type prefered by the handler. Values are defined in org.pentaho.platform.api.engine.IOutputHandler and are OUTPUT_TYPE_PARAMETERS, OUTPUT_TYPE_CONTENT, or OUTPUT_TYPE_DEFAULT

Specified by:
getOutputPreference in interface IOutputHandler
Returns:
Output type

setMimeType

public void setMimeType(String mimeType)
Specified by:
setMimeType in interface IMimeTypeListener

setName

public void setName(String name)
Specified by:
setName in interface IMimeTypeListener

contentDone

@Deprecated
public boolean contentDone()
Deprecated. 

Specified by:
contentDone in interface IOutputHandler

allowFeedback

public boolean allowFeedback()
Description copied from interface: IOutputHandler
Determines whether this output handler can send feedback ContentItems or not.

Generally, if there is no client on the other side of the request that could receive and process feedback, then this boolean should be setto false.

Specified by:
allowFeedback in interface IOutputHandler
Returns:
true if feedback is allowed, false otherwise

getOutputDefs

public Map getOutputDefs()
Description copied from interface: IOutputHandler
Returns a map of the valid output parameter definitions for this request.

Specified by:
getOutputDefs in interface IOutputHandler
Returns:
Map of parameters in name-value or name-list form

getOutputDef

public IOutputDef getOutputDef(String name)
Description copied from interface: IOutputHandler
Retrieve a single output parameter definition by name

Specified by:
getOutputDef in interface IOutputHandler
Parameters:
name - name of the output parameter definition requested
Returns:
IOutputDef, output definition object

getFeedbackContentItem

public IContentItem getFeedbackContentItem()
Description copied from interface: IOutputHandler
Retrieve the ContentItem that describes the request interface for additional or missing information (missing from the original request)

Specified by:
getFeedbackContentItem in interface IOutputHandler
Returns:
ContentItem describing user feedback

getOutputContentItem

public IContentItem getOutputContentItem(String objectName,
                                         String contentName,
                                         String solution,
                                         String instanceId,
                                         String mimeType)
Description copied from interface: IOutputHandler
Retrieve the ContentItem that describes the output from this request's component execution.

Specified by:
getOutputContentItem in interface IOutputHandler
Parameters:
objectName - Name of the object
contentName - Name of the content
Returns:
ContentItem describing end result output

getOutputContentItem

public IContentItem getOutputContentItem(String objectName,
                                         String contentName,
                                         String title,
                                         String url,
                                         String solution,
                                         String instanceId,
                                         String mimeType)
Description copied from interface: IOutputHandler
Retrieve the ContentItem that describes the output from this request's component execution.

Specified by:
getOutputContentItem in interface IOutputHandler
Parameters:
objectName - Name of the object
contentName - Name of the content
title - Title of the object
url - URL to view the object
Returns:
ContentItem describing end result output

setContentItem

public void setContentItem(IContentItem content,
                           String objectName,
                           String contentName)
Description copied from interface: IOutputHandler
Sets the output ContentItem for this handler. objectName will be the name of the destination node from the action sequence output contentName will be the value of the destination node from the action sequence output e.g. if the outputs section in the ation sequence looks like this: content objectName should be 'response' contentName should be 'content'

Specified by:
setContentItem in interface IOutputHandler
Parameters:
content - ContentItem to set
objectName - Name of the object
contentName - Name of the content

setOutput

public void setOutput(String name,
                      Object value)
Description copied from interface: IOutputHandler
Sets an output of the handler. For example the HTTP handler will accept output names of 'header' allowing an HTTP header to be set, and 'redirect' allowing the responses sendRedirect to be called.

Specified by:
setOutput in interface IOutputHandler
Parameters:
name - Name of the output
value - Value of the output

getMimeTypeListener

public IMimeTypeListener getMimeTypeListener()
Specified by:
getMimeTypeListener in interface IOutputHandler

setMimeTypeListener

public void setMimeTypeListener(IMimeTypeListener mimeTypeListener)
Specified by:
setMimeTypeListener in interface IOutputHandler

getOutputContent

public IContentItem getOutputContent()
Deprecated. use getOutputContentItem(String, String, String, String, String)


getResponse

public javax.servlet.http.HttpServletResponse getResponse()

setResponse

public void setResponse(javax.servlet.http.HttpServletResponse response)

isResponseExpected

public boolean isResponseExpected()
Description copied from interface: IOutputHandler
Indicates whether or not the handler is expected to have data written to a response output stream managed by the handler. Typically, a handler will want to return true here if its getOutputContentItem or setOutput methods have been invoked and their invocations can result in a write to the response output stream that is managed by the handler. In general, handlers are responsible for setting this flag any time a client response is possible.

Specified by:
isResponseExpected in interface IOutputHandler
Returns:
true if the handler gave something the opportunity to write data to the its response output stream

setRuntimeContext

public void setRuntimeContext(IRuntimeContext runtimeContext)
Specified by:
setRuntimeContext in interface IOutputHandler

isWritable

public boolean isWritable()