Class ComponentBase
- java.lang.Object
-
- org.pentaho.platform.engine.core.system.PentahoBase
-
- org.pentaho.platform.engine.services.PentahoMessenger
-
- org.pentaho.platform.engine.services.solution.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
-
-
Field Summary
Fields Modifier and Type Field Description static String
COMPONENT_EXECUTE_FAIL
protected static boolean
debug
static String
MISSING_SESSION
protected static String
UNKNOWN_COMPONENT_ID
-
Fields inherited from class org.pentaho.platform.engine.core.system.PentahoBase
EMPTYLOGID, loggingLevel, LOGID_MASK1, LOGID_MASK2, LOGID_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description ComponentBase()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
addTempParameter(String name, org.pentaho.platform.api.engine.IActionParameter param)
protected void
addTempParameterObject(String name, Object paramObject)
protected String
applyInputsToFormat(String format)
protected void
audit(String messageType, String message, String value, int duration)
void
createFeedbackParameter(String fieldName, String displayName, String hint, Object defaultValues, List values, Map dispNames, String displayStyle)
void
createFeedbackParameter(String fieldName, String displayName, String hint, Object defaultValues, List values, Map dispNames, String displayStyle, boolean optional)
protected void
createFeedbackParameter(String fieldName, String displayName, String hint, String defaultValue, boolean visible)
protected void
createFeedbackParameter(String fieldName, String displayName, String hint, String defaultValue, boolean visible, boolean optional)
protected void
createFeedbackParameter(org.pentaho.platform.api.engine.IActionParameter actionParam)
Deprecated.protected void
createFeedbackParameter(org.pentaho.platform.api.engine.ISelectionMapper selMap, String fieldName, Object defaultValues)
protected void
createFeedbackParameter(org.pentaho.platform.api.engine.ISelectionMapper selMap, String fieldName, Object defaultValues, boolean optional)
String
createNewInstance(boolean persisted, Map parameters, boolean forceImmediateWrite)
abstract void
done()
int
execute()
protected abstract boolean
executeAction()
protected boolean
feedbackAllowed()
org.pentaho.actionsequence.dom.IActionDefinition
getActionDefinition()
String
getActionName()
String
getActionTitle()
org.dom4j.Node
getComponentDefinition()
org.dom4j.Node
getComponentDefinition(boolean process)
Return the xml Node containing the component's definition.protected org.pentaho.platform.api.repository.IContentItem
getContentOutputItem(String outputName, String mimeType)
protected OutputStream
getDefaultOutputStream(String mimeType)
Deprecated.protected OutputStream
getFeedbackOutputStream()
String
getId()
String
getInitFailMessage()
boolean
getInitOk()
protected boolean
getInputBooleanValue(String inputName, boolean defaultValue)
protected long
getInputLongValue(String inputName, long defaultValue)
protected Set
getInputNames()
protected org.pentaho.platform.api.engine.IActionParameter
getInputParameter(String parameterName)
protected InputStream
getInputStream(String inputName)
protected String
getInputStringValue(String inputName)
protected String
getInputStringValue(String inputName, boolean applyTemplates)
protected Object
getInputValue(String inputName)
String
getInstanceId()
String
getLogId()
String
getObjectName()
protected org.pentaho.platform.api.repository.IContentItem
getOutputContentItem(String mimeType)
Deprecated.protected org.pentaho.platform.api.repository.IContentItem
getOutputContentItem(String outputName, String mimeType)
protected org.pentaho.platform.api.engine.IActionParameter
getOutputItem(String outputName)
protected org.pentaho.platform.api.repository.IContentItem
getOutputItem(String outputName, String mimeType, String extension)
protected Set
getOutputNames()
protected int
getOutputPreference()
String
getProcessId()
protected org.pentaho.platform.api.engine.IActionSequenceResource
getResource(String resourceName)
String
getResourceAsString(org.pentaho.platform.api.engine.IActionSequenceResource resource)
protected org.pentaho.commons.connection.IPentahoStreamSource
getResourceDataSource(org.pentaho.platform.api.engine.IActionSequenceResource resource)
protected InputStream
getResourceInputStream(org.pentaho.platform.api.engine.IActionSequenceResource resource)
protected Set
getResourceNames()
org.pentaho.platform.api.engine.IRuntimeContext
getRuntimeContext()
org.pentaho.platform.api.engine.IPentahoSession
getSession()
protected Object
getSetting(String name)
protected String
getSolutionName()
protected String
getSolutionPath()
protected String
getStringSetting(String name)
abstract boolean
init()
void
inputMissingError(String paramName)
protected boolean
isDefinedInput(String inputName)
protected boolean
isDefinedOutput(String outputName)
protected boolean
isDefinedResource(String resourceName)
protected boolean
isPromptPending()
void
outputMissingError(String paramName)
void
promptNeeded()
void
promptNow()
int
resolveParameter(String template, String parameterName, Matcher parameterMatcher, int copyStart, StringBuffer result)
void
resourceComponentSettingError(String paramName)
void
resourceMissingError(String paramName)
protected void
saveSetting(String name, Object value)
void
setActionDefinition(org.pentaho.actionsequence.dom.IActionDefinition actionDefinition)
void
setActionName(String actionName)
void
setComponentDefinition(org.dom4j.Node componentDefinition)
void
setComponentDefinitionMap(Map<String,String> componentDefinitionMap)
protected void
setFeedbackMimeType(String mimeType)
void
setInstanceId(String instanceId)
protected void
setOutputMimeType(String mimeType)
Deprecated.protected void
setOutputMimeType(String outputName, String mimeType)
protected void
setOutputValue(String outputName, Object value)
void
setProcessId(String processId)
void
setRuntimeContext(org.pentaho.platform.api.engine.IRuntimeContext runtimeContext)
void
setSession(org.pentaho.platform.api.engine.IPentahoSession session)
int
validate()
protected abstract boolean
validateAction()
protected abstract boolean
validateSystemSettings()
-
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, getLogger, getLoggingLevel, setLoggingLevel, setLogId
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
UNKNOWN_COMPONENT_ID
protected static final String UNKNOWN_COMPONENT_ID
- See Also:
- Constant Field Values
-
MISSING_SESSION
public static final String MISSING_SESSION
- See Also:
- Constant Field Values
-
COMPONENT_EXECUTE_FAIL
public static final String COMPONENT_EXECUTE_FAIL
- See Also:
- Constant Field Values
-
debug
protected static final boolean debug
- See Also:
- Constant Field Values
-
-
Method Detail
-
setInstanceId
public void setInstanceId(String instanceId)
- Specified by:
setInstanceId
in interfaceorg.pentaho.platform.api.engine.IComponent
-
getInstanceId
public String getInstanceId()
- Specified by:
getInstanceId
in interfaceorg.pentaho.platform.api.engine.IComponent
-
setActionName
public void setActionName(String actionName)
- Specified by:
setActionName
in interfaceorg.pentaho.platform.api.engine.IComponent
-
getActionName
public String getActionName()
- Specified by:
getActionName
in interfaceorg.pentaho.platform.api.engine.IAuditable
- Specified by:
getActionName
in interfaceorg.pentaho.platform.api.engine.IComponent
-
setProcessId
public void setProcessId(String processId)
- Specified by:
setProcessId
in interfaceorg.pentaho.platform.api.engine.IComponent
-
getProcessId
public String getProcessId()
- Specified by:
getProcessId
in interfaceorg.pentaho.platform.api.engine.IAuditable
- Specified by:
getProcessId
in interfaceorg.pentaho.platform.api.engine.IComponent
-
setComponentDefinition
public void setComponentDefinition(org.dom4j.Node componentDefinition)
- Specified by:
setComponentDefinition
in interfaceorg.pentaho.platform.api.engine.IComponent
-
setComponentDefinitionMap
public void setComponentDefinitionMap(Map<String,String> componentDefinitionMap)
- Specified by:
setComponentDefinitionMap
in interfaceorg.pentaho.platform.api.engine.IComponent
-
getComponentDefinition
public org.dom4j.Node getComponentDefinition()
- Specified by:
getComponentDefinition
in interfaceorg.pentaho.platform.api.engine.IComponent
-
getComponentDefinition
public org.dom4j.Node getComponentDefinition(boolean process)
Return the xml Node containing the component's definition. Ifprocess
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 interfaceorg.pentaho.platform.api.engine.IComponent
-
getRuntimeContext
public org.pentaho.platform.api.engine.IRuntimeContext getRuntimeContext()
- Specified by:
getRuntimeContext
in interfaceorg.pentaho.platform.api.engine.IComponent
-
setSession
public void setSession(org.pentaho.platform.api.engine.IPentahoSession session)
- Specified by:
setSession
in interfaceorg.pentaho.platform.api.engine.IComponent
-
getSession
public org.pentaho.platform.api.engine.IPentahoSession getSession()
- Specified by:
getSession
in interfaceorg.pentaho.platform.api.engine.IComponent
-
validateAction
protected abstract boolean validateAction()
-
validateSystemSettings
protected abstract boolean validateSystemSettings()
-
done
public abstract void done()
- Specified by:
done
in interfaceorg.pentaho.platform.api.engine.IComponent
-
init
public abstract boolean init()
- Specified by:
init
in interfaceorg.pentaho.platform.api.engine.IComponent
-
getLogId
public String getLogId()
- Overrides:
getLogId
in classPentahoBase
-
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 interfaceorg.pentaho.platform.api.engine.IComponent
-
resolveParameter
public int resolveParameter(String template, String parameterName, Matcher parameterMatcher, int copyStart, StringBuffer result)
- Specified by:
resolveParameter
in interfaceorg.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)
-
getResourceInputStream
protected InputStream getResourceInputStream(org.pentaho.platform.api.engine.IActionSequenceResource resource) throws FileNotFoundException
- Throws:
FileNotFoundException
-
getInputStream
protected InputStream getInputStream(String inputName)
-
getOutputPreference
protected int getOutputPreference()
-
getInputBooleanValue
protected boolean getInputBooleanValue(String inputName, boolean defaultValue)
-
getInputLongValue
protected long getInputLongValue(String inputName, long defaultValue)
-
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 interfaceorg.pentaho.platform.api.engine.IComponent
-
getObjectName
public String getObjectName()
- Specified by:
getObjectName
in interfaceorg.pentaho.platform.api.engine.IAuditable
- Overrides:
getObjectName
in classPentahoBase
-
getId
public String getId()
- Specified by:
getId
in interfaceorg.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)
-
addTempParameter
protected void addTempParameter(String name, org.pentaho.platform.api.engine.IActionParameter param)
-
getDefaultOutputStream
@Deprecated protected OutputStream getDefaultOutputStream(String mimeType)
Deprecated.- Returns:
-
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.
-
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 interfaceorg.pentaho.platform.api.engine.IComponent
-
getActionDefinition
public org.pentaho.actionsequence.dom.IActionDefinition getActionDefinition()
- Specified by:
getActionDefinition
in interfaceorg.pentaho.platform.api.engine.IComponent
-
-