Interface IPluginValidationRule
-
- All Superinterfaces:
IFCPlugin
,INamedUiElement
,INameProviding
,ITransferable
,Serializable
public interface IPluginValidationRule extends IFCPlugin
Interface for validation rule plugins. A validation rule can be used to add additional data types for text input elements. For each text input element, the user can select one data type. When the user enters a value into an input element and that value does not conform to the data type, the input element is considered invalid an an appropriate error message is shown to the user.Each validation rule specifies a (JavaScript) regular expression that is checked against the value of the text input field. When the regular expression does not match, the value is considered invalid. Each validation rule must also specify an error message that is shown to the user in case the value is invalid.
- Author:
- XIMA MEDIA GmbH
-
-
Field Summary
-
Fields inherited from interface de.xima.fc.plugin.interfaces.IFCPlugin
CONFIG_FILENAME
-
Fields inherited from interface de.xima.fc.interfaces.INamedUiElement
ATTR_DISPLAY_NAME
-
Fields inherited from interface de.xima.fc.entities.interfaces.INameProviding
ATTR_NAME, COL_NAME
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getKey()
String
getKeyDisplayName(Locale locale)
String
getRegex()
This must return the JavaScript regular expression that check whether the value of form field is valid.String
getValidationErrorMsg(Locale locale)
-
Methods inherited from interface de.xima.fc.plugin.interfaces.IFCPlugin
getDescription, getDescription, getDisplayName, getName, initialize, initPlugin, install, shutdown, shutdown, uninstall
-
-
-
-
Method Detail
-
getKey
String getKey()
- Returns:
- A unique key that must not be shared with any other
IPluginValidationRule
.
-
getKeyDisplayName
String getKeyDisplayName(Locale locale)
- Parameters:
locale
- The current locale of the designer.- Returns:
- The name of this validation rule. This is what is shown as the name for this validation rule in the FORMCYCLE designer.
-
getRegex
String getRegex()
This must return the JavaScript regular expression that check whether the value of form field is valid. Please note that the regular expression must include the initial and final slash. For example an check for an ISBN-10 number could be written as:/^(?=[-0-9xX ]{13}$)(?:[0-9]+[- ]){3}[0-9]*[xX0-9]$/
Furthermore, you usually want to the include the start-of-string marker^
and end-of-string marker$
to make sure the regular expression matches the entire string, not only a part of itThe value of a form field is considered valid if this regular expression matches that value; and invalid otherwise. When the value of a form field is invalid, an appropriate error message is shown to the user.
- Returns:
- A JavaScript regular expression, including the initial and final slash.
-
-