Package org.pentaho.platform.api.engine
Interface IOutputHandler
-
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
Fields Modifier and Type Field Description 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
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description 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.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 instanceId, String mimeType)
Retrieve the ContentItem that describes the output from this request's component execution.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
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
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
-
setSession
void setSession(IPentahoSession session)
-
getSession
IPentahoSession getSession()
-
contentDone
@Deprecated boolean contentDone()
Deprecated.This method could never tell you if the content was actually done. UseisResponseExpected()
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
-
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 instanceId, String mimeType)
Retrieve the ContentItem that describes the output from this request's component execution.- Parameters:
objectName
- Name of the objectcontentName
- Name of the content- 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
-
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) throws IOException
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 outputvalue
- Value of the output- Throws:
IOException
-
getMimeTypeListener
IMimeTypeListener getMimeTypeListener()
-
setMimeTypeListener
void setMimeTypeListener(IMimeTypeListener mimeTypeListener)
-
-