jbpm-form-modeler-api 1.0-SNAPSHOT

org.jbpm.formModeler.api.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(Long formId, String namespace)
          Clears status data for given form id.
 void clearField(Long formId, String namespace, String fieldName)
          Clear a field value.
 void clearFieldErrors(Form form, String namespace)
          Remove field errors that might be in this formStatus.
 void flushPendingCalculations(Form form, String namespace)
          Calculates all formulas for given form.
 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
 Object getLoadedObject(Long formId, String namespace)
          If an object was loaded for given form id, return the loaded object
 Map getMapRepresentationToPersist(Form form, String namespace)
          Returns the Map to persis based on the data stored on the data stored on a FormStatus
 void load(Long formId, String namespace, Long objIdentifier, String itemClassName)
          Loads into form status values read from a persistent object.
 void load(Long formId, String namespace, Long objIdentifier, String itemClassName, String formMode)
          Loads into form status values read from a persistent object.
 void load(Long formId, String namespace, Object loadObject)
          Loads into form status values read from given object.
 void load(Long formId, String namespace, Object loadObject, String formMode)
          Loads into form status values read from given object.
 void modify(Form form, String namespace, String fieldName, Object value)
          Directly modify the status value for a form field.
 FormStatusData read(Long formId, String namespace)
          Read status for given form id.
 FormStatusData read(Long formId, String namespace, Map currentValues)
          Read status for given form id.
 void setAttribute(Form form, String namespace, String attributeName, Object attributeValue)
          Sets an attribute for given form status
 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 - Formulary 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 - Formulary 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 - Formulary 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 - Formulary 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 - Formulary to process
namespace - Form namespace
attributeName - Attribute name
Returns:
the attribute value

read

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

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

read

FormStatusData read(Long formId,
                    String namespace,
                    Map currentValues)
Read status for given form id.

Parameters:
formId - Formulary id to read
namespace - Form namespace
currentValues - Values to load into the status
Returns:
a FormStatusData object representing the form status

flushPendingCalculations

void flushPendingCalculations(Form form,
                              String namespace)
Calculates all formulas for given form. Should be called before reading status, otherwise, some calculations might be performed afterwards (they may arrive asynchronously through ajax).

Parameters:
form - Formulary to store
namespace - Form namespace

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

load

void load(Long formId,
          String namespace,
          Long objIdentifier,
          String itemClassName)
          throws Exception
Loads into form status values read from a persistent object.

Parameters:
formId - Form id to fill in
objIdentifier - object identifier to read
itemClassName - item class name to read
namespace - Form namespace
Throws:
Exception - in case of error reading.

load

void load(Long formId,
          String namespace,
          Long objIdentifier,
          String itemClassName,
          String formMode)
          throws Exception
Loads into form status values read from a persistent object.

Parameters:
formId - Form id to fill in
objIdentifier - object identifier to read
itemClassName - item class name to read
namespace - Form namespace
formMode - Form mode for the form that's loading the status
Throws:
Exception - in case of error reading.

load

void load(Long formId,
          String namespace,
          Object loadObject)
          throws Exception
Loads into form status values read from given object.

Parameters:
formId - Form id to fill in
loadObject - Object to load
namespace - Form namespace
Throws:
Exception

load

void load(Long formId,
          String namespace,
          Object loadObject,
          String formMode)
          throws Exception
Loads into form status values read from given object.

Parameters:
formId - Form id to fill in
loadObject - Object to load
formMode - Form mode for the form that's loading the status
namespace - Form namespace
Throws:
Exception

getLoadedObject

Object getLoadedObject(Long formId,
                       String namespace)
                       throws Exception
If an object was loaded for given form id, return the loaded object

Parameters:
formId - form id to read.
namespace - Form namespace
Returns:
The loaded object if any
Throws:
Exception - in case of error reading persisted object

clear

void clear(Long formId,
           String namespace)
Clears status data for given form id.

Parameters:
formId - Formulary id to clear
namespace - Form namespace

clearField

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

Parameters:
formId - Formulary id 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

jbpm-form-modeler-api 1.0-SNAPSHOT

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