org.jlf.httpRequest
Class WorkflowProperties

java.lang.Object
  |
  +--java.util.Dictionary
        |
        +--java.util.Hashtable
              |
              +--java.util.Properties
                    |
                    +--org.jlf.util.AppProperties
                          |
                          +--org.jlf.httpRequest.WorkflowProperties
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class WorkflowProperties
extends AppProperties

This class is used to obtain properties for a particular workflow. It also serves double duty, as work flows not only have properties of their own, but they also may contain any number of data mapping properties. The HTTPRequestDataLocation uses this class's properties for data mapping properties.

See Also:
Workflow, HTTPRequestDataLocation, Processor, Serialized Form

Field Summary
protected static java.lang.String CONTENT_TYPE_PROPERTY_KEY
          Property key for content type.
protected static java.lang.String DATA_MAP_OBJECT_PROPERTY_KEY
          Property key for the objects to data map from the HTTP request.
protected static java.lang.String DATA_MAP_OBJECT_STORE_PROPERTY_KEY
          Property key for an object to map to see where to map the object.
protected static java.lang.String DEFAULT_CONTENT_TYPE
           
protected static java.lang.String DEFAULT_DATA_MAP_OBJECT_STORE_PROPERTY
           
protected static java.lang.String DEFAULT_ERROR_PAGE
           
protected static java.lang.String DEFAULT_FORWARD_PAGE
           
protected static boolean DEFAULT_SKIP_WORKSTEP_PROPERTY
           
protected static java.lang.String DEFAULT_WORKFLOW_CLASS
           
protected static java.lang.String DEFAULT_WORKFLOW_STEP
           
protected static java.lang.String ERROR_PAGE_PROPERTY_KEY
          Property key for the error page if an exception caught.
protected static java.lang.String FORWARD_PAGE_PROPERTY_KEY
          Property key for the redirect page.
protected static java.lang.String SKIP_WORKSTEP_PROPERTY_KEY
          Property key for an override where the request should not execute a work step.
protected static java.lang.String WORK_STEP_PROPERTY_KEY_PREFIX
          Prefix to properties that override at the work step level.
protected static java.lang.String WORKFLOW_CLASS_PROPERTY_KEY
          Property key for the workflow class name.
protected static java.lang.String WORKFLOW_STEP_METHOD_KEY
          Property key for the workflow method name.
 
Fields inherited from class org.jlf.util.AppProperties
PROPERTY_FILE_COMPONENT_VERSION_PREFIX, propertyFileName, singleton
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
WorkflowProperties(java.util.Properties properties)
          Passthrough constructor for default properties.
 
Method Summary
protected  boolean getBooleanWorkStepProperty(java.lang.String workflowAlias, java.lang.String propertyKey, boolean defaultValue)
          Helper method to check for an override at the work step level, if not present, look at the workflow level, and if not, return the default.
 java.lang.String getContentType(java.lang.String workflowAlias)
          Obtain the setting for the content type given the workflowAlias.
 java.util.Properties getDataMapObjectToClassTable(java.lang.String workflowAlias)
          Obtain a map of object names to DataMapObject classes.
 java.lang.String getErrorPage(java.lang.String workflowAlias)
          Obtain the setting for the page to forward the request to if an exception is caught.
 java.lang.String getForwardPage(java.lang.String workflowAlias)
          Obtain the setting for the page to forward the request to after it is processed, given the workflowAlias.
 java.lang.String getWorkflowClass(java.lang.String workflowAlias)
          Obtain the setting for the name of the workflow class (subclass of Workflow) which implements the work flow alias.
 java.lang.String getWorkflowStepMethod(java.lang.String workflowAlias)
          Obtain the method name inside the workflow class which implements the workflow step designated by the workflow alias.
protected  java.util.Properties getWorkStepPropertiesForPrefix(java.lang.String workflowAlias, java.lang.String propertyPrefix)
          Returns a Properties object containing all of the property names found in the property file (designated by the workstep name and a property file prefix taken from the prefix input variable).
