org.pentaho.platform.api.engine
Interface IOutputHandler

All Known Implementing Classes:
CoreContentRepositoryOutputHandler, HttpOutputHandler, SimpleOutputHandler

public interface IOutputHandler

An OutputHandler manages the content generated from a Component execution. Output can take the form of the generated results from a component, or content that solicits additional information from the requester. The handler also manages the relationship with the ActionDefinition and output content validation.


Field Summary
static String CONTENT
           
static String FILE
           
static int OUTPUT_TYPE_CONTENT
           
static int OUTPUT_TYPE_DEFAULT
           
static int OUTPUT_TYPE_PARAMETERS
           
static String RESPONSE
           
 
Method Summary
 boolean allowFeedback()
          Determines whether this output handler can send feedback ContentItems or not.
 boolean contentDone()
          Deprecated. This method could never tell you if the content was actually done. Use isResponseExpected() if you need information about a handlers likelihood to generate a response.
 IContentItem getFeedbackContentItem()
          Retrieve the ContentItem that describes the request interface for additional or missing information (missing from the original request)
 IMimeTypeListener getMimeTypeListener()
           
 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.
 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.
 void setContentItem(IContentItem content, String objectName, String contentName)
          Sets the output ContentItem for this handler.
 void setMimeTypeListener(IMimeTypeListener mimeTypeListener)
           
 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 setRuntimeContext(IRuntimeContext runtimeContext)
           
 void setSession(IPentahoSession session)
           
 

Field Detail

OUTPUT_TYPE_PARAMETERS

static final int OUTPUT_TYPE_PARAMETERS
See Also:
Constant Field Values

OUTPUT_TYPE_CONTENT

static final int OUTPUT_TYPE_CONTENT
See Also:
Constant Field Values

OUTPUT_TYPE_DEFAULT

static final int OUTPUT_TYPE_DEFAULT
See Also:
Constant Field Values

RESPONSE

static final String RESPONSE
See Also:
Constant Field Values

CONTENT

static final String CONTENT
See Also:
Constant Field Values

FILE

static final String FILE
See Also:
Constant Field Values
Method Detail

getOutputDefs

Map getOutputDefs()
Returns a map of the valid output parameter definitions for this request.

Returns:
Map of parameters in name-value or name-list form

setSession

void setSession(IPentahoSession session)

getSession

IPentahoSession getSession()

contentDone

boolean contentDone()
Deprecated. This method could never tell you if the content was actually done. Use isResponseExpected() if you need information about a handlers likelihood to generate a response.


isResponseExpected

boolean isResponseExpected()
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.

Returns:
true if the handler gave something the opportunity to write data to the its response output stream

getOutputDef

IOutputDef getOutputDef(String name)
Retrieve a single output parameter definition by name

Parameters:
name - name of the output parameter definition requested
Returns:
IOutputDef, output definition object

getFeedbackContentItem

IContentItem getFeedbackContentItem()
Retrieve the ContentItem that describes the request interface for additional or missing information (missing from the original request)

Returns:
ContentItem describing user feedback

getOutputContentItem

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.

Parameters:
objectName - Name of the object
contentName - Name of the content
Returns:
ContentItem describing end result output

getOutputContentItem

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.

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

allowFeedback

boolean allowFeedback()
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.

Returns:
true if feedback is allowed, false otherwise

setContentItem

void setContentItem(IContentItem content,
                    String objectName,
                    String contentName)
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'

Parameters:
content - ContentItem to set
objectName - Name of the object
contentName - Name of the content

setOutputPreference

void setOutputPreference(int outputType)
Sets the output type that is wanted by the handler. Valid values are OUTPUT_TYPE_PARAMETERS, OUTPUT_TYPE_CONTENT, OUTPUT_TYPE_DEFAULT

Parameters:
outputType - Output type requested

getOutputPreference

int getOutputPreference()
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

Returns:
Output type

setOutput

void setOutput(String name,
               Object value)
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.

Parameters:
name - Name of the output
value - Value of the output

getMimeTypeListener

IMimeTypeListener getMimeTypeListener()

setMimeTypeListener

void setMimeTypeListener(IMimeTypeListener mimeTypeListener)

setRuntimeContext

void setRuntimeContext(IRuntimeContext runtimeContext)