org.pentaho.platform.repository.content
Class CoreContentRepositoryOutputHandler

java.lang.Object
  extended by org.pentaho.platform.repository.content.CoreContentRepositoryOutputHandler
All Implemented Interfaces:
IOutputHandler

public class CoreContentRepositoryOutputHandler
extends Object
implements IOutputHandler


Field Summary
static String BackgroundFolder
           
static String ContentRepoObjectName
           
static String DefaultExtension
           
static String DefaultMimeType
           
static String FileObjectName
           
 
Fields inherited from interface org.pentaho.platform.api.engine.IOutputHandler
CONTENT, FILE, OUTPUT_TYPE_CONTENT, OUTPUT_TYPE_DEFAULT, OUTPUT_TYPE_PARAMETERS, RESPONSE
 
Constructor Summary
CoreContentRepositoryOutputHandler(String location, String contentGUID, String solution, IPentahoSession session)
           
CoreContentRepositoryOutputHandler(String location, String contentGUID, String solution, String mimeType, String extension, IPentahoSession session)
           
 
Method Summary
 boolean allowFeedback()
          Determines whether this output handler can send feedback ContentItems or not.
 boolean contentDone()
           
 String getExtension()
           
 IContentItem getFeedbackContentItem()
          Retrieve the ContentItem that describes the request interface for additional or missing information (missing from the original request)
 org.apache.commons.logging.Log getLogger()
           
 String getMimeType()
           
 IMimeTypeListener getMimeTypeListener()
           
 IContentItem getOutputContentItem(String objectName, String contentName, String solution, String instanceId, String inMimeType)
          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 inMimeType)
          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()
           
 int getWriteMode()
           
 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 setExtension(String value)
           
 void setMimeType(String value)
           
 void setMimeTypeListener(IMimeTypeListener mimeTypeListener)
           
 void setOutput(String name, Object value)
          Sets an output of the handler.
 void setOutputPreference(int value)
          Sets the output type that is wanted by the handler.
 void setRuntimeContext(IRuntimeContext runtimeContext)
           
 void setSession(IPentahoSession session)
           
 void setWriteMode(int value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DefaultMimeType

public static final String DefaultMimeType
See Also:
Constant Field Values

BackgroundFolder

public static final String BackgroundFolder
See Also:
Constant Field Values

DefaultExtension

public static final String DefaultExtension
See Also:
Constant Field Values

FileObjectName

public static final String FileObjectName
See Also:
Constant Field Values

ContentRepoObjectName

public static final String ContentRepoObjectName
See Also:
Constant Field Values
Constructor Detail

CoreContentRepositoryOutputHandler

public CoreContentRepositoryOutputHandler(String location,
                                          String contentGUID,
                                          String solution,
                                          IPentahoSession session)

CoreContentRepositoryOutputHandler

public CoreContentRepositoryOutputHandler(String location,
                                          String contentGUID,
                                          String solution,
                                          String mimeType,
                                          String extension,
                                          IPentahoSession session)
Method Detail

setSession

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

getSession

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

setMimeType

public void setMimeType(String value)

setExtension

public void setExtension(String value)

getMimeType

public String getMimeType()

getExtension

public String getExtension()

setWriteMode

public void setWriteMode(int value)

getWriteMode

public int getWriteMode()

getLogger

public org.apache.commons.logging.Log getLogger()

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

contentDone

public boolean contentDone()
Specified by:
contentDone in interface IOutputHandler

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 inMimeType)
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 inMimeType)
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

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

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

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

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

setOutputPreference

public void setOutputPreference(int value)
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:
value - Output type requested

getMimeTypeListener

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

setMimeTypeListener

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

setRuntimeContext

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

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