protected  java.lang.String getWorkStepProperty(java.lang.String workflowAlias, java.lang.String propertyKey, java.lang.String defaultValue)
          Helper method to check for an override at the work step level, if not present, look at the workflow level, and if not, return the default.
 boolean mustSkipWorkStep(java.lang.String workflowAlias)
          Obtain the setting for the a property which allows the a workflow/step request to skip work step processing and just forward to a page if desired.
 java.lang.String storeForDataMappedObject(java.lang.String workflowAlias, java.lang.String objectName)
          Obtain the setting for the a property which tells the framework where to store the data mapped object for processing.
static java.lang.String workflowNameFromAlias(java.lang.String workflowAlias)
          Helper method to obtain a workflow name from a workflow alias, which could contain an appended workflow step.
static java.lang.String workflowStepFromAlias(java.lang.String workflowAlias)
          Helper method to obtain a workflow step from a workflow alias, which should contain a prepended workflow name.
 
Methods inherited from class org.jlf.util.AppProperties
getBooleanProperty, getComponentsAndVersions, getInstance, getIntegerProperty, getLongProperty, getPropertiesForPrefix, getStringProperty, isRelativePathFileName, load
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, propertyNames, save, setProperty, store
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

WORK_STEP_PROPERTY_KEY_PREFIX

protected static final java.lang.String WORK_STEP_PROPERTY_KEY_PREFIX
Prefix to properties that override at the work step level.

See Also:
Constant Field Values

CONTENT_TYPE_PROPERTY_KEY

protected static final java.lang.String CONTENT_TYPE_PROPERTY_KEY
Property key for content type.

See Also:
Constant Field Values

DEFAULT_CONTENT_TYPE

protected static final java.lang.String DEFAULT_CONTENT_TYPE
See Also:
Constant Field Values

FORWARD_PAGE_PROPERTY_KEY

protected static final java.lang.String FORWARD_PAGE_PROPERTY_KEY
Property key for the redirect page.

See Also:
Constant Field Values

DEFAULT_FORWARD_PAGE

protected static final java.lang.String DEFAULT_FORWARD_PAGE
See Also:
Constant Field Values

ERROR_PAGE_PROPERTY_KEY

protected static final java.lang.String ERROR_PAGE_PROPERTY_KEY
Property key for the error page if an exception caught.

See Also:
Constant Field Values

DEFAULT_ERROR_PAGE

protected static final java.lang.String DEFAULT_ERROR_PAGE
See Also:
Constant Field Values

WORKFLOW_CLASS_PROPERTY_KEY

protected static final java.lang.String WORKFLOW_CLASS_PROPERTY_KEY
Property key for the workflow class name.

See Also:
Constant Field Values

DEFAULT_WORKFLOW_CLASS

protected static final java.lang.String DEFAULT_WORKFLOW_CLASS
See Also:
Constant Field Values

SKIP_WORKSTEP_PROPERTY_KEY

protected static final java.lang.String SKIP_WORKSTEP_PROPERTY_KEY
Property key for an override where the request should not execute a work step.

See Also:
Constant Field Values

DEFAULT_SKIP_WORKSTEP_PROPERTY

protected static final boolean DEFAULT_SKIP_WORKSTEP_PROPERTY
See Also:
Constant Field Values

WORKFLOW_STEP_METHOD_KEY

protected static final java.lang.String WORKFLOW_STEP_METHOD_KEY
Property key for the workflow method name.

See Also:
Constant Field Values

DEFAULT_WORKFLOW_STEP

protected static final java.lang.String DEFAULT_WORKFLOW_STEP
See Also:
Constant Field Values

DATA_MAP_OBJECT_PROPERTY_KEY

protected static final java.lang.String DATA_MAP_OBJECT_PROPERTY_KEY
Property key for the objects to data map from the HTTP request.

See Also:
Constant Field Values

DATA_MAP_OBJECT_STORE_PROPERTY_KEY

