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(HttpServletResponse response, OutputStream outputStream, boolean allowFeedback)
           
 
Method Summary
 boolean allowFeedback()
          Determines whether this output handler can send feedback ContentItems or not.
 boolean contentDone()
           
 IContentItem getFeedbackContentItem()
          Retrieve the ContentItem that describes the request interface for additional or missing information (missing from the original request)
 IMimeTypeListener getMimeTypeListener()
           
 IContentItem getOutputContent()
           
 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.
 HttpServletResponse getResponse()
           
 IPentahoSession getSession()
           
 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 setOutputContent(IContentItem outputContent)
           
 void setOutputPreference(int outputType)
          Sets the output type that is wanted by the handler.
 void setResponse(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(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

public boolean contentDone()
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()

setOutputContent

public void setOutputContent(IContentItem outputContent)

getResponse

public HttpServletResponse getResponse()

setResponse

public void setResponse(HttpServletResponse response)

setRuntimeContext

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