org.pentaho.platform.engine.services.runtime
Class RuntimeContext

java.lang.Object
  extended by org.pentaho.platform.engine.core.system.PentahoBase
      extended by org.pentaho.platform.engine.services.PentahoMessenger
          extended by org.pentaho.platform.engine.services.runtime.RuntimeContext
All Implemented Interfaces:
Serializable, IAuditable, ILogger, IRuntimeContext

public class RuntimeContext
extends PentahoMessenger
implements IRuntimeContext

Author:
James Dixon TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates
See Also:
Serialized Form

Field Summary
static boolean debug
           
 
Fields inherited from class org.pentaho.platform.engine.core.system.PentahoBase
EMPTYLOGID, LOGID_MASK1, LOGID_MASK2, LOGID_SEPARATOR
 
Fields inherited from interface org.pentaho.platform.api.engine.IRuntimeContext
FEEDBACK_OUTPUT, PARAMETERS_FAIL, PARAMETERS_OK, PARAMETERS_UI_NEEDED, PROMPT_NO, PROMPT_NOW, PROMPT_WAITING, RUNTIME_CONTEXT_RESOLVE_FAIL, RUNTIME_CONTEXT_RESOLVE_OK, RUNTIME_CONTEXT_VALIDATE_FAIL, RUNTIME_CONTEXT_VALIDATE_OK, RUNTIME_STATUS_FAILURE, RUNTIME_STATUS_INITIALIZE_FAIL, RUNTIME_STATUS_INITIALIZE_OK, RUNTIME_STATUS_NOT_STARTED, RUNTIME_STATUS_RUNNING, RUNTIME_STATUS_SETUP_FAIL, RUNTIME_STATUS_SUCCESS
 
Fields inherited from interface org.pentaho.platform.api.engine.ILogger
ACTIVITY_LOG, DEBUG, ERROR, FATAL, INFO, INSTANCE_LOG, SESSION_LOG, SOLUTION_LOG, TRACE, UNKNOWN, WARN
 
