Interface FormLogicComponentDefinition
-
- All Superinterfaces:
Identifiable
- All Known Subinterfaces:
ConditionalComponentDefinition
,FormHandlerDefinition
,FormHandlerVariantDefinition
,FormLogicComponentVariantDefinition
,FormRouterDefinition
,FormRouterVariantDefinition
,FormValidatorDefinition
,FormValidatorVariantDefinition
,FragmentValidatorDefinition
,FragmentValidatorVariantDefinition
public interface FormLogicComponentDefinition extends Identifiable
Represents a definition for a FormLogicComponent.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description LanguageLabelMapping
addOrUpdateLanguageLabelMapping(String errorCode, String languageLabelKey)
Creates and adds a new language label mapping or updates an existing one.ParameterDefinition
createParameterDefinition(String identifier)
Creates a new definition for a parameter with the specified identifier.String
getComponentId()
Returns the component id of the (wcb) component implementing this form logic component.String
getComponentVersion()
Returns the most recent version of the (wcb) component implementing this form logic component.List<LanguageLabelMapping>
getDefaultLanguageLabelMapping()
Returns the default mapping of error codes to language labels.List<String>
getErrorCodes()
Returns the list of error codes that this form logic component can generate.FormLogicProviderComponent
getFormLogicProviderComponent()
Returns the form logic provider component with the component id of this form logic component.String
getHelpText()
Returns the help text of this handler using the default locale as set on the current session.String
getHelpTextLanguageLabel()
Returns the name of the message resource language label to be used for the help text of this form logic component.String
getIdentifier()
Returns the identifier of this form logic component definition.String
getJSFunction()
Returns the JavaScript function body that forms the action logic.LanguageLabelMapping
getLanguageLabelMappingByCode(String errorCode)
Returns the language label mapping for the specified error code.String
getMessage(String locale, String key)
Returns the language specified message with the specified key from the specified locale or null if it could not be found.ParameterDefinition
getParameterDefinitionByIdentifier(String identifier)
Returns the parameter definition for the given identifier.List<ParameterDefinition>
getParameterDefinitions()
Returns the list of defined parameters for this form logic componentString
getTitle()
Returns the title of this handler using the default locale as set on the current session.String
getTitleLanguageLabel()
Returns the name of the message resource language label to be used for the title of this form logic component.boolean
isAllowedToRunClientSide()
Indicates whether this FormLogicComponent is allowed to run clientside.void
setAllowedToRunClientSide(boolean allowedToRunClientSide)
Sets whether it is allowed to run components of this type client side.void
setComponentId(String componentId)
Sets the component id of the (wcb) component implementing this form logic component.void
setComponentVersion(String componentVersion)
Sets the most recent version of the (wcb) component implementing this form logic component.void
setDefaultLanguageLabelMapping(List<LanguageLabelMapping> mapping)
Sets the default mapping of error codes to language labels.void
setErrorCodes(List<String> errorCodes)
Sets Returns the list of error codes that this form logic component can generate.void
setHelpTextLanguageLabel(String helpTextLanguageLabel)
Returns the name of the message resource language label to be used for the help text of this form logic component.void
setIdentifier(String identifier)
Sets the identifier of this form logic component definition.void
setJSFunction(String functionBody)
Sets the JavaScript function body that forms the action logic.void
setParameterDefinitions(List<ParameterDefinition> parameterDefinitions)
Sets the list of defined parameters for this form logic component.void
setTitleLanguageLabel(String titleLanguageLabel)
Returns the name of the message resource language label to be used for the title of this form logic component.-
Methods inherited from interface nl.gx.webmanager.services.entitymanager.Identifiable
getId, setId
-
-
-
-
Method Detail
-
getErrorCodes
List<String> getErrorCodes()
Returns the list of error codes that this form logic component can generate.- Returns:
- the list of error codes that this form logic component can generate.
-
setErrorCodes
void setErrorCodes(List<String> errorCodes)
Sets Returns the list of error codes that this form logic component can generate.- Parameters:
errorCodes
- Returns the list of error codes that this form logic component can generate
-
getDefaultLanguageLabelMapping
List<LanguageLabelMapping> getDefaultLanguageLabelMapping()
Returns the default mapping of error codes to language labels.- Returns:
- a list of default language label mappings
-
setDefaultLanguageLabelMapping
void setDefaultLanguageLabelMapping(List<LanguageLabelMapping> mapping)
Sets the default mapping of error codes to language labels.- Parameters:
mapping
- the default mapping of error codes to language labels
-
getLanguageLabelMappingByCode
LanguageLabelMapping getLanguageLabelMappingByCode(String errorCode)
Returns the language label mapping for the specified error code.- Parameters:
errorCode
- the error code for which to lookup the language label mapping- Returns:
- the language label mapping in question or null if it could not be found
-
addOrUpdateLanguageLabelMapping
LanguageLabelMapping addOrUpdateLanguageLabelMapping(String errorCode, String languageLabelKey)
Creates and adds a new language label mapping or updates an existing one. The mapping is from the specified error code to the specified language label key.- Parameters:
errorCode
- the errorcode for which to create or update a language label mappinglanguageLabelKey
- the key of the language label- Returns:
- the language label mapping in question
-
getParameterDefinitions
List<ParameterDefinition> getParameterDefinitions()
Returns the list of defined parameters for this form logic component- Returns:
- the list of defined parameter for this form logic component
-
setParameterDefinitions
void setParameterDefinitions(List<ParameterDefinition> parameterDefinitions)
Sets the list of defined parameters for this form logic component.- Parameters:
parameterDefinitions
- the list of defined parameters for this form logic component
-
getJSFunction
String getJSFunction()
Returns the JavaScript function body that forms the action logic.- Returns:
- the JavaScript function body that forms the action logic
-
setJSFunction
void setJSFunction(String functionBody)
Sets the JavaScript function body that forms the action logic.- Parameters:
functionBody
- the JavaScript Function.
-
isAllowedToRunClientSide
boolean isAllowedToRunClientSide()
Indicates whether this FormLogicComponent is allowed to run clientside. This option is not meant to handle the technical problem that some operations cannot be performed client side; that issue should be resolved automatically by the FormEngine. This setting is merely for security purposes, for example, when the JavaScript sourcecode of a FormLogicComponent should not be exposed because it contains a business secret.- Returns:
- true when this component is allowed to run clientside, false otherwise
-
setAllowedToRunClientSide
void setAllowedToRunClientSide(boolean allowedToRunClientSide)
Sets whether it is allowed to run components of this type client side.- Parameters:
allowedToRunClientSide
- whether it is allowed to run components of this type clientside
-
getComponentId
String getComponentId()
Returns the component id of the (wcb) component implementing this form logic component. This component is used for retrieving message resources and the service providing the java implementation of this form logic component.- Returns:
- the component id of the (wcb) component implementing this form logic component
-
getComponentVersion
String getComponentVersion()
Returns the most recent version of the (wcb) component implementing this form logic component.- Returns:
- the most recent version of the (wcb) component
-
setComponentId
void setComponentId(String componentId)
Sets the component id of the (wcb) component implementing this form logic component. This component is used for retrieving message resources and the service providing the java implementation of this form logic component.- Parameters:
componentId
- the component id of the (wcb) component implementing this form logic component
-
setComponentVersion
void setComponentVersion(String componentVersion)
Sets the most recent version of the (wcb) component implementing this form logic component. param componentVersion the most recent version of the (wcb) component
-
getFormLogicProviderComponent
FormLogicProviderComponent getFormLogicProviderComponent()
Returns the form logic provider component with the component id of this form logic component.- Returns:
- the form logic provider component or null if is not present
-
getMessage
String getMessage(String locale, String key)
Returns the language specified message with the specified key from the specified locale or null if it could not be found. Note that this has nothing to do with the wmpform specific LanguageLabels; this method merely returns languages from the default wcb message resources and is to be used for language labels describing parameters and for the title of the form logic component.- Parameters:
locale
- the locale for which to retrieve a translation. E.g. en_USkey
- the key of the language label- Returns:
- the language specified message with the specified key from the specified locale or null if it could not be found
-
createParameterDefinition
ParameterDefinition createParameterDefinition(String identifier)
Creates a new definition for a parameter with the specified identifier.- Parameters:
identifier
- the identifier of the new parameter- Returns:
- the new definition for a parameter
-
getTitleLanguageLabel
String getTitleLanguageLabel()
Returns the name of the message resource language label to be used for the title of this form logic component.- Returns:
- the name of the message resource language label
-
setTitleLanguageLabel
void setTitleLanguageLabel(String titleLanguageLabel)
Returns the name of the message resource language label to be used for the title of this form logic component.- Parameters:
titleLanguageLabel
- the name of the message resource language label
-
getHelpTextLanguageLabel
String getHelpTextLanguageLabel()
Returns the name of the message resource language label to be used for the help text of this form logic component.- Returns:
- the name of the message resource language label
-
setHelpTextLanguageLabel
void setHelpTextLanguageLabel(String helpTextLanguageLabel)
Returns the name of the message resource language label to be used for the help text of this form logic component.- Parameters:
helpTextLanguageLabel
- the name of the message resource language label
-
getHelpText
String getHelpText()
Returns the help text of this handler using the default locale as set on the current session.- Returns:
- the help text of this handler or null when it was not set or the locale could not be determined
-
getTitle
String getTitle()
Returns the title of this handler using the default locale as set on the current session.- Returns:
- the title of this handler or null when it was not set or the locale could not be determined
-
getIdentifier
String getIdentifier()
Returns the identifier of this form logic component definition.- Returns:
- the identifier of this form logic component definition
-
setIdentifier
void setIdentifier(String identifier)
Sets the identifier of this form logic component definition.- Parameters:
identifier
- the identifier of this form logic component definition
-
getParameterDefinitionByIdentifier
ParameterDefinition getParameterDefinitionByIdentifier(String identifier)
Returns the parameter definition for the given identifier.- Parameters:
identifier
- the identifier of the ParameterDefinition to lookup- Returns:
- the ParameterDefinition with the specified identifier or null if there is none
-
-