Package de.xima.fc.form.common.models
Class XGlobalValidationParams
java.lang.Object
de.xima.fc.form.common.models.XGlobalValidationParams
- All Implemented Interfaces:
IXBaseValidationParams,IXGlobalValidationParams,Serializable
Simple POJO implementation of
IXGlobalValidationParams.- Author:
- XIMA MEDIA GmbH
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionXGlobalValidationParams(Map<String, List<String[]>> valuesMap, Map<String, ? extends IFormContainerMetaData> dynContainerMap, List<IXItemPropertiesData> xItemPropertiesData, IXFormRenderConfig formRenderConfig, Map<Serializable, Serializable> frqSessionAttributes, long clientId, boolean shouldValidate) Creates a new params object with the given data. -
Method Summary
Modifier and TypeMethodDescriptionlongMap<String,? extends IFormContainerMetaData> getI18nValue(String i18nKey) booleanWhether server-side validation should be performed.booleanisValuesEmpty(List<String[]> values) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.xima.fc.form.common.models.IXBaseValidationParams
getClientId, getDynContainerMap, getFieldValuesMap, getFormRenderConfig, getFRQSessionAttributes, getI18nValue, getLocale, getValues, isShouldValidate, isValuesEmpty
-
Constructor Details
-
XGlobalValidationParams
public XGlobalValidationParams(Map<String, List<String[]>> valuesMap, Map<String, ? extends IFormContainerMetaData> dynContainerMap, List<IXItemPropertiesData> xItemPropertiesData, IXFormRenderConfig formRenderConfig, Map<Serializable, Serializable> frqSessionAttributes, long clientId, boolean shouldValidate) Creates a new params object with the given data.- Parameters:
valuesMap- The value forIXBaseValidationParams.getFieldValuesMap().dynContainerMap- The value forIXBaseValidationParams.getDynContainerMap().xItemPropertiesData- The value forIXValidationParams.getXItemPropertiesData().formRenderConfig- The value forIXBaseValidationParams.getFormRenderConfig().frqSessionAttributes- The value forIXBaseValidationParams.getFRQSessionAttributes().clientId- The value forIXBaseValidationParams.getClientId().shouldValidate- Whether server-side validation is enabled or disabled.
-
-
Method Details
-
getXItemPropertiesData
- Specified by:
getXItemPropertiesDatain interfaceIXGlobalValidationParams- Returns:
- A wrapper object for accessing the properties (
XPropertyEnum) of the form items to validate.
-
getI18nValue
- Specified by:
getI18nValuein interfaceIXBaseValidationParams- Parameters:
i18nKey- I18n key for the localized message.- Returns:
- The localized message for the given key, retrieved from the built-in resource bundle. Plugin resource bundles are not considered.
-
getClientId
public long getClientId()- Specified by:
getClientIdin interfaceIXBaseValidationParams- Returns:
- The ID of the current client to which the form belongs.
-
getFieldValuesMap
- Specified by:
getFieldValuesMapin interfaceIXBaseValidationParams- Returns:
- A map with all values that were submitted. The key is the name of a form field.
-
getFormRenderConfig
- Specified by:
getFormRenderConfigin interfaceIXBaseValidationParams- Returns:
- The current form render config for accessing the global configuration of the validation process.
-
getValues
- Specified by:
getValuesin interfaceIXBaseValidationParams- Parameters:
key- Name of a form field.- Returns:
- All values that were submitted for the given for the given form field name. The list contains multiple
items when the form field is repeated; the array contains multiple items when the form field submitted
multiple values (e.g. a select element with
multipleset).
-
getFRQSessionAttributes
- Specified by:
getFRQSessionAttributesin interfaceIXBaseValidationParams- Returns:
- All attributes from the current form request session.
-
isValuesEmpty
- Specified by:
isValuesEmptyin interfaceIXBaseValidationParams- Parameters:
values- List of values of a form field.- Returns:
trueif the values are all empty, orfalseotherwise.
-
getDynContainerMap
- Specified by:
getDynContainerMapin interfaceIXBaseValidationParams- Returns:
- A map with the meta data for repeated elements. The key is the name of a form field.
-
isShouldValidate
public boolean isShouldValidate()Description copied from interface:IXBaseValidationParamsWhether server-side validation should be performed. Server-validation may be disabled due to one of several reasons:- The element is not rendered due to a state or user group condition.
- The element is disabled due to a state or user group condition.
- The form action does not require validation. When designing a form, the user can choose whether the form
should be validated when the a submit button is pressed. This returns
truewhen a submit button was pressed that requires the form to be validated, andfalse.
false. However, there are some use cases when validation needs to be performed no matter the circumstances. In that case, this flag may be ignored.- Specified by:
isShouldValidatein interfaceIXBaseValidationParams- Returns:
- Whether the form element should be validated.
-