|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IRuntimeContext
This interface defines methods and constants that are used during action execution to resolve parameters, inputs and outputs, resources, and persist the runtime data. Think of the runtime context as working storage for the execution of an action.
Field Summary | |
---|---|
static String |
FEEDBACK_OUTPUT
Unused |
static int |
PARAMETERS_FAIL
Currently only used as an indicator that BIRT report specification parameters could not be read. |
static int |
PARAMETERS_OK
Currently only used as an indicator that BIRT report specification parameters could be read properly. |
static int |
PARAMETERS_UI_NEEDED
Indicates that parameters are required by an action, and the parameters aren't available so they need to be prompted for. |
static int |
PROMPT_NO
Indicates that no parameter prompts are pending. |
static int |
PROMPT_NOW
Indicates that we need to prompt immediately for parameters. |
static int |
PROMPT_WAITING
Indicates that parameter prompts are pending. |
static int |
RUNTIME_CONTEXT_RESOLVE_FAIL
Indicates that parameters for an action could not be resolved. |
static int |
RUNTIME_CONTEXT_RESOLVE_OK
Indicates that the parameters for an action were able to be resolved. |
static int |
RUNTIME_CONTEXT_VALIDATE_FAIL
Indicator of action validation failure |
static int |
RUNTIME_CONTEXT_VALIDATE_OK
Indicator of action validation success |
static int |
RUNTIME_STATUS_FAILURE
Indicator of action failure. |
static int |
RUNTIME_STATUS_INITIALIZE_FAIL
Indicator of initialization failure |
static int |
RUNTIME_STATUS_INITIALIZE_OK
Indicator that initialization happened successfully |
static int |
RUNTIME_STATUS_NOT_STARTED
When beginning execution of an action sequence, the status starts off as not started. |
static int |
RUNTIME_STATUS_RUNNING
As an action sequence begins execution, the status is set to running. |
static int |
RUNTIME_STATUS_SETUP_FAIL
Indicates an invalid instance ID was passed into the execution of an action sequence |
static int |
RUNTIME_STATUS_SUCCESS
Indicates that the action executed successfully |
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 |
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 output)
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(String messageType,
String message,
String value,
long duration)
Writes a message to the audit log. |
void |
createFeedbackParameter(IActionParameter actionParam)
Deprecated. Adds a feedback parameter for prompts based on an Action Parameter. Uses the Selections defined in the Action Parameter for the options and sets the default to the current value |
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 exceptParameters)
|
int |
executeSequence(IActionCompleteListener listener,
IExecutionListener execListener,
boolean async)
Executes the action sequence. |
boolean |
feedbackAllowed()
|
void |
forceSaveRuntimeData()
Forces the immediate write of runtime data to underlying persistence mechanism. |
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 |
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. |
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. |
List |
getMessages()
|
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 prefered by the handler. |
IParameterManager |
getParameterManager()
|
Map |
getParameterProviders()
|
Document |
getResourceAsDocument(IActionSequenceResource actionParameter)
Gets the named resource as a Document. |
String |
getResourceAsString(IActionSequenceResource actionParameter)
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 actionParameter)
Gets the named resource as a Reader. |
IPentahoSession |
getSession()
|
String |
getSolutionName()
|
String |
getSolutionPath()
|
int |
getStatus()
|
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 actionSequence)
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 interface org.pentaho.platform.api.engine.IAuditable |
---|
getActionName, getId, getObjectName, getProcessId |
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 |
---|
static final String FEEDBACK_OUTPUT
static final int RUNTIME_CONTEXT_VALIDATE_FAIL
static final int RUNTIME_CONTEXT_VALIDATE_OK
static final int RUNTIME_CONTEXT_RESOLVE_OK
static final int RUNTIME_CONTEXT_RESOLVE_FAIL
static final int RUNTIME_STATUS_NOT_STARTED
static final int RUNTIME_STATUS_INITIALIZE_OK
static final int RUNTIME_STATUS_INITIALIZE_FAIL
static final int RUNTIME_STATUS_RUNNING
static final int RUNTIME_STATUS_SUCCESS
static final int RUNTIME_STATUS_FAILURE
static final int RUNTIME_STATUS_SETUP_FAIL
static final int PARAMETERS_FAIL
static final int PARAMETERS_OK
static final int PARAMETERS_UI_NEEDED
static final int PROMPT_NO
static final int PROMPT_WAITING
static final int PROMPT_NOW
Method Detail |
---|
String getHandle()
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.
RuntimeContext
String getActionTitle()
IActionSequence#getSequenceTitle()
void promptNow()
void promptNeeded()
boolean isPromptPending()
String getInstanceId()
void setActionSequence(IActionSequence actionSequence)
actionSequence
- The action sequence to validateIActionSequence getActionSequence()
int validateSequence(String sequenceName, IExecutionListener execListener)
sequenceName
- The name of the sequence to validate
RUNTIME_CONTEXT_VALIDATE_FAIL
,
RUNTIME_CONTEXT_VALIDATE_OK
int executeSequence(IActionCompleteListener listener, IExecutionListener execListener, boolean async)
listener
- The listener to be notified when the sequence finishesasync
- Whether the action is synchronous or asynchronous.
int
indicating successRUNTIME_STATUS_FAILURE
,
RUNTIME_STATUS_SUCCESS
IPentahoUrlFactory getUrlFactory()
String getSolutionName()
String getSolutionPath()
String getCurrentComponentName()
IPentahoSession getSession()
void audit(String messageType, String message, String value, long duration)
messageType
- Message type as defined in MessageTypesmessage
- Message to appear in the logvalue
- Value of an object to be logged.duration
- For time-tracked execution paths, indicates the duration the task tookIAuditEntry
,
IAuditable
,
org.pentaho.core.audit.MessageTypes
IActionParameter getInputParameter(String name)
null
name
- The name of the parameter to get
org.pentaho.platform.api.engine.services.IParameterProvider
IActionParameter getOutputParameter(String name)
null
name
- The name of the parameter to get
org.pentaho.platform.api.engine.services.IParameterProvider
IActionSequenceResource getResourceDefintion(String name)
null
name
- The named resource to get
IActionSequenceResource
Object getInputParameterValue(String name)
null
name
- The named parameter to retrieve
IActionParameter
String getInputParameterStringValue(String name)
String
.
Throws a NullPointerException if the parameter is not found. This method never returns
null
name
- The named parameter to retrieve
IActionParameter
InputStream getResourceInputStream(IActionSequenceResource actionResource) throws FileNotFoundException
actionResource
- The resource to get from the SolutionRepository
InputStream
that contains the resource.
FileNotFoundException
ISolutionRepository#getResourceInputStream(IActionResource)
IPentahoStreamSource getResourceDataSource(IActionSequenceResource actionResource) throws FileNotFoundException
actionResource
- The resource to get from the SolutionRepository
- Returns:
- The
DataSource
- Throws:
FileNotFoundException
- See Also:
ISolutionRepository#getResourceDataSource(IActionResource)
Reader getResourceReader(IActionSequenceResource actionParameter) throws IOException
actionResource
- The resource to get from the SolutionRepository
- Returns:
- The
Reader
- Throws:
IOException
- See Also:
ISolutionRepository#getResourceReader(IActionResource)
String getResourceAsString(IActionSequenceResource actionParameter) throws IOException
actionResource
- The resource to get from the SolutionRepository
- Returns:
- The
String
- Throws:
IOException
- See Also:
ISolutionRepository#getResourceAsString(IActionResource)
Document getResourceAsDocument(IActionSequenceResource actionParameter) throws IOException, DocumentException
actionResource
- The resource to get from the SolutionRepository
- Returns:
- The
DataSource
- Throws:
IOException
DocumentException
- See Also:
ISolutionRepository#getResourceAsDocument(IActionResource)
void setOutputValue(String name, Object output)
name
- The name of the output parameteroutput
- The value to set the output parameter tovoid addTempParameter(String name, IActionParameter output)
name
- The name of the temporary parameteroutput
- The value to set the temporary parameter toIContentItem getOutputItem(String outputName, String mimeType, String extension)
outputName
- The name of the outputmimeType
- The mime type of the outputextension
- The file extension of the output
InputStream getInputStream(String parameterName)
parameterName
- The name of the parameter
IPentahoStreamSource getDataSource(String parameterName)
parameterName
- The name of the parameter
IContentItem.getDataSource()
Set getInputNames()
Set getResourceNames()
Set getOutputNames()
String applyInputsToFormat(String format)
format
- The string containing possible parameter references
String applyInputsToFormat(String format, IParameterResolver resolver)
format
- The string containing possible parameter referencesResolver
- for parameters for overriding behavior
void addInputParameter(String name, IActionParameter param)
name
- The name of the parameter (the key to the parameter map)param
- The parameter to addIActionParameter
boolean feedbackAllowed()
IContentItem getFeedbackContentItem()
IContentItem
,
IOutputHandler
IContentItem getOutputContentItem(String mimeType)
IContentItem
,
IOutputHandler
IContentItem getOutputContentItem(String outputName, String mimeType)
outputName
- the name of the output
IContentItem
,
IOutputHandler
String getContentUrl(IContentItem contentItem)
parameterName
- the parameter name of the content
void sendFeedbackForm() throws IOException
IOException
IOutputHandler
void setCreateFeedbackParameterCallback(ICreateFeedbackParameterCallback callback)
@Deprecated void createFeedbackParameter(IActionParameter actionParam)
actionParam
- The Action Parameter to use as the model for the promptvoid createFeedbackParameter(ISelectionMapper selMap, String fieldName, Object defaultValues)
selMap
- Maps IPentahoResultSet
objects to selection objectsfieldName
- Name of the form fielddefaultValues
- default values for the input fieldSelectionMapper
void createFeedbackParameter(ISelectionMapper selMap, String fieldName, Object defaultValues, boolean optional)
selMap
- Maps IPentahoResultSet
objects to selection objectsfieldName
- Name of the form fielddefaultValues
- default values for the input fieldoptional
- specifies if the feedback parameter is required or notSelectionMapper
void createFeedbackParameter(String fieldName, String displayName, String hint, Object defaultValue, boolean visible)
fieldName
- Name of the input fielddisplayName
- display name of the input fieldhint
- Fly-over hint for the input fielddefaultValue
- Default value for the input fieldvisible
- Whether the input field is visible or notXForm
void createFeedbackParameter(String fieldName, String displayName, String hint, Object defaultValue, boolean visible, boolean optional)
fieldName
- Name of the input fielddisplayName
- display name of the input fieldhint
- Fly-over hint for the input fielddefaultValue
- Default value for the input fieldvisible
- Whether the input field is visible or notoptional
- specifies if the feedback parameter is required or notXForm
void createFeedbackParameter(String fieldName, String displayName, String hint, Object defaultValues, List values, Map dispNames, String displayStyle)
fieldName
- The name of the fielddisplayName
- Display namehint
- Fly-over hint for the input fielddefaultValues
- Default value of the input fieldvalues
- List of valuesdispNames
- Map of display namesdisplayStyle
- how to display the controlXForm
void createFeedbackParameter(String fieldName, String displayName, String hint, Object defaultValues, List values, Map dispNames, String displayStyle, boolean optional)
fieldName
- The name of the fielddisplayName
- Display namehint
- Fly-over hint for the input fielddefaultValues
- Default value of the input fieldvalues
- List of valuesdispNames
- Map of display namesdisplayStyle
- how to display the controlXForm
int getStatus()
List getMessages()
String createNewInstance(boolean persisted)
persisted
- Should the runtime data be persisted
String createNewInstance(boolean persisted, Map parameters)
persisted
- Should the runtime data be persistedparameters
- parameters for the new instance
String createNewInstance(boolean persisted, Map parameters, boolean forceImmediateWrite)
persisted
- Should the runtime data be persistedparameters
- parameters for the new instanceforceImmediateWrite
- if true, will call the new runtime element's forceSave method
before returning.
void dispose()
void dispose(List exceptParameters)
void setParameterXsl(String xsl)
xsl
- The name of the XSL filevoid setParameterTarget(String target)
target
- Window namevoid forceSaveRuntimeData()
int getOutputPreference()
void setOutputHandler(IOutputHandler outputHandler)
outputHandler
- The output handlervoid setPromptStatus(int status)
status
- IParameterManager getParameterManager()
Map getParameterProviders()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |