jbpm-form-modeler-api 6.2.0.Beta1

org.jbpm.formModeler.core.processing
Interface FormProcessor


public interface FormProcessor

A FormProcessor is a class that handles a form submission.


Field Summary
static String ATTR_INTERPRETER
           
static String CUSTOM_NAMESPACE_SEPARATOR
           
static String DEFAULT_NAMESPACE
           
static String FORM_MODE
           
static String MODIFIED_FIELD_NAMES
           
static String NAMESPACE_SEPARATOR
           
 
Method Summary
 void clear(FormRenderContext context)
          Clears status data for given render context
 void clear(Form form, String namespace)
          Clears status data for given form.
 void clear(String ctxUID)
          Clears status data for given render context
 void clearField(Form form, String namespace, String fieldName)
          Clear a field value.
 void clearFieldErrors(Form form, String namespace)
          Remove field errors that might be in this formStatus.
 void forceWrongField(Form form, String namespace, String fieldName)
          Mark a field as wrong
 Object getAttribute(Form form, String namespace, String attributeName)
          Gets an attribute for given form status
 Map getMapRepresentationToPersist(Form form, String namespace)
          Returns the Map to persis based on the data stored on the data stored on a FormStatus
 void modify(Form form, String namespace, String fieldName, Object value)
          Directly modify the status value for a form field.
 void persist(FormRenderContext context)
          Persists the status for given FormRenderContext.
 void persist(String ctxUid)
          Persists the status for given FormRenderContext id.
 Object persistFormHolder(Form form, String namespace, Map<String,Object> mapToPersist, DataHolder holder, Object loadedObject)
          Persists the form fields that match the given holder
 FormStatusData read(Form form, String namespace)
          Read status for given form id.
 FormStatusData read(Form form, String namespace, Map<String,Object> formValues)
          Read status for given form id.
 FormStatusData read(Form form, String namespace, Map<String,Object> formValues, Map<String,Object> loadedObjects)
          Read status for given form id.
 FormStatusData read(String ctxUid)
          Read status for given FormRenderContext id.
 Map readValuesToLoad(Form form, Map inputData, Map outputData, Map loadedObjects, String namespace)
           
 void setAttribute(Form form, String namespace, String attributeName, Object attributeValue)
          Sets an attribute for given form status
 void setFieldValue(Field field, String namespace, Map parametersMap, Map filesMap, boolean incremental)
           
 void setValues(Form form, String namespace, Map parameterMap, Map filesMap)
          Get submit values from a request parameter map and a files map, and store it in a form status.
 void setValues(Form form, String namespace, Map parameterMap, Map filesMap, boolean incremental)
          Get submit values from a request parameter map and a files map, and store it in a form status.
 

Field Detail

NAMESPACE_SEPARATOR

static final String NAMESPACE_SEPARATOR
See Also:
Constant Field Values

CUSTOM_NAMESPACE_SEPARATOR

static final String CUSTOM_NAMESPACE_SEPARATOR
See Also:
Constant Field Values

DEFAULT_NAMESPACE

static final String DEFAULT_NAMESPACE
See Also:
Constant Field Values

MODIFIED_FIELD_NAMES

static final String MODIFIED_FIELD_NAMES
See Also:
Constant Field Values

FORM_MODE

static final String FORM_MODE
See Also:
Constant Field Values

ATTR_INTERPRETER

static final String ATTR_INTERPRETER
See Also:
Constant Field Values
Method Detail

setValues

void setValues(Form form,
               String namespace,
               Map parameterMap,
               Map filesMap)
Get submit values from a request parameter map and a files map, and store it in a form status.

Parameters:
form - Form to process
parameterMap - Parameters map, as extracted from a request.
filesMap - files map, where a parameter name points to a file
namespace - Form namespace

setValues

void setValues(Form form,
               String namespace,
               Map parameterMap,
               Map filesMap,
               boolean incremental)
Get submit values from a request parameter map and a files map, and store it in a form status.

Parameters:
form - Form to process
parameterMap - Parameters map, as extracted from a request.
filesMap - files map, where a parameter name points to a file
incremental - Determines if form status should be cleared before setting the parameter values
namespace - Form namespace

