|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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)
|
void |
executeSequence(IActionCompleteListener doneListener,
IExecutionListener execListener,
boolean async)
Executes the action sequence. |
void |
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()
|
org.pentaho.commons.connection.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. |
org.apache.commons.logging.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. |
org.dom4j.Document |
getResourceAsDocument(IActionSequenceResource actionResource)
Gets the named resource as a Document. |
String |
getResourceAsString(IActionSequenceResource actionResource)
Gets the named resource as a String. |
org.pentaho.commons.connection.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 |
void |
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, 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 org.apache.commons.logging.Log getLogger()
getLogger
in class PentahoBase
public String createNewInstance(boolean persisted)
IRuntimeContext
createNewInstance
in interface IRuntimeContext
persisted
- Should the runtime data be persisted
public String createNewInstance(boolean persisted, Map parameters)
IRuntimeContext
createNewInstance
in interface IRuntimeContext
persisted
- Should the runtime data be persistedparameters
- parameters for the new instance
public String createNewInstance(boolean persisted, Map parameters, boolean forceImmediateWrite)
IRuntimeContext
createNewInstance
in interface IRuntimeContext
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.
public int getStatus()
getStatus
in interface IRuntimeContext
public void promptNow()
IRuntimeContext
promptNow
in interface IRuntimeContext
public void promptNeeded()
promptNeeded
in interface IRuntimeContext
public boolean isPromptPending()
isPromptPending
in interface IRuntimeContext
public IPentahoUrlFactory getUrlFactory()
IRuntimeContext
getUrlFactory
in interface IRuntimeContext
public boolean feedbackAllowed()
feedbackAllowed
in interface IRuntimeContext
public IContentItem getFeedbackContentItem()
IRuntimeContext
getFeedbackContentItem
in interface IRuntimeContext
IContentItem
,
IOutputHandler
public IContentItem getOutputItem(String outputName, String mimeType, String extension)
IRuntimeContext
getOutputItem
in interface IRuntimeContext
outputName
- 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 IRuntimeContext
IContentItem
,
IOutputHandler
public IContentItem getOutputContentItem(String outputName, String mimeType)
IRuntimeContext
getOutputContentItem
in interface IRuntimeContext
outputName
- the name of the output
IContentItem
,
IOutputHandler
public String getHandle()
IRuntimeContext
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.
getHandle
in interface IRuntimeContext
RuntimeContext
public IPentahoSession getSession()
getSession
in interface IRuntimeContext
public String getSolutionName()
getSolutionName
in interface IRuntimeContext
public String getSolutionPath()
getSolutionPath
in interface IRuntimeContext
public String getCurrentComponentName()
getCurrentComponentName
in interface IRuntimeContext
public String getInstanceId()
IRuntimeContext
getInstanceId
in interface IRuntimeContext
public int getErrorLevel()
public void setActionSequence(IActionSequence sequence)
IRuntimeContext
setActionSequence
in interface IRuntimeContext
sequence
- The action sequence to validatepublic void validateSequence(String sequenceName, IExecutionListener execListener) throws ActionValidationException
IRuntimeContext
validateSequence
in interface IRuntimeContext
sequenceName
- The name of the sequence to validate
ActionValidationException
public void executeSequence(IActionCompleteListener doneListener, IExecutionListener execListener, boolean async) throws ActionSequenceException
IRuntimeContext
executeSequence
in interface IRuntimeContext
doneListener
- The listener to be notified when the sequence finishesasync
- Whether the action is synchronous or asynchronous.
ActionSequenceException
IRuntimeContext.RUNTIME_STATUS_FAILURE
,
IRuntimeContext.RUNTIME_STATUS_SUCCESS
public void setPromptStatus(int status)
IRuntimeContext
setPromptStatus
in interface IRuntimeContext
public void executeSequence(IActionSequence sequence, IActionCompleteListener doneListener, IExecutionListener execListener, boolean async) throws ActionSequenceException
ActionSequenceException
public void dispose()
dispose
in interface IRuntimeContext
public void dispose(List actionParameters)
dispose
in interface IRuntimeContext
public String getStringParameter(String name, String defaultValue)
public Object getInputParameterValue(String name)
IRuntimeContext
null
getInputParameterValue
in interface IRuntimeContext
name
- The named parameter to retrieve
IActionParameter
public String getInputParameterStringValue(String name)
IRuntimeContext
String
.
Throws a NullPointerException if the parameter is not found. This method never returns
null
getInputParameterStringValue
in interface IRuntimeContext
name
- The named parameter to retrieve
IActionParameter
public IActionParameter getInputParameter(String name)
IRuntimeContext
null
getInputParameter
in interface IRuntimeContext
name
- The name of the parameter to get
org.pentaho.platform.api.engine.services.IParameterProvider
public IActionParameter getOutputParameter(String name)
IRuntimeContext
null
getOutputParameter
in interface IRuntimeContext
name
- The name of the parameter to get
org.pentaho.platform.api.engine.services.IParameterProvider
public IActionSequenceResource getResourceDefintion(String name)
IRuntimeContext
null
getResourceDefintion
in interface IRuntimeContext
name
- The named resource to get
IActionSequenceResource
public Set getInputNames()
getInputNames
in interface IRuntimeContext
public void addTempParameter(String name, IActionParameter param)
IRuntimeContext
addTempParameter
in interface IRuntimeContext
name
- The name of the temporary parameterparam
- The value to set the temporary parameter topublic void setOutputValue(String name, Object output)
IRuntimeContext
setOutputValue
in interface IRuntimeContext
name
- The name of the output parameteroutput
- The value to set the output parameter topublic org.pentaho.commons.connection.IPentahoStreamSource getDataSource(String parameterName)
IRuntimeContext
getDataSource
in interface IRuntimeContext
parameterName
- The name of the parameter
IContentItem.getDataSource()
public String getContentUrl(IContentItem contentItem)
IRuntimeContext
getContentUrl
in interface IRuntimeContext
public InputStream getInputStream(String parameterName)
IRuntimeContext
getInputStream
in interface IRuntimeContext
parameterName
- The name of the parameter
public Set getOutputNames()
getOutputNames
in interface IRuntimeContext
public Set getResourceNames()
getResourceNames
in interface IRuntimeContext
public InputStream getResourceInputStream(IActionSequenceResource actionResource) throws FileNotFoundException
IRuntimeContext
getResourceInputStream
in interface IRuntimeContext
actionResource
- The resource to get from the SolutionRepository
InputStream
that contains the resource.
FileNotFoundException
ISolutionRepository#getResourceInputStream(IActionResource)
public Reader getResourceReader(IActionSequenceResource actionResource) throws IOException
IRuntimeContext
getResourceReader
in interface IRuntimeContext
Reader
IOException
ISolutionRepository#getResourceReader(IActionResource)
public String getResourceAsString(IActionSequenceResource actionResource) throws IOException
IRuntimeContext
getResourceAsString
in interface IRuntimeContext
String
IOException
ISolutionRepository#getResourceAsString(IActionResource)
public org.dom4j.Document getResourceAsDocument(IActionSequenceResource actionResource) throws IOException
IRuntimeContext
getResourceAsDocument
in interface IRuntimeContext
DataSource
IOException
ISolutionRepository#getResourceAsDocument(IActionResource)
public org.pentaho.commons.connection.IPentahoStreamSource getResourceDataSource(IActionSequenceResource actionResource) throws FileNotFoundException
IRuntimeContext
getResourceDataSource
in interface IRuntimeContext
actionResource
- The resource to get from the SolutionRepository
- Returns:
- The
DataSource
- Throws:
FileNotFoundException
- See Also:
ISolutionRepository#getResourceDataSource(IActionResource)
public String getId()
IAuditable
getId
in interface IAuditable
public String getProcessId()
IAuditable
getProcessId
in interface IAuditable
public String getActionName()
IAuditable
getActionName
in interface IAuditable
public String getActionTitle()
IRuntimeContext
getActionTitle
in interface IRuntimeContext
IActionSequence#getSequenceTitle()
public void audit(List auditList)
public void audit(String messageType, String message, String value, long duration)
IRuntimeContext
audit
in interface IRuntimeContext
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
public void addInputParameter(String name, IActionParameter param)
IRuntimeContext
addInputParameter
in interface IRuntimeContext
name
- The name of the parameter (the key to the parameter map)param
- The parameter to addIActionParameter
public String applyInputsToFormat(String format)
IRuntimeContext
applyInputsToFormat
in interface IRuntimeContext
format
- The string containing possible parameter references
public String applyInputsToFormat(String format, IParameterResolver resolver)
IRuntimeContext
applyInputsToFormat
in interface IRuntimeContext
format
- The string containing possible parameter references
public void sendFeedbackForm() throws ActionSequencePromptException
IRuntimeContext
sendFeedbackForm
in interface IRuntimeContext
ActionSequencePromptException
IOutputHandler
@Deprecated public void createFeedbackParameter(IActionParameter actionParam)
createFeedbackParameter
in interface IRuntimeContext
actionParam
- The Action Parameter to use as the model for the promptpublic void createFeedbackParameter(ISelectionMapper selMap, String fieldName, Object defaultValues)
IRuntimeContext
createFeedbackParameter
in interface IRuntimeContext
selMap
- 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 IRuntimeContext
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
public void createFeedbackParameter(String fieldName, String displayName, String hint, Object defaultValues, List values, Map dispNames, String displayStyle)
IRuntimeContext
createFeedbackParameter
in interface IRuntimeContext
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
public void createFeedbackParameter(String fieldName, String displayName, String hint, Object defaultValues, List values, Map dispNames, String displayStyle, boolean optional)
IRuntimeContext
createFeedbackParameter
in interface IRuntimeContext
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
public boolean checkForFieldInTemplate(String fieldName)
public void createFeedbackParameter(String fieldName, String displayName, String hint, Object defaultValue, boolean visible)
IRuntimeContext
createFeedbackParameter
in interface IRuntimeContext
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
public void createFeedbackParameter(String fieldName, String displayName, String hint, Object defaultValue, boolean visible, boolean optional)
IRuntimeContext
createFeedbackParameter
in interface IRuntimeContext
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
public void setParameterXsl(String xsl)
IRuntimeContext
setParameterXsl
in interface IRuntimeContext
xsl
- The name of the XSL filepublic void setParameterTarget(String target)
IRuntimeContext
setParameterTarget
in interface IRuntimeContext
target
- Window namepublic String getLogId()
getLogId
in class PentahoBase
public void forceSaveRuntimeData()
forceSaveRuntimeData
in interface IRuntimeContext
public int getOutputPreference()
getOutputPreference
in interface IRuntimeContext
public void setOutputHandler(IOutputHandler outputHandler)
IRuntimeContext
setOutputHandler
in interface IRuntimeContext
outputHandler
- The output handlerpublic IActionSequence getActionSequence()
getActionSequence
in interface IRuntimeContext
public IParameterManager getParameterManager()
getParameterManager
in interface IRuntimeContext
public Map getParameterProviders()
getParameterProviders
in interface IRuntimeContext
public void setCreateFeedbackParameterCallback(ICreateFeedbackParameterCallback callback)
setCreateFeedbackParameterCallback
in interface IRuntimeContext
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |