|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.infoglue.cms.applications.workflowtool.util.InfoglueWorkflowBase
public abstract class InfoglueWorkflowBase
Base class containing logic used by both InfoglueFunction and InfoglueCondition.
The main purpose of this class is to provide convenience methods for the parameters, arguments, and propertyset objects
and to handle the DatabaseSession object.
| Field Summary | |
|---|---|
static java.lang.String |
ERROR_PROPERTYSET_PREFIX
The prefix for all keys representing errors in the propertyset. |
static java.lang.String |
FUNCTION_STATUS_PROPERTYSET_KEY
The key used for storing the function status in the propertyset. |
protected static java.lang.String |
UTF8_ENCODING
The default encoding. |
static java.lang.String |
WORKFLOW_PROPERTYSET_PREFIX
The prefix for all keys representing workflow specific information in the propertyset. |
| Constructor Summary | |
|---|---|
InfoglueWorkflowBase()
Default constructor. |
|
| Method Summary | |
|---|---|
protected boolean |
argumentExists(java.lang.String name)
Returns true if the specified argument exists; false otherwise. |
protected java.lang.String |
getArgument(java.lang.String name)
Returns the specified argument if it exists; otherwise an exception is thrown. |
protected java.lang.String |
getArgument(java.lang.String name,
java.lang.String defaultValue)
Returns the specified argument if it exists; otherwise the default value. |
protected org.exolab.castor.jdo.Database |
getDatabase()
Returns the database associated with the current execution. |
protected org.apache.log4j.Logger |
getLogger()
Returns the class logger. |
protected java.lang.Object |
getParameter(java.lang.String key)
Returns the specified parameter if it exists; otherwise an exception is thrown. |
protected java.lang.Object |
getParameter(java.lang.String key,
boolean required)
Returns the specified parameter. |
protected java.lang.Object |
getParameter(java.lang.String key,
java.lang.Object defaultValue)
Returns the specified parameter if it exists; otherwise the default value. |
protected java.util.Map |
getParameters()
Returns the parameters (transient variables) of the current execution context. |
protected InfogluePropertySet |
getPropertySet()
Returns the propertyset associated with the current workflow. |
protected java.lang.String |
getPropertySetDataString(java.lang.String key)
Returns the specified data property as a string. |
protected java.lang.String |
getPropertySetString(java.lang.String key)
Returns the specified string property. |
static java.lang.Object |
getVariableFromMaps(java.lang.String var,
java.util.Map transientVars,
com.opensymphony.module.propertyset.PropertySet ps)
|
protected void |
initialize()
Method used for initializing the object; will be called before any execution is performed. |
protected boolean |
parameterExists(java.lang.String key)
Returns true if the specified parameter exists; false otherwise. |
protected boolean |
propertySetContains(java.lang.String key)
Returns true if the specified property exists; false otherwise. |
protected void |
removeFromPropertySet(java.lang.String key)
Removes the property with the specified key from the propertyset. |
protected void |
removeFromPropertySet(java.lang.String key,
boolean isPrefix)
Removes the property with the specified key from the propertyset. |
protected void |
setParameter(java.lang.String key,
java.lang.Object value)
Stores the specified parameter. |
protected void |
setPropertySetDataString(java.lang.String key,
java.lang.String value)
Stores the specified data property. |
protected void |
setPropertySetString(java.lang.String key,
java.lang.String value)
Stores the specified string property. |
protected void |
storeContext(java.util.Map transientVars,
java.util.Map args,
com.opensymphony.module.propertyset.PropertySet ps)
Stores the execution context. |
protected void |
throwException(java.lang.Exception e)
The preferred way to throw an exception from a subclass. |
protected void |
throwException(java.lang.String message)
The preferred way to throw an exception from a subclass. |
protected java.lang.String |
translate(java.lang.String s)
|
static java.lang.Object |
translateVariables(java.lang.String s,
java.util.Map transientVars,
com.opensymphony.module.propertyset.PropertySet ps)
Parses a string for instances of "${foo}" and returns a string with all instances replaced with the string value of the foo object (foo.toString()). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String UTF8_ENCODING
public static final java.lang.String WORKFLOW_PROPERTYSET_PREFIX
public static final java.lang.String FUNCTION_STATUS_PROPERTYSET_KEY
public static final java.lang.String ERROR_PROPERTYSET_PREFIX
| Constructor Detail |
|---|
public InfoglueWorkflowBase()
| Method Detail |
|---|
protected void initialize()
throws com.opensymphony.workflow.WorkflowException
Note! You must call super.initialize() first.
com.opensymphony.workflow.WorkflowException - if an error occurs during the initialization.
protected void storeContext(java.util.Map transientVars,
java.util.Map args,
com.opensymphony.module.propertyset.PropertySet ps)
transientVars - the transient variables of the current execution context.args - the arguments of the function.ps - the propertyset associated with the current workflow.
protected void throwException(java.lang.String message)
throws com.opensymphony.workflow.WorkflowException
message - the exception message.
com.opensymphony.workflow.WorkflowException - always throws an exception with the specified message.
protected void throwException(java.lang.Exception e)
throws com.opensymphony.workflow.WorkflowException
e - the exception to chain.
com.opensymphony.workflow.WorkflowException - always throws an exception. If the specified exception is a
workflow exception, that exception is thrown. Otherwise a chained workflow exception is thrown.protected final boolean argumentExists(java.lang.String name)
name - the name of the argument.
protected final java.lang.String getArgument(java.lang.String name)
throws com.opensymphony.workflow.WorkflowException
name - the name of the argument.
com.opensymphony.workflow.WorkflowException - if the specified argument doesn't exists.
protected final java.lang.String getArgument(java.lang.String name,
java.lang.String defaultValue)
throws com.opensymphony.workflow.WorkflowException
name - the name of the argument.defaultValue - the default value.
com.opensymphony.workflow.WorkflowExceptionprotected final boolean parameterExists(java.lang.String key)
name - the name of the parameter.
protected final java.lang.Object getParameter(java.lang.String key)
throws com.opensymphony.workflow.WorkflowException
name - the name of the parameter.
com.opensymphony.workflow.WorkflowException - if the specified parameter doesn't exists.
protected final java.lang.Object getParameter(java.lang.String key,
java.lang.Object defaultValue)
throws com.opensymphony.workflow.WorkflowException
name - the name of the parameter.defaultValue - the default value.
com.opensymphony.workflow.WorkflowException
protected final java.lang.Object getParameter(java.lang.String key,
boolean required)
throws com.opensymphony.workflow.WorkflowException
key - the key.required - indicates if the parameter is required.
com.opensymphony.workflow.WorkflowException - if a required parameter is missing.
protected final void setParameter(java.lang.String key,
java.lang.Object value)
key - the lookup key.value - the value.protected final java.util.Map getParameters()
protected final boolean propertySetContains(java.lang.String key)
protected final java.lang.String getPropertySetDataString(java.lang.String key)
key - the key.
protected final void setPropertySetDataString(java.lang.String key,
java.lang.String value)
key - the key.value - the value.protected final java.lang.String getPropertySetString(java.lang.String key)
key - the key.
protected final void setPropertySetString(java.lang.String key,
java.lang.String value)
key - the key.value - the value.protected final void removeFromPropertySet(java.lang.String key)
key - the property key.
protected final void removeFromPropertySet(java.lang.String key,
boolean isPrefix)
key - the property key.isPrefix - indicates if the key should be used as key prefix.protected final java.lang.String translate(java.lang.String s)
protected final InfogluePropertySet getPropertySet()
protected final org.apache.log4j.Logger getLogger()
protected final org.exolab.castor.jdo.Database getDatabase()
throws com.opensymphony.workflow.WorkflowException
com.opensymphony.workflow.WorkflowException - if an error occurs when opening/starting the database/transaction.
public static java.lang.Object translateVariables(java.lang.String s,
java.util.Map transientVars,
com.opensymphony.module.propertyset.PropertySet ps)
public static java.lang.Object getVariableFromMaps(java.lang.String var,
java.util.Map transientVars,
com.opensymphony.module.propertyset.PropertySet ps)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||