Package de.xima.fc.mdl.savedata
Class ASaveFormData
java.lang.Object
de.xima.fc.mdl.savedata.ASaveFormData
- All Implemented Interfaces:
IFormDataAdapter
,Serializable
- Direct Known Subclasses:
GenericSaveFormData
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionReverses Mapping zwischen Alias und Feldnameprotected final Map<String,
FormContainerMetaData> A collection that contains all form elements that are repeated elements (dynamic).protected final Map<String,
FormContainerMetaData> protected final Map<String,
FormFieldMetaData> Deprecated.Deprecated. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMultiValue
(String fieldName, List<String[]> values) Adds the given values to the values of the form element.void
addSingleValue
(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) getFieldMetaData
(String identifier, boolean asAlias) 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.boolean
boolean
ERSTMAL: Lieferttrue
, wenn das Formular ein Feld mit dem übergebenen Namen besitzt.boolean
isElementLooped
(String elemName) 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.boolean
isQuestionElement
(String elementName) int
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.String[]
normalizeValue
(String... value) String[]
normalizeValue
(List<String> value) normalizeValues
(List<String> stringList) resolveAliasName
(String alias) protected String
resolveDynValueName
(String fieldName, Integer index) resolveFieldAlias
(String alias) resolveFieldName
(String fieldName) resolveFieldType
(String fieldName, boolean asAlias) protected void
updateContainerElements
(FormContainerMetaData container) protected void
updateValuesMap
(FormContainerMetaData container, String elementName, List<String> value, int index) boolean
valuesMapHasValue
(String fieldName) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.xima.fc.interfaces.form.IFormDataAdapter
addRequestValue, createCompleteDynContainerMap, getSendElements, init, init, init, init, mergeRequestData
-
Field Details
-
requestDataMap
-
fieldAliasMap
-
aliasFieldMap
Reverses Mapping zwischen Alias und Feldname -
metaDataMap
-
fieldMetaDataMap
-
fieldContainerMap
-
fieldValuesMap
-
dynContainerMap
-
dynFieldSet
A collection that contains all form elements that are repeated elements (dynamic). -
questionFieldSet
-
fieldNotesRead
Deprecated. -
fieldNotesUnread
Deprecated. -
sendElements
-
-
Constructor Details
-
ASaveFormData
public ASaveFormData()
-
-
Method Details
-
valuesMapHasValue
- Specified by:
valuesMapHasValue
in interfaceIFormDataAdapter
-
resolveFieldAlias
- Specified by:
resolveFieldAlias
in interfaceIFormDataAdapter
-
resolveFieldName
- Specified by:
resolveFieldName
in interfaceIFormDataAdapter
-
getFieldTyp
- Specified by:
getFieldTyp
in 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
null
when the given element does not exist.
-
getFieldAlias
- Specified by:
getFieldAlias
in interfaceIFormDataAdapter
- Returns:
- A
Set
consisting of the alias names of all existing form elements.
-
getFieldMetaData
- Specified by:
getFieldMetaData
in interfaceIFormDataAdapter
-
getIFieldMetaData
- Specified by:
getIFieldMetaData
in interfaceIFormDataAdapter
-
isElementLooped
Description copied from interface:IFormDataAdapter
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. This method checks whether the given form element is repeated.- Specified by:
isElementLooped
in interfaceIFormDataAdapter
- Parameters:
elemName
- The name of a form element to check.- Returns:
true
if the form element is a repeated element,false
otherwise (or if the given element does not exist).
-
isQuestionElement
- Specified by:
isQuestionElement
in interfaceIFormDataAdapter
-
loopCount
Description copied from interface:IFormDataAdapter
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. This method returns how many copies were created.- Specified by:
loopCount
in interfaceIFormDataAdapter
- Parameters:
elemName
- The name of a form element.- Returns:
- The number of repetitions of the given repeated form element, or
0
in case the element is not a repeated element. - See Also:
-
aliasValue
- Specified by:
aliasValue
in interfaceIFormDataAdapter
-
hasAlias
- Specified by:
hasAlias
in interfaceIFormDataAdapter
- Parameters:
alias
- An alias name to check.- Returns:
true
if a form element with the given alias exists, orfalse
otherwise.
-
hasField
Description copied from interface:IFormDataAdapter
ERSTMAL: Lieferttrue
, wenn das Formular ein Feld mit dem übergebenen Namen besitzt.- Specified by:
hasField
in interfaceIFormDataAdapter
- Parameters:
fieldName
- the field to check for- Returns:
- Liefert
true
, wenn das Formular ein Feld mit dem übergebenen Namen besitzt
-
getMetaDataMap
- Specified by:
getMetaDataMap
in interfaceIFormDataAdapter
-
getFieldValuesMap
- Specified by:
getFieldValuesMap
in interfaceIFormDataAdapter
- Returns:
- A
Map
that maps from the name of a form element to its values.
-
resolveFieldType
- Specified by:
resolveFieldType
in interfaceIFormDataAdapter
-
getFieldAliasMap
- Specified by:
getFieldAliasMap
in interfaceIFormDataAdapter
- Returns:
- A
Map
that maps from the name of a form elements to its alias name. - See Also:
-
getAliasFieldMap
- Specified by:
getAliasFieldMap
in interfaceIFormDataAdapter
- Returns:
- A
Map
that maps from the alias name of a form elements to its name. - See Also:
-
getFieldMetaDataMap
- Specified by:
getFieldMetaDataMap
in interfaceIFormDataAdapter
-
getDynContainerMap
- Specified by:
getDynContainerMap
in interfaceIFormDataAdapter
- Returns:
- A map from the
name
of arepeated
container or element to the meta data for that repeated container or element.
-
getDynFieldSet
- Specified by:
getDynFieldSet
in interfaceIFormDataAdapter
- Returns:
- A
Set
that consists of the names of all form elements which are repeated containers (and are not form elements). - See Also:
-
getFieldValues
- Specified by:
getFieldValues
in interfaceIFormDataAdapter
- Parameters:
fieldName
- The name of a form element.- Returns:
- A
List
of all values for the given form element, ornull
if the given form element does not exist.
-
resolveAliasName
- Specified by:
resolveAliasName
in interfaceIFormDataAdapter
- Parameters:
alias
- The alias of a form element.- Returns:
- The resolved alias, ie. 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:
-
getStringValue
Description copied from interface:IFormDataAdapter
Each form element may have multiple values. This returns the first value.- Specified by:
getStringValue
in 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.
-
normalizeValue
- Specified by:
normalizeValue
in interfaceIFormDataAdapter
- Parameters:
value
- A list of values.- Returns:
- The given list of values, or an empty array in case
null
was given.
-
normalizeValue
- Specified by:
normalizeValue
in interfaceIFormDataAdapter
- Parameters:
value
- AList
of values.- Returns:
- An array with the given values, or an empty array in case
null
was given.
-
normalizeValues
- Specified by:
normalizeValues
in interfaceIFormDataAdapter
- Parameters:
stringList
- A list of values.- Returns:
- A
List
with only a single entry, an array containing the given values.
-
getFieldNotesRead
Deprecated.- Specified by:
getFieldNotesRead
in interfaceIFormDataAdapter
-
getFieldNotesUnread
Deprecated.- Specified by:
getFieldNotesUnread
in interfaceIFormDataAdapter
-
updateValuesMap
protected void updateValuesMap(FormContainerMetaData container, String elementName, List<String> value, int index) -
updateContainerElements
-
resolveDynValueName
-
getNormName
Description copied from interface:IFormDataAdapter
For 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:
getNormName
in 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.
-
asStringValue
- Specified by:
asStringValue
in interfaceIFormDataAdapter
- Parameters:
value
- AList
of values to be converted.- Returns:
- The given values, joined with a comma; or the empty string in case
null
or no values were given.
-
asStringValue
- Specified by:
asStringValue
in interfaceIFormDataAdapter
- Parameters:
value
- An array of values to be converted.- Returns:
- The given values, joined with a comma; or the empty string in case
null
or no values were given.
-
getRequestDataMap
- Specified by:
getRequestDataMap
in interfaceIFormDataAdapter
-
addSingleValue
Description copied from interface:IFormDataAdapter
Adds 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 aList
of arrays ofString
s, this adds the given values to the first entry in theList
of values.- Specified by:
addSingleValue
in interfaceIFormDataAdapter
- Parameters:
fieldName
- The name of a form element.value
- One or multiple values to add for the given element.- See Also:
-
addMultiValue
Description copied from interface:IFormDataAdapter
Adds 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:
addMultiValue
in interfaceIFormDataAdapter
- Parameters:
fieldName
- The name of a form element.values
- AList
of values to add to the form element.- See Also:
-
getFields
- Specified by:
getFields
in interfaceIFormDataAdapter
-