Class FormDataAdapterWrapper
java.lang.Object
de.xima.fc.common.form.FormDataAdapterWrapper
- All Implemented Interfaces:
IFormDataAdapter, Serializable
Base clas for
IFormDataAdapter that wraps another adapter and forwards all method calls to that wrapped
adapter.- Since:
- 8.2.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMultiValue(String fieldName, List<String[]> values) Adds the given values to the values of the form element.voidaddRequestValue(String fieldName, List<String> values) voidaddSingleValue(String fieldName, String... value) Adds the given values to the values of the form element.aliasValue(String alias) asStringValue(String[] value) asStringValue(List<String[]> value) buildDatatableValuesMap(ITableTemplate<? extends ITableColumn> template) Deprecated.Deprecated.getFieldMetaData(String identifier, boolean asAlias) Deprecated.Deprecated.Deprecated.Deprecated.getFieldTyp(String identifier, boolean asAlias) getFieldValues(String fieldName) getIFieldMetaData(String identifier, boolean asAlias) getNormName(String fieldName) For each element, a name is defined in the designer.getStringValue(String fieldName) Each form element may have multiple values.abstract IFormDataAdapterGets the wrapped form data adapter.booleanbooleanERSTMAL: Lieferttrue, wenn das Formular ein Feld mit dem übergebenen Namen besitzt.voidDeprecated.voidDeprecated.voidinit(Map<String, List<String>> dataMap, Map<String, List<org.apache.commons.fileupload.FileItem>> uploadMap) voidinit(Map<String, List<String>> dataMap, Map<String, List<org.apache.commons.fileupload.FileItem>> uploadMap, List<String> sendElements) booleanisElementLooped(String elementName) A repeated form element (also called dynamic or looped) is a form element of which the user can create multiple copies of as they fill out the form.booleanisQuestionElement(String elementName) intA repeated form element (also called dynamic or looped) is a form element of which the user can create multiple copies of as they fill out the form.voidmergeRequestData(Map<String, List<String>> oldData) String[]normalizeValue(String... value) String[]normalizeValue(List<String> value) normalizeValues(List<String> stringList) resolveAliasName(String alias) resolveFieldAlias(String alias) resolveFieldName(String fieldName) resolveFieldType(String fieldName, boolean asAlias) booleanvaluesMapHasValue(String fieldName)
-
Constructor Details
-
FormDataAdapterWrapper
public FormDataAdapterWrapper()
-
-
Method Details
-
addMultiValue
Description copied from interface:IFormDataAdapterAdds the given values to the values of the form element. If one or multiple values exist already for the given form element, they are preserved.- Specified by:
addMultiValuein interfaceIFormDataAdapter- Parameters:
fieldName- The name of a form element.values- AListof values to add to the form element.- See Also:
-
addRequestValue
- Specified by:
addRequestValuein interfaceIFormDataAdapter
-
addSingleValue
Description copied from interface:IFormDataAdapterAdds the given values to the values of the form element. If one or multiple values exist already for the given form element, they are preserved. Please note that the value of a form element is aListof arrays ofStrings, this adds the given values to the first entry in theListof values.- Specified by:
addSingleValuein interfaceIFormDataAdapter- Parameters:
fieldName- The name of a form element.value- One or multiple values to add for the given element.- See Also:
-
aliasValue
- Specified by:
aliasValuein interfaceIFormDataAdapter
-
asStringValue
- Specified by:
asStringValuein interfaceIFormDataAdapter- Parameters:
value- AListof values to be converted.- Returns:
- The given values, joined with a comma; or the empty string in case
nullor no values were given.
-
asStringValue
- Specified by:
asStringValuein interfaceIFormDataAdapter- Parameters:
value- An array of values to be converted.- Returns:
- The given values, joined with a comma; or the empty string in case
nullor no values were given.
-
createCompleteDynContainerMap
- Specified by:
createCompleteDynContainerMapin interfaceIFormDataAdapter- Returns:
- Similar to the
IFormDataAdapter.getDynContainerMap(), but also contains a value for each valuable element (not container elements etc.) in each repeated container.
-
getAliasFieldMap
- Specified by:
getAliasFieldMapin interfaceIFormDataAdapter- Returns:
- A
Mapthat maps from the alias name of a form elements to its name. - See Also:
-
getDynContainerMap
Deprecated.- Specified by:
getDynContainerMapin interfaceIFormDataAdapter- Returns:
- A map from the
nameof arepeatedcontainer or element to the metadata for that repeated container or element.
-
getDynFieldSet
Deprecated.- Specified by:
getDynFieldSetin interfaceIFormDataAdapter- Returns:
- A set that consists of the names of all form elements which are repeated and that have a value.
- See Also:
-
getDynFieldSets
- Specified by:
getDynFieldSetsin interfaceIFormDataAdapter- Returns:
- A set that consists of the names of all form elements which are repeated and that have a value.
- See Also:
-
getFieldAlias
- Specified by:
getFieldAliasin interfaceIFormDataAdapter- Returns:
- A
Setconsisting of the alias names of all existing form elements.
-
getFieldAliasMap
- Specified by:
getFieldAliasMapin interfaceIFormDataAdapter- Returns:
- A
Mapthat maps from the name of a form elements to its alias name. - See Also:
-
getFieldMetaData
Deprecated.- Specified by:
getFieldMetaDatain interfaceIFormDataAdapter- Parameters:
identifier- Identifier, either a name or alias.asAlias- Whether the identifier is a field name or a field alias.- Returns:
- The metadata for the given field.
-
getFieldMetaDataMap
Deprecated.- Specified by:
getFieldMetaDataMapin interfaceIFormDataAdapter- Returns:
- A map with the metadata for each element. The key is the field name, e.g.
tf1
-
getFieldNotesRead
Deprecated.Description copied from interface:IFormDataAdapterGets a map with notes for form fields that were already read by a user. The key is the name of the field, e.g.tf1.- Specified by:
getFieldNotesReadin interfaceIFormDataAdapter- Returns:
- Am map with all read field notes.
-
getFieldNotesUnread
Deprecated.Description copied from interface:IFormDataAdapterGets a map with notes for form fields that were not yet read by a user. The key is the name of the field, e.g.tf1.- Specified by:
getFieldNotesUnreadin interfaceIFormDataAdapter- Returns:
- Am map with all unread field notes.
-
getFieldTyp
- Specified by:
getFieldTypin interfaceIFormDataAdapter- Parameters:
identifier- The name of a form element.asAlias- Iftrue, interpret the given identifier as the alias name of the form element. Iffalse, interpret the given identifier as the name of the form element.- Returns:
- The form field type for the given element; or
nullwhen the given element does not exist.
-
getFieldValues
- Specified by:
getFieldValuesin interfaceIFormDataAdapter- Parameters:
fieldName- The name of a form element.- Returns:
- A
Listof all values for the given form element, ornullif the given form element does not exist.
-
getFieldValuesMap
- Specified by:
getFieldValuesMapin interfaceIFormDataAdapter- Returns:
- A
Mapthat maps from the name of a form element to its values.
-
getFields
- Specified by:
getFieldsin interfaceIFormDataAdapter
-
getIDynContainerMap
- Specified by:
getIDynContainerMapin interfaceIFormDataAdapter- Returns:
- A map from the
nameof arepeatedcontainer or element to the metadata for that repeated container or element.
-
getIFieldMetaData
- Specified by:
getIFieldMetaDatain interfaceIFormDataAdapter
-
getIFieldMetaDataMap
- Specified by:
getIFieldMetaDataMapin interfaceIFormDataAdapter
-
getMetaDataMap
- Specified by:
getMetaDataMapin interfaceIFormDataAdapter
-
getNormName
Description copied from interface:IFormDataAdapterFor each element, a name is defined in the designer. When the element is marked as a repeated elements, the created elements get a name that consists of the original name and a suffix. This method takes a name that may contain such a suffix and returns the original form element name.- Specified by:
getNormNamein interfaceIFormDataAdapter- Parameters:
fieldName- A form element that may contain suffixes such as the suffix for repeated elements.- Returns:
- The given name, normalized to the form element name as defined in the designer.
-
getRequestDataMap
- Specified by:
getRequestDataMapin interfaceIFormDataAdapter
-
getSendElements
- Specified by:
getSendElementsin interfaceIFormDataAdapter- Returns:
- A
Setof all elements for which a value was submitted in the (usually POST) request.
-
getStringValue
Description copied from interface:IFormDataAdapterEach form element may have multiple values. This returns the first value.- Specified by:
getStringValuein interfaceIFormDataAdapter- Parameters:
fieldName- The name of a form element.- Returns:
- The first value for the given form element, or the empty string when no value or the form element does not exist.
-
getWrapped
Gets the wrapped form data adapter. This is used as a delegate for all methods.- Returns:
- The wrapped form data adapter.
-
hasAlias
- Specified by:
hasAliasin interfaceIFormDataAdapter- Parameters:
alias- An alias name to check.- Returns:
trueif a form element with the given alias exists, orfalseotherwise.
-
hasField
Description copied from interface:IFormDataAdapterERSTMAL: Lieferttrue, wenn das Formular ein Feld mit dem übergebenen Namen besitzt.- Specified by:
hasFieldin interfaceIFormDataAdapter- Parameters:
fieldName- the field to check for- Returns:
- Liefert
true, wenn das Formular ein Feld mit dem übergebenen Namen besitzt
-
init
-
init
Deprecated.- Specified by:
initin interfaceIFormDataAdapter- Parameters:
dataMap- Map with form values (non uploads).
-
init
Deprecated.- Specified by:
initin interfaceIFormDataAdapter- Parameters:
dataMap- Map with form values (non uploads).sendElements- Elements that were rendered.
-
init
-
isElementLooped
Description copied from interface:IFormDataAdapterA repeated form element (also called dynamic or looped) is a form element of which the user can create multiple copies of as they fill out the form. This method checks whether the given form element is repeated.- Specified by:
isElementLoopedin interfaceIFormDataAdapter- Parameters:
elementName- The name of a form element to check.- Returns:
trueif the form element is a repeated element,falseotherwise (or if the given element does not exist).
-
isQuestionElement
- Specified by:
isQuestionElementin interfaceIFormDataAdapter
-
loopCount
Description copied from interface:IFormDataAdapterA repeated form element (also called dynamic or looped) is a form element of which the user can create multiple copies of as they fill out the form. This method returns how many copies were created.- Specified by:
loopCountin interfaceIFormDataAdapter- Parameters:
elementName- The name of a form element.- Returns:
- The number of repetitions of the given repeated form element, or
0in case the element is not a repeated element. - See Also:
-
mergeRequestData
- Specified by:
mergeRequestDatain interfaceIFormDataAdapter
-
normalizeValue
- Specified by:
normalizeValuein interfaceIFormDataAdapter- Parameters:
value- A list of values.- Returns:
- The given list of values, or an empty array in case
nullwas given.
-
normalizeValue
- Specified by:
normalizeValuein interfaceIFormDataAdapter- Parameters:
value- AListof values.- Returns:
- An array with the given values, or an empty array in case
nullwas given.
-
normalizeValues
- Specified by:
normalizeValuesin interfaceIFormDataAdapter- Parameters:
stringList- A list of values.- Returns:
- A
Listwith only a single entry, an array containing the given values.
-
resolveAliasName
- Specified by:
resolveAliasNamein interfaceIFormDataAdapter- Parameters:
alias- The alias of a form element.- Returns:
- The resolved alias, i.e. the name of the form element with the given alias. Returns the given alias in case no form element with the given alias exists.
- See Also:
-
resolveFieldAlias
- Specified by:
resolveFieldAliasin interfaceIFormDataAdapter
-
resolveFieldName
- Specified by:
resolveFieldNamein interfaceIFormDataAdapter
-
resolveFieldType
- Specified by:
resolveFieldTypein interfaceIFormDataAdapter
-
valuesMapHasValue
- Specified by:
valuesMapHasValuein interfaceIFormDataAdapter
-
buildDatatableValuesMap
- Specified by:
buildDatatableValuesMapin interfaceIFormDataAdapter
-