Constructor Summary
RuntimeContext(String instanceId, ISolutionEngine solutionEngine, String solutionName, IRuntimeElement runtimeData, IPentahoSession session, IOutputHandler outputHandler, String processId, IPentahoUrlFactory urlFactory, Map parameterProviders, List messages, ICreateFeedbackParameterCallback createFeedbackParameterCallback)
           
 
Method Summary
 void addInputParameter(String name, IActionParameter param)
          Adds an input parameter to the list of all inputs for the action sequence
 void addTempParameter(String name, IActionParameter param)
          Adds a parameter to the current inputs.
 String applyInputsToFormat(String format)
          Does parameter substitution on the input string, searching for all parameter declarations in the input string, and substituting the value from the matching input parameter.
 String applyInputsToFormat(String format, IParameterResolver resolver)
          Does parameter substitution on the input string, searching for all parameter declarations in the input string, and substituting the value from the matching input parameter.
 void audit(List auditList)
           
 void audit(String messageType, String message, String value, long duration)
          Writes a message to the audit log.
 boolean checkForFieldInTemplate(String fieldName)
           
 void createFeedbackParameter(IActionParameter actionParam)
          Deprecated. Unused
 void createFeedbackParameter(ISelectionMapper selMap, String fieldName, Object defaultValues)
          Adds a feedback parameter (essentially a form input field) for a required input.
 void createFeedbackParameter(ISelectionMapper selMap, String fieldName, Object defaultValues, boolean optional)
          Adds a feedback parameter (essentially a form input field) for a required input.
 void createFeedbackParameter(String fieldName, String displayName, String hint, Object defaultValue, boolean visible)
          Adds a scalar feedback parameter
 void createFeedbackParameter(String fieldName, String displayName, String hint, Object defaultValue, boolean visible, boolean optional)
          Adds a scalar feedback parameter
 void createFeedbackParameter(String fieldName, String displayName, String hint, Object defaultValues, List values, Map dispNames, String displayStyle)
          Creates a feedback parameter that uses a list for the values
 void createFeedbackParameter(String fieldName, String displayName, String hint, Object defaultValues, List values, Map dispNames, String displayStyle, boolean optional)
          Creates a feedback parameter that uses a list for the values
 String createNewInstance(boolean persisted)
          Creates a new runtime context that is a child of this instance
 String createNewInstance(boolean persisted, Map parameters)
          Creates a new runtime context that is a child of this instance and sets attributes of the runtime data from the parameter Map
 String createNewInstance(boolean persisted, Map parameters, boolean forceImmediateWrite)
          Creates a new runtime context that is a child of this instance and sets attributes of the runtime data from the parameter Map, and can optionally cause the new instance to be forcibly written to the underlying persistence mechanism.
 void dispose()
           
 void dispose(List actionParameters)
           
 int executeSequence(IActionCompleteListener doneListener, IExecutionListener execListener, boolean async)
          Executes the action sequence.
 int executeSequence(IActionSequence sequence, IActionCompleteListener doneListener, IExecutionListener execListener, boolean async)
           
 boolean feedbackAllowed()
           
 void forceSaveRuntimeData()
          Forces the immediate write of runtime data to underlying persistence mechanism.
 String getActionName()
          Return the name of the action sequence.
 IActionSequence getActionSequence()
           
 String getActionTitle()
          During execution of an action sequence, returns the IActionSequence#getTitle().
 String getContentUrl(IContentItem contentItem)
          Returns a url to the passed in content item that can be used to retrieve the content.
 String getCurrentComponentName()
           
 IPentahoStreamSource getDataSource(String parameterName)
          Get's the content item associated with the parameter, and returns the content item's datasource
 int getErrorLevel()
           
 IContentItem getFeedbackContentItem()
          Interfaces to the current output handler to get the content item that is handling feedback (i.e.
 String getHandle()
          Returns the unique context identifier.
 String getId()
          Returns a unique id (across classes and instances) for this auditable object.
 Set getInputNames()
           
 IActionParameter getInputParameter(String name)
          Returns the named input parameter.
 String getInputParameterStringValue(String name)
          Gets the value of the specified input parameter as a String.
 Object getInputParameterValue(String name)
          Gets the value of the specified input parameter.
 InputStream getInputStream(String parameterName)
          Returns an input stream from an input parameter, if the input parameter is a content item.
 String getInstanceId()
          Returns the unique execution instance.
 Log getLogger()
           
 String getLogId()
           
 IContentItem getOutputContentItem(String mimeType)
          Interfaces to the current output handler to get the content item that describes the output from this request's component execution.
 IContentItem getOutputContentItem(String outputName, String mimeType)
          Interfaces to the current output handler to get the named content item from this request's component execution.
 IContentItem getOutputItem(String outputName, String mimeType, String extension)
          Returns an output stream for writing.
 Set getOutputNames()
           
 IActionParameter getOutputParameter(String name)
          Returns the named output parameter.
 int getOutputPreference()
          Gets the output type preferred by the handler.
 IParameterManager getParameterManager()
           
 Map getParameterProviders()
           
 String getProcessId()
          Return the id for the execution of a given action sequence document.
 Document getResourceAsDocument(IActionSequenceResource actionResource)
          Gets the named resource as a Document.
 String getResourceAsString(IActionSequenceResource actionResource)
          Gets the named resource as a String.
 IPentahoStreamSource getResourceDataSource(IActionSequenceResource actionResource)
          Gets the named resource as a DataSource.
 IActionSequenceResource getResourceDefintion(String name)
          Gets the named resource definition from the executing action sequence.
 InputStream getResourceInputStream(IActionSequenceResource actionResource)
          Gets the named resource as an InputStream.
 Set getResourceNames()
           
 Reader getResourceReader(IActionSequenceResource actionResource)
          Gets the named resource as a Reader.
 IPentahoSession getSession()
           
 String getSolutionName()
           
 String getSolutionPath()
           
 int getStatus()
           
 String getStringParameter(String name, String defaultValue)
           
 IPentahoUrlFactory getUrlFactory()
          The Url Factory is used for building URL's that link to this or another application
 boolean isPromptPending()
          Tells if a component is waiting for a prompt
 void promptNeeded()
          Sets the prompt flag but continue processing Actions
 void promptNow()
          Forces the runtime to stop processing Actions and return to prompt
 void sendFeedbackForm()
          Generates a parameter acquisition form for required parameters.
 void setActionSequence(IActionSequence sequence)
          Sets the current action sequence
 void setCreateFeedbackParameterCallback(ICreateFeedbackParameterCallback callback)
           
 void setOutputHandler(IOutputHandler outputHandler)
          Sets the output handler for the runtime context
 void setOutputValue(String name, Object output)
          Sets the value of a named output parameter
 void setParameterTarget(String target)
          Sets the target window that the content will be displayed in.
 void setParameterXsl(String xsl)
          Sets the xsl file to be used to generate the parameter page for the current component.
 void setPromptStatus(int status)
          Sets the default prompt status PROMPT_NO, PROMPT_WAITING, PROMPT_NOW
 int validateSequence(String sequenceName, IExecutionListener execListener)
          Validates the action sequence for consistency
 
Methods inherited from class org.pentaho.platform.engine.services.PentahoMessenger
debug, debug, error, error, fatal, fatal, getMessages, getUserString, info, info, setMessages, trace, trace, warn, warn
 
Methods inherited from class org.pentaho.platform.engine.core.system.PentahoBase
genLogIdFromInfo, genLogIdFromInfo, genLogIdFromSession, getLoggingLevel, getObjectName, setLoggingLevel, setLogId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.pentaho.platform.api.engine.IRuntimeContext
getMessages
 
Methods inherited from interface org.pentaho.platform.api.engine.IAuditable
getObjectName
 
Methods inherited from interface org.pentaho.platform.api.engine.ILogger
debug, debug, error, error, fatal, fatal, getLoggingLevel, info, info, setLoggingLevel, trace, trace, warn, warn
 

Field Detail

debug

public static final boolean debug
See Also:
Constant Field Values
Constructor Detail

RuntimeContext

public RuntimeContext(String instanceId,
                      ISolutionEngine solutionEngine,
                      String solutionName,
                      IRuntimeElement runtimeData,
                      IPentahoSession session,
                      IOutputHandler outputHandler,
                      String processId,
                      IPentahoUrlFactory urlFactory,
                      Map parameterProviders,
                      List messages,
                      ICreateFeedbackParameterCallback createFeedbackParameterCallback)
Method Detail

getLogger

public Log getLogger()
Specified by:
getLogger in class PentahoBase

createNewInstance

public String createNewInstance(boolean persisted)
Description copied from interface: IRuntimeContext
Creates a new runtime context that is a child of this instance

Specified by:
createNewInstance in interface IRuntimeContext
Parameters:
persisted - Should the runtime data be persisted
Returns:
Instance id of the new RuntimeContext

createNewInstance

public String createNewInstance(boolean persisted,
                                Map parameters)
Description copied from interface: IRuntimeContext
Creates a new runtime context that is a child of this instance and sets attributes of the runtime data from the parameter Map

Specified by:
createNewInstance in interface IRuntimeContext
Parameters:
persisted - Should the runtime data be persisted
parameters - parameters for the new instance
Returns:
Instance id of the new RuntimeContext

createNewInstance

public String createNewInstance(boolean persisted,
                                Map parameters,
                                boolean forceImmediateWrite)
Description copied from interface: IRuntimeContext
Creates a new runtime context that is a child of this instance and sets attributes of the runtime data from the parameter Map, and can optionally cause the new instance to be forcibly written to the underlying persistence mechanism.

Specified by:
createNewInstance in interface IRuntimeContext
Parameters:
persisted - Should the runtime data be persisted
parameters - parameters for the new instance
forceImmediateWrite - if true, will call the new runtime element's forceSave method before returning.
Returns:
Instance id of the new RuntimeContext

getStatus

public int getStatus()
Specified by:
getStatus in interface IRuntimeContext
Returns:
the current status of execution

promptNow

public void promptNow()
Description copied from interface: IRuntimeContext
Forces the runtime to stop processing Actions and return to prompt

Specified by:
promptNow in interface IRuntimeContext

promptNeeded

public void promptNeeded()
Sets the prompt flag but continue processing Actions

Specified by:
promptNeeded in interface IRuntimeContext

isPromptPending

public boolean isPromptPending()
Tells if a component is waiting for a prompt

Specified by:
isPromptPending in interface IRuntimeContext
Returns:
true if a prompt is pending

getUrlFactory

public IPentahoUrlFactory getUrlFactory()
Description copied from interface: IRuntimeContext
The Url Factory is used for building URL's that link to this or another application

Specified by:
getUrlFactory in interface IRuntimeContext
Returns:
the URL Factory

feedbackAllowed

public boolean feedbackAllowed()
Specified by:
feedbackAllowed in interface IRuntimeContext
Returns:
true if the current output device allows user feedback (i.e. parameter input forms)

getFeedbackContentItem

public IContentItem getFeedbackContentItem()
Description copied from interface: IRuntimeContext
Interfaces to the current output handler to get the content item that is handling feedback (i.e. parameter input forms)

Specified by:
getFeedbackContentItem in interface IRuntimeContext
Returns:
the Content Item for user input
See Also:
IContentItem, IOutputHandler

getOutputItem

public IContentItem getOutputItem(String outputName,
                                  String mimeType,
                                  String extension)
Description copied from interface: IRuntimeContext
Returns an output stream for writing.

Specified by:
getOutputItem in interface IRuntimeContext
Parameters:
outputName - The name of the output
mimeType - The mime type of the output
extension - The file extension of the output
Returns:
OutputStream for writing to

getOutputContentItem

public IContentItem getOutputContentItem(String mimeType)
Description copied from interface: IRuntimeContext
Interfaces to the current output handler to get the content item that describes the output from this request's component execution.

Specified by:
getOutputContentItem in interface IRuntimeContext
Returns:
The content item for output
See Also:
IContentItem, IOutputHandler

getOutputContentItem

public IContentItem getOutputContentItem(String outputName,
                                         String mimeType)
Description copied from interface: IRuntimeContext
Interfaces to the current output handler to get the named content item from this request's component execution.

Specified by:
getOutputContentItem in interface IRuntimeContext
Parameters:
outputName - the name of the output
Returns:
The requested content item
See Also:
IContentItem, IOutputHandler

getHandle

public String getHandle()
Description copied from interface: IRuntimeContext
Returns the unique context identifier. The handle is created during construction of the RuntimeContext object, and should be unique down to the date/time of construction. The default form of this as implemented in RuntimeContext includes context- plus the hashcode and the date/time.

Specified by:
getHandle in interface IRuntimeContext
Returns:
the unique handle.
See Also:
RuntimeContext

getSession

public IPentahoSession getSession()
Specified by:
getSession in interface IRuntimeContext
Returns:
The session that started execution of the current action sequence

getSolutionName

public String getSolutionName()
Specified by:
getSolutionName in interface IRuntimeContext
Returns:
The name of the solution holding the currently executing action sequence

getSolutionPath

public String getSolutionPath()
Specified by:
getSolutionPath in interface IRuntimeContext
Returns:
The path within the solution holding the currently executing action sequence

getCurrentComponentName

public String getCurrentComponentName()
Specified by:
getCurrentComponentName in interface IRuntimeContext
Returns:
The component in the action seqeuence that's being executed

getInstanceId

public String getInstanceId()
Description copied from interface: IRuntimeContext
Returns the unique execution instance. This is typically a GUID that can be used to track the entire execution of an action sequence all the way from beginning to end.

Specified by:
getInstanceId in interface IRuntimeContext
Returns:
unique instance Id

getErrorLevel

public int getErrorLevel()

setActionSequence

public void setActionSequence(IActionSequence sequence)
Description copied from interface: IRuntimeContext
Sets the current action sequence

Specified by:
setActionSequence in interface IRuntimeContext
Parameters:
sequence - The action sequence to validate

validateSequence

public int validateSequence(String sequenceName,
                            IExecutionListener execListener)
Description copied from interface: IRuntimeContext
Validates the action sequence for consistency

Specified by:
validateSequence in interface IRuntimeContext
Parameters:
sequenceName - The name of the sequence to validate
Returns:
integer indicating success or failure
See Also:
IRuntimeContext.RUNTIME_CONTEXT_VALIDATE_FAIL, IRuntimeContext.RUNTIME_CONTEXT_VALIDATE_OK

executeSequence

public int executeSequence(IActionCompleteListener doneListener,
                           IExecutionListener execListener,
                           boolean async)
Description copied from interface: IRuntimeContext
Executes the action sequence.

Specified by:
executeSequence in interface IRuntimeContext
Parameters:
doneListener - The listener to be notified when the sequence finishes
async - Whether the action is synchronous or asynchronous.
Returns:
int indicating success
See Also:
IRuntimeContext.RUNTIME_STATUS_FAILURE, IRuntimeContext.RUNTIME_STATUS_SUCCESS

setPromptStatus

public void setPromptStatus(int status)
Description copied from interface: IRuntimeContext
Sets the default prompt status PROMPT_NO, PROMPT_WAITING, PROMPT_NOW

Specified by:
setPromptStatus in interface IRuntimeContext

executeSequence

public int executeSequence(IActionSequence sequence,
                           IActionCompleteListener doneListener,
                           IExecutionListener execListener,
                           boolean async)

dispose

public void dispose()
Specified by:
dispose in interface IRuntimeContext

dispose

public void dispose(List actionParameters)
Specified by:
dispose in interface IRuntimeContext

getStringParameter

public String getStringParameter(String name,
                                 String defaultValue)

getInputParameterValue

public Object getInputParameterValue(String name)
Description copied from interface: IRuntimeContext
Gets the value of the specified input parameter. Throws a NullPointerException if the parameter is not found. This method never returns null

Specified by:
getInputParameterValue in interface IRuntimeContext
Parameters:
name - The named parameter to retrieve
Returns:
The IActionParameter#getValue()
See Also:
IActionParameter

getInputParameterStringValue

public String getInputParameterStringValue(String name)
Description copied from interface: IRuntimeContext
Gets the value of the specified input parameter as a String. Throws a NullPointerException if the parameter is not found. This method never returns null

Specified by:
getInputParameterStringValue in interface IRuntimeContext
Parameters:
name - The named parameter to retrieve
Returns:
The IActionParameter#getStringValue()
See Also:
IActionParameter

getInputParameter

public IActionParameter getInputParameter(String name)
Description copied from interface: IRuntimeContext
Returns the named input parameter. This will search amongst all the input parameter providers (IParameterProvider) in order until it finds the input parameter and returns it. Throws a NullPointerException if the parameter is not found. This method never returns null

Specified by:
getInputParameter in interface IRuntimeContext
Parameters:
name - The name of the parameter to get
Returns:
The parameter
See Also:
org.pentaho.platform.api.engine.services.IParameterProvider

getOutputParameter

public IActionParameter getOutputParameter(String name)
Description copied from interface: IRuntimeContext
Returns the named output parameter. This will search amongst all the output parameter providers (IParameterProvider) in order until it finds the output parameter and returns it. Throws a NullPointerException if the parameter is not found. This method never returns null

Specified by:
getOutputParameter in interface IRuntimeContext
Parameters:
name - The name of the parameter to get
Returns:
The requested parameter
See Also:
org.pentaho.platform.api.engine.services.IParameterProvider

getResourceDefintion

public IActionSequenceResource getResourceDefintion(String name)
Description copied from interface: IRuntimeContext
Gets the named resource definition from the executing action sequence. Throws a NullPointerException if the resource is not found. This method never returns null

Specified by:
getResourceDefintion in interface IRuntimeContext
Parameters:
name - The named resource to get
Returns:
The resource if it exists.
See Also:
IActionSequenceResource

getInputNames

public Set getInputNames()
Specified by:
getInputNames in interface IRuntimeContext
Returns:
a Set containing all the inputs in the current action.

addTempParameter

public void addTempParameter(String name,
                             IActionParameter param)
Description copied from interface: IRuntimeContext
Adds a parameter to the current inputs. A component can be use this to create parameters for internal use or for new outputs.

Specified by:
addTempParameter in interface IRuntimeContext
Parameters:
name - The name of the temporary parameter
param - The value to set the temporary parameter to

setOutputValue

public void setOutputValue(String name,
                           Object output)
Description copied from interface: IRuntimeContext
Sets the value of a named output parameter

Specified by:
setOutputValue in interface IRuntimeContext
Parameters:
name - The name of the output parameter
output - The value to set the output parameter to

getDataSource

public IPentahoStreamSource getDataSource(String parameterName)
Description copied from interface: IRuntimeContext
Get's the content item associated with the parameter, and returns the content item's datasource

Specified by:
getDataSource in interface IRuntimeContext
Parameters:
parameterName - The name of the parameter
Returns:
The IPentahoStreamSource from the Content Item
See Also:
IContentItem.getDataSource()

getContentUrl

public String getContentUrl(IContentItem contentItem)
Description copied from interface: IRuntimeContext
Returns a url to the passed in content item that can be used to retrieve the content.

Specified by:
getContentUrl in interface IRuntimeContext
Returns:
a string representing the URL or null if the name is not a content item or is not a valid name.

getInputStream

public InputStream getInputStream(String parameterName)
Description copied from interface: IRuntimeContext
Returns an input stream from an input parameter, if the input parameter is a content item.

Specified by:
getInputStream in interface IRuntimeContext
Parameters:
parameterName - The name of the parameter
Returns:
An InputStream from the content item

getOutputNames

public Set getOutputNames()
Specified by:
getOutputNames in interface IRuntimeContext
Returns:
a Set containing the output names in the current action

getResourceNames

public Set getResourceNames()
Specified by:
getResourceNames in interface IRuntimeContext
Returns:
a Set containing the resource names in the action

getResourceInputStream

public InputStream getResourceInputStream(IActionSequenceResource actionResource)
                                   throws FileNotFoundException
Description copied from interface: IRuntimeContext
Gets the named resource as an InputStream. This is just a utility method that interfaces to ISolutionRepository

Specified by:
getResourceInputStream in interface IRuntimeContext
Parameters:
actionResource - The resource to get from the SolutionRepository
Returns:
The InputStream that contains the resource.
Throws:
FileNotFoundException
See Also:
ISolutionRepository#getResourceInputStream(IActionResource)

getResourceReader

public Reader getResourceReader(IActionSequenceResource actionResource)
                         throws IOException
Description copied from interface: IRuntimeContext
Gets the named resource as a Reader. This is just a utility method that interfaces to ISolutionRepository

Specified by:
getResourceReader in interface IRuntimeContext
Returns:
The Reader
Throws:
IOException
See Also:
ISolutionRepository#getResourceReader(IActionResource)

getResourceAsString

public String getResourceAsString(IActionSequenceResource actionResource)
                           throws IOException
Description copied from interface: IRuntimeContext
Gets the named resource as a String. This is just a utility method that interfaces to ISolutionRepository

Specified by:
getResourceAsString in interface IRuntimeContext
Returns:
The String
Throws:
IOException
See Also:
ISolutionRepository#getResourceAsString(IActionResource)

getResourceAsDocument

public Document getResourceAsDocument(IActionSequenceResource actionResource)
                               throws IOException
Description copied from interface: IRuntimeContext
Gets the named resource as a Document. This is just a utility method that interfaces to ISolutionRepository

Specified by:
getResourceAsDocument in interface IRuntimeContext
Returns:
The DataSource
Throws:
IOException
See Also:
ISolutionRepository#getResourceAsDocument(IActionResource)

getResourceDataSource

public IPentahoStreamSource getResourceDataSource(IActionSequenceResource actionResource)
                                           throws FileNotFoundException
Description copied from interface: IRuntimeContext
Gets the named resource as a DataSource. This is just a utility method that interfaces to ISolutionRepository

Specified by:
getResourceDataSource in interface IRuntimeContext
Parameters:
actionResource - The resource to get from the SolutionRepository
Returns:
The DataSource
Throws:
FileNotFoundException
See Also:
ISolutionRepository#getResourceDataSource(IActionResource)

getId

public String getId()
Description copied from interface: IAuditable
Returns a unique id (across classes and instances) for this auditable object.

Specified by:
getId in interface IAuditable
Returns:
the auditable's id

getProcessId

public String getProcessId()
Description copied from interface: IAuditable
Return the id for the execution of a given action sequence document.

Specified by:
getProcessId in interface IAuditable
Returns:
the process id

getActionName

public String getActionName()
Description copied from interface: IAuditable
Return the name of the action sequence. Today, that name is synonymous with the name of the action sequence document in the solution repository.

Specified by:
getActionName in interface IAuditable
Returns:
the name of the action sequence

getActionTitle

public String getActionTitle()
Description copied from interface: IRuntimeContext
During execution of an action sequence, returns the IActionSequence#getTitle().

Specified by:
getActionTitle in interface IRuntimeContext
Returns:
Action sequence title
See Also:
IActionSequence#getSequenceTitle()

audit

public void audit(List auditList)

audit

public void audit(String messageType,
                  String message,
                  String value,
                  long duration)
Description copied from interface: IRuntimeContext
Writes a message to the audit log.

Specified by:
audit in interface IRuntimeContext
Parameters:
messageType - Message type as defined in MessageTypes
message - Message to appear in the log
value - Value of an object to be logged.
duration - For time-tracked execution paths, indicates the duration the task took
See Also:
IAuditEntry, IAuditable, org.pentaho.core.audit.MessageTypes

addInputParameter

public void addInputParameter(String name,
                              IActionParameter param)
Description copied from interface: IRuntimeContext
Adds an input parameter to the list of all inputs for the action sequence

Specified by:
addInputParameter in interface IRuntimeContext
Parameters:
name - The name of the parameter (the key to the parameter map)
param - The parameter to add
See Also:
IActionParameter

applyInputsToFormat

public String applyInputsToFormat(String format)
Description copied from interface: IRuntimeContext
Does parameter substitution on the input string, searching for all parameter declarations in the input string, and substituting the value from the matching input parameter. In other words, it replaces {REGION} with the value of the input parameter called REGION.

Specified by:
applyInputsToFormat in interface IRuntimeContext
Parameters:
format - The string containing possible parameter references
Returns:
String with parameters resolved.

applyInputsToFormat

public String applyInputsToFormat(String format,
                                  IParameterResolver resolver)
Description copied from interface: IRuntimeContext
Does parameter substitution on the input string, searching for all parameter declarations in the input string, and substituting the value from the matching input parameter. In other words, it replaces {REGION} with the value of the input parameter called REGION.

Specified by:
applyInputsToFormat in interface IRuntimeContext
Parameters:
format - The string containing possible parameter references
Returns:
String with parameters resolved.

sendFeedbackForm

public void sendFeedbackForm()
                      throws IOException
Description copied from interface: IRuntimeContext
Generates a parameter acquisition form for required parameters. This writes directly to the output stream provided by the output handler.

Specified by:
sendFeedbackForm in interface IRuntimeContext
Throws:
IOException
See Also:
IOutputHandler

createFeedbackParameter

@Deprecated
public void createFeedbackParameter(IActionParameter actionParam)
Deprecated. Unused

Specified by:
createFeedbackParameter in interface IRuntimeContext
Parameters:
actionParam - The Action Parameter to use as the model for the prompt

createFeedbackParameter

public void createFeedbackParameter(ISelectionMapper selMap,
                                    String fieldName,
                                    Object defaultValues)
Description copied from interface: IRuntimeContext
Adds a feedback parameter (essentially a form input field) for a required input.

Specified by:
createFeedbackParameter in interface IRuntimeContext
Parameters:
selMap - Maps IPentahoResultSet objects to selection objects
fieldName - Name of the form field
defaultValues - default values for the input field
See Also:
SelectionMapper

createFeedbackParameter

public void createFeedbackParameter(ISelectionMapper selMap,
                                    String fieldName,
                                    Object defaultValues,
                                    boolean optional)
Description copied from interface: IRuntimeContext
Adds a feedback parameter (essentially a form input field) for a required input.

Specified by:
createFeedbackParameter in interface IRuntimeContext
Parameters:
selMap - Maps IPentahoResultSet objects to selection objects
fieldName - Name of the form field
defaultValues - default values for the input field
optional - specifies if the feedback parameter is required or not
See Also:
SelectionMapper

createFeedbackParameter

public void createFeedbackParameter(String fieldName,
                                    String displayName,
                                    String hint,
                                    Object defaultValues,
                                    List values,
                                    Map dispNames,
                                    String displayStyle)
Description copied from interface: IRuntimeContext
Creates a feedback parameter that uses a list for the values

Specified by:
createFeedbackParameter in interface IRuntimeContext
Parameters:
fieldName - The name of the field
displayName - Display name
hint - Fly-over hint for the input field
defaultValues - Default value of the input field
values - List of values
dispNames - Map of display names
displayStyle - how to display the control
See Also:
XForm

createFeedbackParameter

public void createFeedbackParameter(String fieldName,
                                    String displayName,
                                    String hint,
                                    Object defaultValues,
                                    List values,
                                    Map dispNames,
                                    String displayStyle,
                                    boolean optional)
Description copied from interface: IRuntimeContext
Creates a feedback parameter that uses a list for the values

Specified by:
createFeedbackParameter in interface IRuntimeContext
Parameters:
fieldName - The name of the field
displayName - Display name
hint - Fly-over hint for the input field
defaultValues - Default value of the input field
values - List of values
dispNames - Map of display names
displayStyle - how to display the control
See Also:
XForm

checkForFieldInTemplate

public boolean checkForFieldInTemplate(String fieldName)

createFeedbackParameter

public void createFeedbackParameter(String fieldName,
                                    String displayName,
                                    String hint,
                                    Object defaultValue,
                                    boolean visible)
Description copied from interface: IRuntimeContext
Adds a scalar feedback parameter

Specified by:
createFeedbackParameter in interface IRuntimeContext
Parameters:
fieldName - Name of the input field
displayName - display name of the input field
hint - Fly-over hint for the input field
defaultValue - Default value for the input field
visible - Whether the input field is visible or not
See Also:
XForm

createFeedbackParameter

public void createFeedbackParameter(String fieldName,
                                    String displayName,
                                    String hint,
                                    Object defaultValue,
                                    boolean visible,
                                    boolean optional)
Description copied from interface: IRuntimeContext
Adds a scalar feedback parameter

Specified by:
createFeedbackParameter in interface IRuntimeContext
Parameters:
fieldName - Name of the input field
displayName - display name of the input field
hint - Fly-over hint for the input field
defaultValue - Default value for the input field
visible - Whether the input field is visible or not
optional - specifies if the feedback parameter is required or not
See Also:
XForm

setParameterXsl

public void setParameterXsl(String xsl)
Description copied from interface: IRuntimeContext
Sets the xsl file to be used to generate the parameter page for the current component. The parameter should be a full path from the solution root starting with a /, or it should be a path relative to the directory of the current action sequence.

Specified by:
setParameterXsl in interface IRuntimeContext
Parameters:
xsl - The name of the XSL file

setParameterTarget

public void setParameterTarget(String target)
Description copied from interface: IRuntimeContext
Sets the target window that the content will be displayed in. This name is used at the target in an Window.open() javascript call made when the submit button on the parameter page is clicked.

Specified by:
setParameterTarget in interface IRuntimeContext
Parameters:
target - Window name

getLogId

public String getLogId()
Overrides:
getLogId in class PentahoBase

forceSaveRuntimeData

public void forceSaveRuntimeData()
Forces the immediate write of runtime data to underlying persistence mechanism. In the case of using Hibernate for the runtime data persistence, this works out to a call to HibernateUtil.flush().

Specified by:
forceSaveRuntimeData in interface IRuntimeContext

getOutputPreference

public int getOutputPreference()
Gets the output type preferred by the handler. Values are defined in org.pentaho.core.solution.IOutputHander and are OUTPUT_TYPE_PARAMETERS, OUTPUT_TYPE_CONTENT, or OUTPUT_TYPE_DEFAULT

Specified by:
getOutputPreference in interface IRuntimeContext
Returns:
Output type

setOutputHandler

public void setOutputHandler(IOutputHandler outputHandler)
Description copied from interface: IRuntimeContext
Sets the output handler for the runtime context

Specified by:
setOutputHandler in interface IRuntimeContext
Parameters:
outputHandler - The output handler

getActionSequence

public IActionSequence getActionSequence()
Specified by:
getActionSequence in interface IRuntimeContext

getParameterManager

public IParameterManager getParameterManager()
Specified by:
getParameterManager in interface IRuntimeContext

getParameterProviders

public Map getParameterProviders()
Specified by:
getParameterProviders in interface IRuntimeContext

setCreateFeedbackParameterCallback

public void setCreateFeedbackParameterCallback(ICreateFeedbackParameterCallback callback)
Specified by:
setCreateFeedbackParameterCallback in interface IRuntimeContext