Class RuntimeContext

  • All Implemented Interfaces:
    Serializable, org.pentaho.platform.api.engine.IAuditable, org.pentaho.platform.api.engine.ILogger, org.pentaho.platform.api.engine.IRuntimeContext

    public class RuntimeContext
    extends PentahoMessenger
    implements org.pentaho.platform.api.engine.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 Detail

      • solutionEngine

        protected org.pentaho.platform.api.engine.ISolutionEngine solutionEngine
      • parameterXsl

        protected String parameterXsl
      • parameterTemplate

        protected String parameterTemplate
      • parameterTarget

        protected String parameterTarget
      • urlFactory

        protected org.pentaho.platform.api.engine.IPentahoUrlFactory urlFactory
      • parameterProviders

        protected Map parameterProviders
      • componentClassMap

        protected static Map componentClassMap
      • actionSequence

        protected org.pentaho.platform.api.engine.IActionSequence actionSequence
      • outputHandler

        protected org.pentaho.platform.api.engine.IOutputHandler outputHandler
      • paramManager

        protected org.pentaho.platform.api.engine.IParameterManager paramManager
    • Constructor Detail

      • RuntimeContext

        public RuntimeContext​(String instanceId,
                              org.pentaho.platform.api.engine.ISolutionEngine solutionEngine,
                              String solutionName,
                              org.pentaho.platform.api.repository.IRuntimeElement runtimeData,
                              org.pentaho.platform.api.engine.IPentahoSession session,
                              org.pentaho.platform.api.engine.IOutputHandler outputHandler,
                              String processId,
                              org.pentaho.platform.api.engine.IPentahoUrlFactory urlFactory,
                              Map parameterProviders,
                              List messages,
                              org.pentaho.platform.api.engine.ICreateFeedbackParameterCallback createFeedbackParameterCallback)
    • Method Detail

      • getLogger

        public org.apache.commons.logging.Log getLogger()
        Specified by:
        getLogger in class PentahoBase
      • createNewInstance

        public String createNewInstance​(boolean persisted)
        Specified by:
        createNewInstance in interface org.pentaho.platform.api.engine.IRuntimeContext
      • createNewInstance

        public String createNewInstance​(boolean persisted,
                                        Map parameters)
        Specified by:
        createNewInstance in interface org.pentaho.platform.api.engine.IRuntimeContext
      • createNewInstance

        public String createNewInstance​(boolean persisted,
                                        Map parameters,
                                        boolean forceImmediateWrite)
        Specified by:
        createNewInstance in interface org.pentaho.platform.api.engine.IRuntimeContext
      • getStatus

        public int getStatus()
        Specified by:
        getStatus in interface org.pentaho.platform.api.engine.IRuntimeContext
      • promptNow

        public void promptNow()
        Specified by:
        promptNow in interface org.pentaho.platform.api.engine.IRuntimeContext
      • promptNeeded

        public void promptNeeded()
        Sets the prompt flag but continue processing Actions
        Specified by:
        promptNeeded in interface org.pentaho.platform.api.engine.IRuntimeContext
      • isPromptPending

        public boolean isPromptPending()
        Tells if a component is waiting for a prompt
        Specified by:
        isPromptPending in interface org.pentaho.platform.api.engine.IRuntimeContext
        Returns:
        true if a prompt is pending
      • getUrlFactory

        public org.pentaho.platform.api.engine.IPentahoUrlFactory getUrlFactory()
        Specified by:
        getUrlFactory in interface org.pentaho.platform.api.engine.IRuntimeContext
      • feedbackAllowed

        public boolean feedbackAllowed()
        Specified by:
        feedbackAllowed in interface org.pentaho.platform.api.engine.IRuntimeContext
      • getFeedbackContentItem

        public org.pentaho.platform.api.repository.IContentItem getFeedbackContentItem()
        Specified by:
        getFeedbackContentItem in interface org.pentaho.platform.api.engine.IRuntimeContext
      • getOutputItem

        public org.pentaho.platform.api.repository.IContentItem getOutputItem​(String outputName,
                                                                              String mimeType,
                                                                              String extension)
        Specified by:
        getOutputItem in interface org.pentaho.platform.api.engine.IRuntimeContext
      • getOutputContentItem

        public org.pentaho.platform.api.repository.IContentItem getOutputContentItem​(String mimeType)
        Specified by:
        getOutputContentItem in interface org.pentaho.platform.api.engine.IRuntimeContext
      • getOutputContentItem

        public org.pentaho.platform.api.repository.IContentItem getOutputContentItem​(String outputName,
                                                                                     String mimeType)
        Specified by:
        getOutputContentItem in interface org.pentaho.platform.api.engine.IRuntimeContext
      • getHandle

        public String getHandle()
        Specified by:
        getHandle in interface org.pentaho.platform.api.engine.IRuntimeContext
      • getSession

        public org.pentaho.platform.api.engine.IPentahoSession getSession()
        Specified by:
        getSession in interface org.pentaho.platform.api.engine.IRuntimeContext
      • getSolutionPath

        public String getSolutionPath()
        Specified by:
        getSolutionPath in interface org.pentaho.platform.api.engine.IRuntimeContext
      • getCurrentComponentName

        public String getCurrentComponentName()
        Specified by:
        getCurrentComponentName in interface org.pentaho.platform.api.engine.IRuntimeContext
      • getInstanceId

        public String getInstanceId()
        Specified by:
        getInstanceId in interface org.pentaho.platform.api.engine.IRuntimeContext
      • getErrorLevel

        public int getErrorLevel()
      • setActionSequence

        public void setActionSequence​(org.pentaho.platform.api.engine.IActionSequence sequence)
        Specified by:
        setActionSequence in interface org.pentaho.platform.api.engine.IRuntimeContext
      • validateSequence

        public void validateSequence​(String sequenceName,
                                     org.pentaho.platform.api.engine.IExecutionListener execListener)
                              throws org.pentaho.platform.api.engine.ActionValidationException
        Specified by:
        validateSequence in interface org.pentaho.platform.api.engine.IRuntimeContext
        Throws:
        org.pentaho.platform.api.engine.ActionValidationException
      • getDataSource

        public org.pentaho.commons.connection.IPentahoStreamSource getDataSource​(String parameterName)
        Specified by:
        getDataSource in interface org.pentaho.platform.api.engine.IRuntimeContext
      • getComponentClassMap

        protected static Map getComponentClassMap()
      • setCurrentComponent

        protected void setCurrentComponent​(String componentClassName)
      • setCurrentActionDef

        protected void setCurrentActionDef​(org.pentaho.platform.api.engine.ISolutionActionDefinition actionDefinition)
      • getComponentClassName

        protected static String getComponentClassName​(String rawClassName,
                                                      org.pentaho.platform.api.engine.IRuntimeContext runtime)
      • executeSequence

        public void executeSequence​(org.pentaho.platform.api.engine.IActionCompleteListener doneListener,
                                    org.pentaho.platform.api.engine.IExecutionListener execListener,
                                    boolean async)
                             throws org.pentaho.platform.api.engine.ActionSequenceException
        Specified by:
        executeSequence in interface org.pentaho.platform.api.engine.IRuntimeContext
        Throws:
        org.pentaho.platform.api.engine.ActionSequenceException
      • setPromptStatus

        public void setPromptStatus​(int status)
        Specified by:
        setPromptStatus in interface org.pentaho.platform.api.engine.IRuntimeContext
      • executeSequence

        public void executeSequence​(org.pentaho.platform.api.engine.IActionSequence sequence,
                                    org.pentaho.platform.api.engine.IActionCompleteListener doneListener,
                                    org.pentaho.platform.api.engine.IExecutionListener execListener,
                                    boolean async)
                             throws org.pentaho.platform.api.engine.ActionSequenceException
        Throws:
        org.pentaho.platform.api.engine.ActionSequenceException
      • executeComponent

        protected void executeComponent​(org.pentaho.platform.api.engine.ISolutionActionDefinition actionDefinition)
                                 throws org.pentaho.platform.api.engine.ActionExecutionException
        Throws:
        org.pentaho.platform.api.engine.ActionExecutionException
      • dispose

        public void dispose()
        Specified by:
        dispose in interface org.pentaho.platform.api.engine.IRuntimeContext
      • dispose

        public void dispose​(List actionParameters)
        Specified by:
        dispose in interface org.pentaho.platform.api.engine.IRuntimeContext
      • getStringParameter

        public String getStringParameter​(String name,
                                         String defaultValue)
      • getInputParameterValue

        public Object getInputParameterValue​(String name)
        Specified by:
        getInputParameterValue in interface org.pentaho.platform.api.engine.IRuntimeContext
      • getInputParameterStringValue

        public String getInputParameterStringValue​(String name)
        Specified by:
        getInputParameterStringValue in interface org.pentaho.platform.api.engine.IRuntimeContext
      • getInputParameter

        public org.pentaho.platform.api.engine.IActionParameter getInputParameter​(String name)
        Specified by:
        getInputParameter in interface org.pentaho.platform.api.engine.IRuntimeContext
      • getOutputParameter

        public org.pentaho.platform.api.engine.IActionParameter getOutputParameter​(String name)
        Specified by:
        getOutputParameter in interface org.pentaho.platform.api.engine.IRuntimeContext
      • getResourceDefintion

        public org.pentaho.platform.api.engine.IActionSequenceResource getResourceDefintion​(String name)
        Specified by:
        getResourceDefintion in interface org.pentaho.platform.api.engine.IRuntimeContext
      • getInputNames

        public Set getInputNames()
        Specified by:
        getInputNames in interface org.pentaho.platform.api.engine.IRuntimeContext
      • addTempParameter

        public void addTempParameter​(String name,
                                     org.pentaho.platform.api.engine.IActionParameter param)
        Specified by:
        addTempParameter in interface org.pentaho.platform.api.engine.IRuntimeContext
      • setOutputValue

        public void setOutputValue​(String name,
                                   Object output)
        Specified by:
        setOutputValue in interface org.pentaho.platform.api.engine.IRuntimeContext
      • getInputStream

        public InputStream getInputStream​(String parameterName)
        Specified by:
        getInputStream in interface org.pentaho.platform.api.engine.IRuntimeContext
      • getOutputNames

        public Set getOutputNames()
        Specified by:
        getOutputNames in interface org.pentaho.platform.api.engine.IRuntimeContext
      • getResourceNames

        public Set getResourceNames()
        Specified by:
        getResourceNames in interface org.pentaho.platform.api.engine.IRuntimeContext
      • getResourceInputStream

        public InputStream getResourceInputStream​(org.pentaho.platform.api.engine.IActionSequenceResource actionResource)
                                           throws FileNotFoundException
        Specified by:
        getResourceInputStream in interface org.pentaho.platform.api.engine.IRuntimeContext
        Throws:
        FileNotFoundException
      • getResourceAsString

        public String getResourceAsString​(org.pentaho.platform.api.engine.IActionSequenceResource actionResource)
                                   throws IOException
        Specified by:
        getResourceAsString in interface org.pentaho.platform.api.engine.IRuntimeContext
        Throws:
        IOException
      • getResourceAsDocument

        public org.dom4j.Document getResourceAsDocument​(org.pentaho.platform.api.engine.IActionSequenceResource actionResource)
                                                 throws IOException
        Specified by:
        getResourceAsDocument in interface org.pentaho.platform.api.engine.IRuntimeContext
        Throws:
        IOException
      • getResourceDataSource

        public org.pentaho.commons.connection.IPentahoStreamSource getResourceDataSource​(org.pentaho.platform.api.engine.IActionSequenceResource actionResource)
                                                                                  throws FileNotFoundException
        Specified by:
        getResourceDataSource in interface org.pentaho.platform.api.engine.IRuntimeContext
        Throws:
        FileNotFoundException
      • getId

        public String getId()
        Specified by:
        getId in interface org.pentaho.platform.api.engine.IAuditable
      • getProcessId

        public String getProcessId()
        Specified by:
        getProcessId in interface org.pentaho.platform.api.engine.IAuditable
      • getActionName

        public String getActionName()
        Specified by:
        getActionName in interface org.pentaho.platform.api.engine.IAuditable
      • getActionTitle

        public String getActionTitle()
        Specified by:
        getActionTitle in interface org.pentaho.platform.api.engine.IRuntimeContext
      • audit

        public void audit​(List auditList)
      • audit

        public void audit​(String messageType,
                          String message,
                          String value,
                          long duration)
        Specified by:
        audit in interface org.pentaho.platform.api.engine.IRuntimeContext
      • addInputParameter

        public void addInputParameter​(String name,
                                      org.pentaho.platform.api.engine.IActionParameter param)
        Specified by:
        addInputParameter in interface org.pentaho.platform.api.engine.IRuntimeContext
      • applyInputsToFormat

        public String applyInputsToFormat​(String format)
        Specified by:
        applyInputsToFormat in interface org.pentaho.platform.api.engine.IRuntimeContext
      • applyInputsToFormat

        public String applyInputsToFormat​(String format,
                                          org.pentaho.platform.api.engine.IParameterResolver resolver)
        Specified by:
        applyInputsToFormat in interface org.pentaho.platform.api.engine.IRuntimeContext
      • sendFeedbackForm

        public void sendFeedbackForm()
                              throws org.pentaho.platform.api.engine.ActionSequencePromptException
        Specified by:
        sendFeedbackForm in interface org.pentaho.platform.api.engine.IRuntimeContext
        Throws:
        org.pentaho.platform.api.engine.ActionSequencePromptException
      • createFeedbackParameter

        @Deprecated
        public void createFeedbackParameter​(org.pentaho.platform.api.engine.IActionParameter actionParam)
        Deprecated.
        Unused
        Specified by:
        createFeedbackParameter in interface org.pentaho.platform.api.engine.IRuntimeContext
      • createFeedbackParameter

        public void createFeedbackParameter​(org.pentaho.platform.api.engine.ISelectionMapper selMap,
                                            String fieldName,
                                            Object defaultValues)
        Specified by:
        createFeedbackParameter in interface org.pentaho.platform.api.engine.IRuntimeContext
      • createFeedbackParameter

        public void createFeedbackParameter​(org.pentaho.platform.api.engine.ISelectionMapper selMap,
                                            String fieldName,
                                            Object defaultValues,
                                            boolean optional)
        Specified by:
        createFeedbackParameter in interface org.pentaho.platform.api.engine.IRuntimeContext
      • createFeedbackParameter

        public void createFeedbackParameter​(String fieldName,
                                            String displayName,
                                            String hint,
                                            Object defaultValues,
                                            List values,
                                            Map dispNames,
                                            String displayStyle)
        Specified by:
        createFeedbackParameter in interface org.pentaho.platform.api.engine.IRuntimeContext
      • createFeedbackParameter

        public void createFeedbackParameter​(String fieldName,
                                            String displayName,
                                            String hint,
                                            Object defaultValues,
                                            List values,
                                            Map dispNames,
                                            String displayStyle,
                                            boolean optional)
        Specified by:
        createFeedbackParameter in interface org.pentaho.platform.api.engine.IRuntimeContext
      • checkForFieldInTemplate

        public boolean checkForFieldInTemplate​(String fieldName)
      • createFeedbackParameter

        public void createFeedbackParameter​(String fieldName,
                                            String displayName,
                                            String hint,
                                            Object defaultValue,
                                            boolean visible)
        Specified by:
        createFeedbackParameter in interface org.pentaho.platform.api.engine.IRuntimeContext
      • createFeedbackParameter

        public void createFeedbackParameter​(String fieldName,
                                            String displayName,
                                            String hint,
                                            Object defaultValue,
                                            boolean visible,
                                            boolean optional)
        Specified by:
        createFeedbackParameter in interface org.pentaho.platform.api.engine.IRuntimeContext
      • setParameterXsl

        public void setParameterXsl​(String xsl)
        Specified by:
        setParameterXsl in interface org.pentaho.platform.api.engine.IRuntimeContext
      • setParameterTarget

        public void setParameterTarget​(String target)
        Specified by:
        setParameterTarget in interface org.pentaho.platform.api.engine.IRuntimeContext
      • 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 org.pentaho.platform.api.engine.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 org.pentaho.platform.api.engine.IRuntimeContext
        Returns:
        Output type
      • setOutputHandler

        public void setOutputHandler​(org.pentaho.platform.api.engine.IOutputHandler outputHandler)
        Specified by:
        setOutputHandler in interface org.pentaho.platform.api.engine.IRuntimeContext
      • getActionSequence

        public org.pentaho.platform.api.engine.IActionSequence getActionSequence()
        Specified by:
        getActionSequence in interface org.pentaho.platform.api.engine.IRuntimeContext
      • getParameterManager

        public org.pentaho.platform.api.engine.IParameterManager getParameterManager()
        Specified by:
        getParameterManager in interface org.pentaho.platform.api.engine.IRuntimeContext
      • getParameterProviders

        public Map getParameterProviders()
        Specified by:
        getParameterProviders in interface org.pentaho.platform.api.engine.IRuntimeContext
      • setCreateFeedbackParameterCallback

        public void setCreateFeedbackParameterCallback​(org.pentaho.platform.api.engine.ICreateFeedbackParameterCallback callback)
        Specified by:
        setCreateFeedbackParameterCallback in interface org.pentaho.platform.api.engine.IRuntimeContext
      • getOutputContentItems

        public List<org.pentaho.platform.api.repository.IContentItem> getOutputContentItems()
        Specified by:
        getOutputContentItems in interface org.pentaho.platform.api.engine.IRuntimeContext