Class ComponentBase

  • All Implemented Interfaces:
    Serializable, org.pentaho.platform.api.engine.IAuditable, org.pentaho.platform.api.engine.IComponent, org.pentaho.platform.api.engine.ILogger, org.pentaho.platform.api.engine.IParameterResolver
    Direct Known Subclasses:
    ActionDelegate, PojoComponent

    public abstract class ComponentBase
    extends PentahoMessenger
    implements org.pentaho.platform.api.engine.IComponent, org.pentaho.platform.api.engine.IParameterResolver
    See Also:
    Serialized Form
    • Constructor Detail

      • ComponentBase

        public ComponentBase()
    • Method Detail

      • setInstanceId

        public void setInstanceId​(String instanceId)
        Specified by:
        setInstanceId in interface org.pentaho.platform.api.engine.IComponent
      • getInstanceId

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

        public void setActionName​(String actionName)
        Specified by:
        setActionName in interface org.pentaho.platform.api.engine.IComponent
      • getActionName

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

        public void setProcessId​(String processId)
        Specified by:
        setProcessId in interface org.pentaho.platform.api.engine.IComponent
      • getProcessId

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

        public void setComponentDefinition​(org.dom4j.Node componentDefinition)
        Specified by:
        setComponentDefinition in interface org.pentaho.platform.api.engine.IComponent
      • setComponentDefinitionMap

        public void setComponentDefinitionMap​(Map<String,​String> componentDefinitionMap)
        Specified by:
        setComponentDefinitionMap in interface org.pentaho.platform.api.engine.IComponent
      • getComponentDefinition

        public org.dom4j.Node getComponentDefinition()
        Specified by:
        getComponentDefinition in interface org.pentaho.platform.api.engine.IComponent
      • getComponentDefinition

        public org.dom4j.Node getComponentDefinition​(boolean process)
        Return the xml Node containing the component's definition. If process is true, visit every child node in the tree, and if the child node's text is an action parameter convert it to it's value. (See doc for applyInputsToFormat())
        Parameters:
        process - if true, if the node's text represents a parameter, convert the parameter to it's value, and assign the value to the node's text.
        Returns:
        Node containing this component's definition.
      • setRuntimeContext

        public void setRuntimeContext​(org.pentaho.platform.api.engine.IRuntimeContext runtimeContext)
        Specified by:
        setRuntimeContext in interface org.pentaho.platform.api.engine.IComponent
      • getRuntimeContext

        public org.pentaho.platform.api.engine.IRuntimeContext getRuntimeContext()
        Specified by:
        getRuntimeContext in interface org.pentaho.platform.api.engine.IComponent
      • setSession

        public void setSession​(org.pentaho.platform.api.engine.IPentahoSession session)
        Specified by:
        setSession in interface org.pentaho.platform.api.engine.IComponent
      • getSession

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

        protected void saveSetting​(String name,
                                   Object value)
      • getStringSetting

        protected String getStringSetting​(String name)
      • validateAction

        protected abstract boolean validateAction()
      • validateSystemSettings

        protected abstract boolean validateSystemSettings()
      • done

        public abstract void done()
        Specified by:
        done in interface org.pentaho.platform.api.engine.IComponent
      • executeAction

        protected abstract boolean executeAction()
                                          throws Throwable
        Throws:
        Throwable
      • init

        public abstract boolean init()
        Specified by:
        init in interface org.pentaho.platform.api.engine.IComponent
      • isDefinedInput

        protected boolean isDefinedInput​(String inputName)
      • isDefinedOutput

        protected boolean isDefinedOutput​(String outputName)
      • isDefinedResource

        protected boolean isDefinedResource​(String resourceName)
      • validate

        public final int validate()
        Specified by:
        validate in interface org.pentaho.platform.api.engine.IComponent
      • resolveParameter

        public int resolveParameter​(String template,
                                    String parameterName,
                                    Matcher parameterMatcher,
                                    int copyStart,
                                    StringBuffer result)
        Specified by:
        resolveParameter in interface org.pentaho.platform.api.engine.IParameterResolver
      • getInitOk

        public boolean getInitOk()
      • getOutputNames

        protected Set getOutputNames()
      • getInputNames

        protected Set getInputNames()
      • getResourceNames

        protected Set getResourceNames()
      • feedbackAllowed

        protected boolean feedbackAllowed()
      • getResource

        protected org.pentaho.platform.api.engine.IActionSequenceResource getResource​(String resourceName)
      • getOutputPreference

        protected int getOutputPreference()
      • audit

        protected void audit​(String messageType,
                             String message,
                             String value,
                             int duration)
      • getInputBooleanValue

        protected boolean getInputBooleanValue​(String inputName,
                                               boolean defaultValue)
      • getInputLongValue

        protected long getInputLongValue​(String inputName,
                                         long defaultValue)
      • getInputStringValue

        protected String getInputStringValue​(String inputName)
      • getInputStringValue

        protected String getInputStringValue​(String inputName,
                                             boolean applyTemplates)
      • getInputValue

        protected Object getInputValue​(String inputName)
      • promptNeeded

        public void promptNeeded()
      • promptNow

        public void promptNow()
      • getResourceAsString

        public String getResourceAsString​(org.pentaho.platform.api.engine.IActionSequenceResource resource)
      • getInitFailMessage

        public String getInitFailMessage()
      • createNewInstance

        public String createNewInstance​(boolean persisted,
                                        Map parameters,
                                        boolean forceImmediateWrite)
      • inputMissingError

        public void inputMissingError​(String paramName)
      • outputMissingError

        public void outputMissingError​(String paramName)
      • resourceMissingError

        public void resourceMissingError​(String paramName)
      • resourceComponentSettingError

        public void resourceComponentSettingError​(String paramName)
      • execute

        public int execute()
        Specified by:
        execute in interface org.pentaho.platform.api.engine.IComponent
      • getObjectName

        public String getObjectName()
        Specified by:
        getObjectName in interface org.pentaho.platform.api.engine.IAuditable
        Overrides:
        getObjectName in class PentahoBase
      • getId

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

        public String getActionTitle()
      • getOutputContentItem

        @Deprecated
        protected org.pentaho.platform.api.repository.IContentItem getOutputContentItem​(String mimeType)
        Deprecated.
      • getOutputContentItem

        protected org.pentaho.platform.api.repository.IContentItem getOutputContentItem​(String outputName,
                                                                                        String mimeType)
      • getContentOutputItem

        protected org.pentaho.platform.api.repository.IContentItem getContentOutputItem​(String outputName,
                                                                                        String mimeType)
      • getOutputItem

        protected org.pentaho.platform.api.repository.IContentItem getOutputItem​(String outputName,
                                                                                 String mimeType,
                                                                                 String extension)
      • setOutputValue

        protected void setOutputValue​(String outputName,
                                      Object value)
      • addTempParameter

        protected void addTempParameter​(String name,
                                        org.pentaho.platform.api.engine.IActionParameter param)
      • addTempParameterObject

        protected void addTempParameterObject​(String name,
                                              Object paramObject)
      • applyInputsToFormat

        protected String applyInputsToFormat​(String format)
      • getOutputItem

        protected org.pentaho.platform.api.engine.IActionParameter getOutputItem​(String outputName)
      • getSolutionName

        protected String getSolutionName()
      • getSolutionPath

        protected String getSolutionPath()
      • getInputParameter

        protected org.pentaho.platform.api.engine.IActionParameter getInputParameter​(String parameterName)
      • isPromptPending

        protected boolean isPromptPending()
      • setFeedbackMimeType

        protected void setFeedbackMimeType​(String mimeType)
      • setOutputMimeType

        @Deprecated
        protected void setOutputMimeType​(String mimeType)
        Deprecated.
      • setOutputMimeType

        protected void setOutputMimeType​(String outputName,
                                         String mimeType)
      • getFeedbackOutputStream

        protected OutputStream getFeedbackOutputStream()
      • createFeedbackParameter

        @Deprecated
        protected void createFeedbackParameter​(org.pentaho.platform.api.engine.IActionParameter actionParam)
        Deprecated.
        Parameters:
        actionParam -
      • createFeedbackParameter

        protected void createFeedbackParameter​(org.pentaho.platform.api.engine.ISelectionMapper selMap,
                                               String fieldName,
                                               Object defaultValues)
      • createFeedbackParameter

        protected void createFeedbackParameter​(org.pentaho.platform.api.engine.ISelectionMapper selMap,
                                               String fieldName,
                                               Object defaultValues,
                                               boolean optional)
      • createFeedbackParameter

        protected void createFeedbackParameter​(String fieldName,
                                               String displayName,
                                               String hint,
                                               String defaultValue,
                                               boolean visible)
      • createFeedbackParameter

        protected void createFeedbackParameter​(String fieldName,
                                               String displayName,
                                               String hint,
                                               String defaultValue,
                                               boolean visible,
                                               boolean optional)
      • createFeedbackParameter

        public void createFeedbackParameter​(String fieldName,
                                            String displayName,
                                            String hint,
                                            Object defaultValues,
                                            List values,
                                            Map dispNames,
                                            String displayStyle)
      • createFeedbackParameter

        public void createFeedbackParameter​(String fieldName,
                                            String displayName,
                                            String hint,
                                            Object defaultValues,
                                            List values,
                                            Map dispNames,
                                            String displayStyle,
                                            boolean optional)
      • getResourceDataSource

        protected org.pentaho.commons.connection.IPentahoStreamSource getResourceDataSource​(org.pentaho.platform.api.engine.IActionSequenceResource resource)
                                                                                     throws FileNotFoundException
        Throws:
        FileNotFoundException
      • setActionDefinition

        public void setActionDefinition​(org.pentaho.actionsequence.dom.IActionDefinition actionDefinition)
        Specified by:
        setActionDefinition in interface org.pentaho.platform.api.engine.IComponent
      • getActionDefinition

        public org.pentaho.actionsequence.dom.IActionDefinition getActionDefinition()
        Specified by:
        getActionDefinition in interface org.pentaho.platform.api.engine.IComponent