protected static final java.lang.String DATA_MAP_OBJECT_STORE_PROPERTY_KEY
Property key for an object to map to see where to map the object. Typically request or session, where request is the default as it is quicker.

See Also:
Constant Field Values

DEFAULT_DATA_MAP_OBJECT_STORE_PROPERTY

protected static final java.lang.String DEFAULT_DATA_MAP_OBJECT_STORE_PROPERTY
See Also:
Constant Field Values
Constructor Detail

WorkflowProperties

public WorkflowProperties(java.util.Properties properties)
Passthrough constructor for default properties.

Method Detail

workflowNameFromAlias

public static java.lang.String workflowNameFromAlias(java.lang.String workflowAlias)
Helper method to obtain a workflow name from a workflow alias, which could contain an appended workflow step.

Returns:
Empty string if none can be found

workflowStepFromAlias

public static java.lang.String workflowStepFromAlias(java.lang.String workflowAlias)
Helper method to obtain a workflow step from a workflow alias, which should contain a prepended workflow name.

Returns:
Empty string if none can be found.

getWorkStepProperty

protected java.lang.String getWorkStepProperty(java.lang.String workflowAlias,
                                               java.lang.String propertyKey,
                                               java.lang.String defaultValue)
Helper method to check for an override at the work step level, if not present, look at the workflow level, and if not, return the default.


getBooleanWorkStepProperty

protected boolean getBooleanWorkStepProperty(java.lang.String workflowAlias,
                                             java.lang.String propertyKey,
                                             boolean defaultValue)
Helper method to check for an override at the work step level, if not present, look at the workflow level, and if not, return the default.


getWorkStepPropertiesForPrefix

protected java.util.Properties getWorkStepPropertiesForPrefix(java.lang.String workflowAlias,
                                                              java.lang.String propertyPrefix)
Returns a Properties object containing all of the property names found in the property file (designated by the workstep name and a property file prefix taken from the prefix input variable). The key to the properties is the property name portion after the prefix and the value in the properties is its property file value.


getContentType

public java.lang.String getContentType(java.lang.String workflowAlias)
Obtain the setting for the content type given the workflowAlias.


getForwardPage

public java.lang.String getForwardPage(java.lang.String workflowAlias)
Obtain the setting for the page to forward the request to after it is processed, given the workflowAlias.

Returns:
Empty string if none found and no action should be taken

getErrorPage

public java.lang.String getErrorPage(java.lang.String workflowAlias)
Obtain the setting for the page to forward the request to if an exception is caught.


getWorkflowClass

public java.lang.String getWorkflowClass(java.lang.String workflowAlias)
Obtain the setting for the name of the workflow class (subclass of Workflow) which implements the work flow alias.

Returns:
Empty string if none found

mustSkipWorkStep

public boolean mustSkipWorkStep(java.lang.String workflowAlias)
Obtain the setting for the a property which allows the a workflow/step request to skip work step processing and just forward to a page if desired. Why? You may want data mapping to take place and update a session object, but NOT have to execute any code, just forward to a different page.


getWorkflowStepMethod

public java.lang.String getWorkflowStepMethod(java.lang.String workflowAlias)
Obtain the method name inside the workflow class which implements the workflow step designated by the workflow alias.

This method has a lot of defaults. First, looks for a method name override for the work flow step. If none found, uses the work flow step in the workflow alias. If the workflow alias does not specify a workflow step, executes the default workflow step method.


getDataMapObjectToClassTable

public java.util.Properties getDataMapObjectToClassTable(java.lang.String workflowAlias)
Obtain a map of object names to DataMapObject classes. The key is the name of the object in the HTTP request. The value is the class name to instantiate a new object of and populate attributes from dot notations in the request.


storeForDataMappedObject

public java.lang.String storeForDataMappedObject(java.lang.String workflowAlias,
                                                 java.lang.String objectName)
Obtain the setting for the a property which tells the framework where to store the data mapped object for processing. Today this can either be in the "request" or the "session".