|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.pentaho.platform.engine.core.system.PentahoBase
org.pentaho.platform.engine.services.PentahoMessenger
org.pentaho.platform.engine.services.runtime.RuntimeContext
public class RuntimeContext
| 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 |
|---|
public static final boolean debug
| Constructor Detail |
|---|
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 |
|---|
public Log getLogger()
getLogger in class PentahoBasepublic String createNewInstance(boolean persisted)
IRuntimeContext
createNewInstance in interface IRuntimeContextpersisted - Should the runtime data be persisted
public String createNewInstance(boolean persisted,
Map parameters)
IRuntimeContext
createNewInstance in interface IRuntimeContextpersisted - Should the runtime data be persistedparameters - parameters for the new instance
public String createNewInstance(boolean persisted,
Map parameters,
boolean forceImmediateWrite)
IRuntimeContext
createNewInstance in interface IRuntimeContextpersisted - Should the runtime data be persistedparameters - parameters for the new instanceforceImmediateWrite - if true, will call the new runtime element's forceSave method
before returning.
public int getStatus()
getStatus in interface IRuntimeContextpublic void promptNow()
IRuntimeContext
promptNow in interface IRuntimeContextpublic void promptNeeded()
promptNeeded in interface IRuntimeContextpublic boolean isPromptPending()
isPromptPending in interface IRuntimeContextpublic IPentahoUrlFactory getUrlFactory()
IRuntimeContext
getUrlFactory in interface IRuntimeContextpublic boolean feedbackAllowed()
feedbackAllowed in interface IRuntimeContextpublic IContentItem getFeedbackContentItem()
IRuntimeContext
getFeedbackContentItem in interface IRuntimeContextIContentItem,
IOutputHandler
public IContentItem getOutputItem(String outputName,
String mimeType,
String extension)
IRuntimeContext
getOutputItem in interface IRuntimeContextoutputName - The name of the outputmimeType - The mime type of the outputextension - The file extension of the output
public IContentItem getOutputContentItem(String mimeType)
IRuntimeContext
getOutputContentItem in interface IRuntimeContextIContentItem,
IOutputHandler
public IContentItem getOutputContentItem(String outputName,
String mimeType)
IRuntimeContext
getOutputContentItem in interface IRuntimeContextoutputName - the name of the output
IContentItem,
IOutputHandlerpublic String getHandle()
IRuntimeContextRuntimeContext 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.
getHandle in interface IRuntimeContextRuntimeContextpublic IPentahoSession getSession()
getSession in interface IRuntimeContextpublic String getSolutionName()
getSolutionName in interface IRuntimeContextpublic String getSolutionPath()
getSolutionPath in interface IRuntimeContextpublic String getCurrentComponentName()
getCurrentComponentName in interface IRuntimeContextpublic String getInstanceId()
IRuntimeContext
getInstanceId in interface IRuntimeContextpublic int getErrorLevel()
public void setActionSequence(IActionSequence sequence)
IRuntimeContext
setActionSequence in interface IRuntimeContextsequence - The action sequence to validate
public int validateSequence(String sequenceName,
IExecutionListener execListener)
IRuntimeContext
validateSequence in interface IRuntimeContextsequenceName - The name of the sequence to validate
IRuntimeContext.RUNTIME_CONTEXT_VALIDATE_FAIL,
IRuntimeContext.RUNTIME_CONTEXT_VALIDATE_OK
public int executeSequence(IActionCompleteListener doneListener,
IExecutionListener execListener,
boolean async)
IRuntimeContext
executeSequence in interface IRuntimeContextdoneListener - The listener to be notified when the sequence finishesasync - Whether the action is synchronous or asynchronous.
int indicating successIRuntimeContext.RUNTIME_STATUS_FAILURE,
IRuntimeContext.RUNTIME_STATUS_SUCCESSpublic void setPromptStatus(int status)
IRuntimeContext
setPromptStatus in interface IRuntimeContext
public int executeSequence(IActionSequence sequence,
IActionCompleteListener doneListener,
IExecutionListener execListener,
boolean async)
public void dispose()
dispose in interface IRuntimeContextpublic void dispose(List actionParameters)
dispose in interface IRuntimeContext
public String getStringParameter(String name,
String defaultValue)
public Object getInputParameterValue(String name)
IRuntimeContextnull
getInputParameterValue in interface IRuntimeContextname - The named parameter to retrieve
IActionParameterpublic String getInputParameterStringValue(String name)
IRuntimeContextString.
Throws a NullPointerException if the parameter is not found. This method never returns
null
getInputParameterStringValue in interface IRuntimeContextname - The named parameter to retrieve
IActionParameterpublic IActionParameter getInputParameter(String name)
IRuntimeContextnull
getInputParameter in interface IRuntimeContextname - The name of the parameter to get
org.pentaho.platform.api.engine.services.IParameterProviderpublic IActionParameter getOutputParameter(String name)
IRuntimeContextnull
getOutputParameter in interface IRuntimeContextname - The name of the parameter to get
org.pentaho.platform.api.engine.services.IParameterProviderpublic IActionSequenceResource getResourceDefintion(String name)
IRuntimeContextnull
getResourceDefintion in interface IRuntimeContextname - The named resource to get
IActionSequenceResourcepublic Set getInputNames()
getInputNames in interface IRuntimeContext
public void addTempParameter(String name,
IActionParameter param)
IRuntimeContext
addTempParameter in interface IRuntimeContextname - The name of the temporary parameterparam - The value to set the temporary parameter to
public void setOutputValue(String name,
Object output)
IRuntimeContext
setOutputValue in interface IRuntimeContextname - The name of the output parameteroutput - The value to set the output parameter topublic IPentahoStreamSource getDataSource(String parameterName)
IRuntimeContext
getDataSource in interface IRuntimeContextparameterName - The name of the parameter
IContentItem.getDataSource()public String getContentUrl(IContentItem contentItem)
IRuntimeContext
getContentUrl in interface IRuntimeContextpublic InputStream getInputStream(String parameterName)
IRuntimeContext
getInputStream in interface IRuntimeContextparameterName - The name of the parameter
public Set getOutputNames()
getOutputNames in interface IRuntimeContextpublic Set getResourceNames()
getResourceNames in interface IRuntimeContext
public InputStream getResourceInputStream(IActionSequenceResource actionResource)
throws FileNotFoundException
IRuntimeContext
getResourceInputStream in interface IRuntimeContextactionResource - The resource to get from the SolutionRepository
InputStream that contains the resource.
FileNotFoundExceptionISolutionRepository#getResourceInputStream(IActionResource)
public Reader getResourceReader(IActionSequenceResource actionResource)
throws IOException
IRuntimeContext
getResourceReader in interface IRuntimeContextReader
IOExceptionISolutionRepository#getResourceReader(IActionResource)
public String getResourceAsString(IActionSequenceResource actionResource)
throws IOException
IRuntimeContext
getResourceAsString in interface IRuntimeContextString
IOExceptionISolutionRepository#getResourceAsString(IActionResource)
public Document getResourceAsDocument(IActionSequenceResource actionResource)
throws IOException
IRuntimeContext
getResourceAsDocument in interface IRuntimeContextDataSource
IOExceptionISolutionRepository#getResourceAsDocument(IActionResource)
public IPentahoStreamSource getResourceDataSource(IActionSequenceResource actionResource)
throws FileNotFoundException
IRuntimeContext
getResourceDataSource in interface IRuntimeContextactionResource - The resource to get from the SolutionRepository
- Returns:
- The
DataSource
- Throws:
FileNotFoundException- See Also:
ISolutionRepository#getResourceDataSource(IActionResource)public String getId()
IAuditable
getId in interface IAuditablepublic String getProcessId()
IAuditable
getProcessId in interface IAuditablepublic String getActionName()
IAuditable
getActionName in interface IAuditablepublic String getActionTitle()
IRuntimeContext
getActionTitle in interface IRuntimeContextIActionSequence#getSequenceTitle()public void audit(List auditList)
public void audit(String messageType,
String message,
String value,
long duration)
IRuntimeContext
audit in interface IRuntimeContextmessageType - 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
public void addInputParameter(String name,
IActionParameter param)
IRuntimeContext
addInputParameter in interface IRuntimeContextname - The name of the parameter (the key to the parameter map)param - The parameter to addIActionParameterpublic String applyInputsToFormat(String format)
IRuntimeContext
applyInputsToFormat in interface IRuntimeContextformat - The string containing possible parameter references
public String applyInputsToFormat(String format,
IParameterResolver resolver)
IRuntimeContext
applyInputsToFormat in interface IRuntimeContextformat - The string containing possible parameter references
public void sendFeedbackForm()
throws IOException
IRuntimeContext
sendFeedbackForm in interface IRuntimeContextIOExceptionIOutputHandler@Deprecated public void createFeedbackParameter(IActionParameter actionParam)
createFeedbackParameter in interface IRuntimeContextactionParam - The Action Parameter to use as the model for the prompt
public void createFeedbackParameter(ISelectionMapper selMap,
String fieldName,
Object defaultValues)
IRuntimeContext
createFeedbackParameter in interface IRuntimeContextselMap - Maps IPentahoResultSet objects to selection objectsfieldName - Name of the form fielddefaultValues - default values for the input fieldSelectionMapper
public void createFeedbackParameter(ISelectionMapper selMap,
String fieldName,
Object defaultValues,
boolean optional)
IRuntimeContext
createFeedbackParameter in interface IRuntimeContextselMap - 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
public void createFeedbackParameter(String fieldName,
String displayName,
String hint,
Object defaultValues,
List values,
Map dispNames,
String displayStyle)
IRuntimeContext
createFeedbackParameter in interface IRuntimeContextfieldName - 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
public void createFeedbackParameter(String fieldName,
String displayName,
String hint,
Object defaultValues,
List values,
Map dispNames,
String displayStyle,
boolean optional)
IRuntimeContext
createFeedbackParameter in interface IRuntimeContextfieldName - 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 controlXFormpublic boolean checkForFieldInTemplate(String fieldName)
public void createFeedbackParameter(String fieldName,
String displayName,
String hint,
Object defaultValue,
boolean visible)
IRuntimeContext
createFeedbackParameter in interface IRuntimeContextfieldName - 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
public void createFeedbackParameter(String fieldName,
String displayName,
String hint,
Object defaultValue,
boolean visible,
boolean optional)
IRuntimeContext
createFeedbackParameter in interface IRuntimeContextfieldName - 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 notXFormpublic void setParameterXsl(String xsl)
IRuntimeContext
setParameterXsl in interface IRuntimeContextxsl - The name of the XSL filepublic void setParameterTarget(String target)
IRuntimeContext
setParameterTarget in interface IRuntimeContexttarget - Window namepublic String getLogId()
getLogId in class PentahoBasepublic void forceSaveRuntimeData()
forceSaveRuntimeData in interface IRuntimeContextpublic int getOutputPreference()
getOutputPreference in interface IRuntimeContextpublic void setOutputHandler(IOutputHandler outputHandler)
IRuntimeContext
setOutputHandler in interface IRuntimeContextoutputHandler - The output handlerpublic IActionSequence getActionSequence()
getActionSequence in interface IRuntimeContextpublic IParameterManager getParameterManager()
getParameterManager in interface IRuntimeContextpublic Map getParameterProviders()
getParameterProviders in interface IRuntimeContextpublic void setCreateFeedbackParameterCallback(ICreateFeedbackParameterCallback callback)
setCreateFeedbackParameterCallback in interface IRuntimeContext
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||