Class ComponentImplementationExample
- java.lang.Object
-
- org.pentaho.platform.plugin.action.examples.ComponentImplementationExample
-
- All Implemented Interfaces:
org.pentaho.platform.api.engine.IAuditable
,org.pentaho.platform.api.engine.IComponent
,org.pentaho.platform.api.engine.ILogger
public class ComponentImplementationExample extends Object implements org.pentaho.platform.api.engine.IComponent
-
-
Field Summary
Fields Modifier and Type Field Description protected static boolean
debug
String
EMPTYLOGID
protected int
loggingLevel
static String
LOGID_MASK1
static String
LOGID_MASK2
static String
LOGID_SEPARATOR
-
Constructor Summary
Constructors Constructor Description ComponentImplementationExample()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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)
protected void
createFeedbackParameter(String fieldName, String displayName, String hint, String defaultValue, boolean visible)
protected void
createFeedbackParameter(org.pentaho.platform.api.engine.IActionParameter actionParam)
protected void
createFeedbackParameter(org.pentaho.platform.api.engine.ISelectionMapper selMap, String fieldName, Object defaultValues)
String
createNewInstance(boolean persisted, Map parameters, boolean forceImmediateWrite)
void
debug(String message)
void
debug(String message, Throwable error)
void
done()
void
error(String message)
void
error(String message, Throwable error)
int
execute()
protected boolean
executeAction()
void
fatal(String message)
void
fatal(String message, Throwable error)
protected boolean
feedbackAllowed()
void
genLogIdFromInfo(String sessId, String procId, String actName)
void
genLogIdFromInfo(String sessId, String procId, String actName, String instId)
void
genLogIdFromSession(org.pentaho.platform.api.engine.IPentahoSession sess)
org.pentaho.actionsequence.dom.IActionDefinition
getActionDefinition()
String
getActionName()
String
getActionTitle()
org.dom4j.Node
getComponentDefinition()
protected OutputStream
getDefaultOutputStream(String mimeType)
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 Object
getInputValue(String inputName)
String
getInstanceId()
org.apache.commons.logging.Log
getLogger()
int
getLoggingLevel()
String
getLogId()
List
getMessages()
String
getObjectName()
protected org.pentaho.platform.api.repository.IContentItem
getOutputContentItem(String mimeType)
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)
static String
getUserString(String type)
void
info(String message)
void
info(String message, Throwable error)
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()
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)
void
setLoggingLevel(int logLevel)
void
setLogId(String lId)
void
setMessages(List messages)
protected void
setOutputMimeType(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)
void
trace(String message)
void
trace(String message, Throwable error)
int
validate()
boolean
validateAction()
protected boolean
validateSystemSettings()
void
warn(String message)
void
warn(String message, Throwable error)
-
-
-
Field Detail
-
loggingLevel
protected int loggingLevel
-
LOGID_MASK1
public static final String LOGID_MASK1
- See Also:
- Constant Field Values
-
LOGID_MASK2
public static final String LOGID_MASK2
- See Also:
- Constant Field Values
-
LOGID_SEPARATOR
public static final String LOGID_SEPARATOR
- See Also:
- Constant Field Values
-
EMPTYLOGID
public String EMPTYLOGID
-
debug
protected static final boolean debug
- See Also:
- Constant Field Values
-
-
Method Detail
-
validateAction
public boolean validateAction()
-
validateSystemSettings
protected boolean validateSystemSettings()
-
done
public void done()
- Specified by:
done
in interfaceorg.pentaho.platform.api.engine.IComponent
-
init
public boolean init()
- Specified by:
init
in interfaceorg.pentaho.platform.api.engine.IComponent
-
setLogId
public void setLogId(String lId)
-
getLogger
public org.apache.commons.logging.Log getLogger()
-
genLogIdFromSession
public void genLogIdFromSession(org.pentaho.platform.api.engine.IPentahoSession sess)
-
genLogIdFromInfo
public void genLogIdFromInfo(String sessId, String procId, String actName, String instId)
-
getObjectName
public String getObjectName()
- Specified by:
getObjectName
in interfaceorg.pentaho.platform.api.engine.IAuditable
-
getLoggingLevel
public int getLoggingLevel()
- Specified by:
getLoggingLevel
in interfaceorg.pentaho.platform.api.engine.ILogger
-
setLoggingLevel
public void setLoggingLevel(int logLevel)
- Specified by:
setLoggingLevel
in interfaceorg.pentaho.platform.api.engine.ILogger
-
getMessages
public List getMessages()
- Specified by:
getMessages
in interfaceorg.pentaho.platform.api.engine.IComponent
-
setMessages
public void setMessages(List messages)
- Specified by:
setMessages
in interfaceorg.pentaho.platform.api.engine.IComponent
-
trace
public void trace(String message)
- Specified by:
trace
in interfaceorg.pentaho.platform.api.engine.ILogger
-
debug
public void debug(String message)
- Specified by:
debug
in interfaceorg.pentaho.platform.api.engine.ILogger
-
info
public void info(String message)
- Specified by:
info
in interfaceorg.pentaho.platform.api.engine.ILogger
-
warn
public void warn(String message)
- Specified by:
warn
in interfaceorg.pentaho.platform.api.engine.ILogger
-
error
public void error(String message)
- Specified by:
error
in interfaceorg.pentaho.platform.api.engine.ILogger
-
fatal
public void fatal(String message)
- Specified by:
fatal
in interfaceorg.pentaho.platform.api.engine.ILogger
-
trace
public void trace(String message, Throwable error)
- Specified by:
trace
in interfaceorg.pentaho.platform.api.engine.ILogger
-
debug
public void debug(String message, Throwable error)
- Specified by:
debug
in interfaceorg.pentaho.platform.api.engine.ILogger
-
info
public void info(String message, Throwable error)
- Specified by:
info
in interfaceorg.pentaho.platform.api.engine.ILogger
-
warn
public void warn(String message, Throwable error)
- Specified by:
warn
in interfaceorg.pentaho.platform.api.engine.ILogger
-
error
public void error(String message, Throwable error)
- Specified by:
error
in interfaceorg.pentaho.platform.api.engine.ILogger
-
fatal
public void fatal(String message, Throwable error)
- Specified by:
fatal
in interfaceorg.pentaho.platform.api.engine.ILogger
-
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
-
setComponentDefinitionMap
public void setComponentDefinitionMap(Map<String,String> componentDefinitionMap)
- Specified by:
setComponentDefinitionMap
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
-
getComponentDefinition
public org.dom4j.Node getComponentDefinition()
- Specified by:
getComponentDefinition
in interfaceorg.pentaho.platform.api.engine.IComponent
-
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
-
getLogId
public String getLogId()
-
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
-
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()
-
getOutputItem
protected org.pentaho.platform.api.repository.IContentItem getOutputItem(String outputName, String mimeType, String extension)
-
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
-
getId
public String getId()
- Specified by:
getId
in interfaceorg.pentaho.platform.api.engine.IAuditable
-
getActionTitle
public String getActionTitle()
-
getOutputContentItem
protected org.pentaho.platform.api.repository.IContentItem getOutputContentItem(String mimeType)
-
getOutputContentItem
protected org.pentaho.platform.api.repository.IContentItem getOutputContentItem(String outputName, String mimeType)
-
getDefaultOutputStream
protected OutputStream getDefaultOutputStream(String mimeType)
-
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
protected void setOutputMimeType(String mimeType)
-
getFeedbackOutputStream
protected OutputStream getFeedbackOutputStream()
-
createFeedbackParameter
protected void createFeedbackParameter(org.pentaho.platform.api.engine.IActionParameter actionParam)
-
createFeedbackParameter
protected void createFeedbackParameter(org.pentaho.platform.api.engine.ISelectionMapper selMap, String fieldName, Object defaultValues)
-
createFeedbackParameter
protected void createFeedbackParameter(String fieldName, String displayName, String hint, String defaultValue, boolean visible)
-
createFeedbackParameter
public void createFeedbackParameter(String fieldName, String displayName, String hint, Object defaultValues, List values, Map dispNames, String displayStyle)
-
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
-
-