modify

void modify(Form form,
            String namespace,
            String fieldName,
            Object value)
Directly modify the status value for a form field.

Parameters:
form - Form to modify
namespace - Form namespace
fieldName - Field name to modify
value - new value to set for this field.

setAttribute

void setAttribute(Form form,
                  String namespace,
                  String attributeName,
                  Object attributeValue)
Sets an attribute for given form status

Parameters:
form - Form to process
namespace - Form namespace
attributeName - Attribute name
attributeValue - Attribute value

getAttribute

Object getAttribute(Form form,
                    String namespace,
                    String attributeName)
Gets an attribute for given form status

Parameters:
form - Form to process
namespace - Form namespace
attributeName - Attribute name
Returns:
the attribute value

read

FormStatusData read(String ctxUid)
Read status for given FormRenderContext id.

Parameters:
ctxUid - Form render context UID
Returns:
a FormStatusData object representing the form status

persist

void persist(FormRenderContext context)
             throws Exception
Persists the status for given FormRenderContext.

Parameters:
context - Form render context
Throws:
Exception

persistFormHolder

Object persistFormHolder(Form form,
                         String namespace,
                         Map<String,Object> mapToPersist,
                         DataHolder holder,
                         Object loadedObject)
                         throws Exception
Persists the form fields that match the given holder

Parameters:
form -
namespace -
mapToPersist -
holder -
Returns:
The persisted object
Throws:
Exception

persist

void persist(String ctxUid)
             throws Exception
Persists the status for given FormRenderContext id.

Parameters:
ctxUid - Form render context UID
Throws:
Exception

read

FormStatusData read(Form form,
                    String namespace)
Read status for given form id.

Parameters:
form - Form id to read
namespace - Form namespace
Returns:
a FormStatusData object representing the form status

read

FormStatusData read(Form form,
                    String namespace,
                    Map<String,Object> formValues)
Read status for given form id.

Parameters:
form - Form to read
namespace - Form namespace
formValues - Values to load into the status
Returns:
a FormStatusData object representing the form status

read

FormStatusData read(Form form,
                    String namespace,
                    Map<String,Object> formValues,
                    Map<String,Object> loadedObjects)
Read status for given form id.

Parameters:
form - Form to read
namespace - Form namespace
formValues - Values to load into the status
loadedObjects - Map containing the objects loaded on the form
Returns:
a FormStatusData object representing the form status

getMapRepresentationToPersist

Map getMapRepresentationToPersist(Form form,
                                  String namespace)
                                  throws Exception
Returns the Map to persis based on the data stored on the data stored on a FormStatus

Parameters:
form - The form that corresponds the FormStatus
namespace - The namespace that identifies the FormStatus
Returns:
The object to persist
Throws:
Exception - in case of error building the Map

clear

void clear(FormRenderContext context)
Clears status data for given render context

Parameters:
context - Context to clear

clear

void clear(String ctxUID)
Clears status data for given render context

Parameters:
ctxUID - Render context id to clear

clear

void clear(Form form,
           String namespace)
Clears status data for given form.

Parameters:
form - Form to clear
namespace - Form namespace

clearField

void clearField(Form form,
                String namespace,
                String fieldName)
Clear a field value. Just sets to null related status entry

Parameters:
form - Form to process
namespace - Form namespace
fieldName - Field name to clear

clearFieldErrors

void clearFieldErrors(Form form,
                      String namespace)
Remove field errors that might be in this formStatus. A new call to setValues() might restore them if the condition that made them be errors still holds

Parameters:
form - Form to clear
namespace - Namespace to clear

forceWrongField

void forceWrongField(Form form,
                     String namespace,
                     String fieldName)
Mark a field as wrong

Parameters:
form - form to modify
namespace - namespace
fieldName - field name to mark as wrong

readValuesToLoad

Map readValuesToLoad(Form form,
                     Map inputData,
                     Map outputData,
                     Map loadedObjects,
                     String namespace)

setFieldValue

void setFieldValue(Field field,
                   String namespace,
                   Map parametersMap,
                   Map filesMap,
                   boolean incremental)

jbpm-form-modeler-api 6.2.0.Beta1

Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.