Package com.avoka.fc.core.service.form
Class GroovyDynamicDataService
- java.lang.Object
-
- com.avoka.fc.core.service.BaseService
-
- com.avoka.fc.core.service.AbstractGroovyService
-
- com.avoka.fc.core.service.form.GroovyDynamicDataService
-
- All Implemented Interfaces:
IDynamicDataService
,IServiceDefinitionAware
,IUnitTestableService
public class GroovyDynamicDataService extends AbstractGroovyService implements IDynamicDataService
Provides a dynamic form data service invoking a Groovy script.
-
-
Field Summary
Fields Modifier and Type Field Description static String
PARAMETER_TEST_MODE
Test Mode parameter name.
-
Constructor Summary
Constructors Constructor Description GroovyDynamicDataService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getErrorType()
String
getEventLoggingLevel()
Return the Event Logging level[ "Info", "Warning", "Error" or "None" ]
String
getFormData(HttpServletRequest request, Form form, Submission submission)
Return the dynamic form data for the request and form.String
getResponseContentType()
Return the content type that shall be set on the response to the form.boolean
isAllowCallsAfterSubmission()
Return whether dynamic data calls will be accepted after form submissionboolean
isInTestMode()
Return whether the service is currently in test mode.boolean
isTestMode()
Return whether the service is in test mode.boolean
isXssFilterRequestParams()
Return true if XSS filter request parameters is enabled.void
setAllowCallsAfterSubmission(boolean allowCallsAfterSubmission)
Set whether dynamic data calls will be accepted after form submissionvoid
setEnforceAuthentication(boolean enforceAuthentication)
This does nothing and is provided as a stub backward compatibility with older service definition parameter configurations.void
setEnforceIpAddress(boolean enforceIpAddress)
This does nothing and is provided as a stub backward compatibility with older service definition parameter configurations.void
setEnforceSessionId(boolean enforceSessionId)
This does nothing and is provided as a stub backward compatibility with older service definition parameter configurations.void
setEnforceUserAgent(boolean enforceUserAgent)
This does nothing and is provided as a stub backward compatibility with older service definition parameter configurations.void
setEventLoggingLevel(String level)
Set the Event Logging level[ "Info", "Warning", "Error" ]
void
setResponseContentType(String responseContentType)
Set the desired content type of the response sent to the form.void
setTestMode(boolean testMode)
Set the test mode.void
setXssFilterRequestParams(boolean xssFilterRequestParams)
Set whether to XSS filter request parameter.-
Methods inherited from class com.avoka.fc.core.service.AbstractGroovyService
createExceptionAndLog, executeGroovyScript, executeGroovyScript, getCause, getExecutionTimeout, getGroovyScript, getGroovyServiceLog, getServiceDefinition, getServiceName, getServiceNameAndVersion, getServiceTimeout, getTestLogOutput, isExceptionDebugLoggingEnabled, isGroovyDebugLogging, isGroovyLoggingEnabled, isGroovyTypeChecked, runUnitTest, setExceptionDebugLoggingEnabled, setExecutionTimeout, setGroovyDebugLogging, setGroovyLoggingEnabled, setGroovyScript, setGroovyTypeChecked, setServiceDefinition, setUseModuleClassLoader
-
Methods inherited from class com.avoka.fc.core.service.BaseService
getLogger
-
-
-
-
Field Detail
-
PARAMETER_TEST_MODE
public static final String PARAMETER_TEST_MODE
Test Mode parameter name.- See Also:
- Constant Field Values
-
-
Method Detail
-
getErrorType
public String getErrorType()
- Specified by:
getErrorType
in classAbstractGroovyService
- Returns:
- the service error type to be used to classify the error logging records
- Since:
- 4.3.4
-
getFormData
public String getFormData(HttpServletRequest request, Form form, Submission submission)
Return the dynamic form data for the request and form.- Specified by:
getFormData
in interfaceIDynamicDataService
- Parameters:
request
- the AJAX form request (required)form
- the form which made the requestsubmission
- the form submission- Returns:
- the dynamic form data (typically JSON)
- See Also:
IDynamicDataService.getFormData(HttpServletRequest, Form, com.avoka.fc.core.entity.Submission)
-
getResponseContentType
public String getResponseContentType()
Return the content type that shall be set on the response to the form.- Specified by:
getResponseContentType
in interfaceIDynamicDataService
- Returns:
- the content type that shall be set on the response
-
setResponseContentType
public void setResponseContentType(String responseContentType)
Set the desired content type of the response sent to the form.- Parameters:
responseContentType
- the content type
-
isInTestMode
public boolean isInTestMode()
Return whether the service is currently in test mode. This will cause certain security checks to be skipped.- Specified by:
isInTestMode
in interfaceIDynamicDataService
- Returns:
- true iff the service is in test mode
-
isTestMode
public boolean isTestMode()
Return whether the service is in test mode.- Returns:
- true if the service is in test mode
-
setTestMode
public void setTestMode(boolean testMode)
Set the test mode.- Parameters:
testMode
- true to turn on test mode, false to turn it off
-
getEventLoggingLevel
public String getEventLoggingLevel()
Return the Event Logging level[ "Info", "Warning", "Error" or "None" ]
- Specified by:
getEventLoggingLevel
in interfaceIDynamicDataService
- Returns:
- the Event Logging level
[ "Info", "Warning", "Error" or "None" ]
-
setEventLoggingLevel
public void setEventLoggingLevel(String level)
Set the Event Logging level[ "Info", "Warning", "Error" ]
- Parameters:
level
- the Event Logging level[ "Info", "Warning", "Error" ]
-
isXssFilterRequestParams
public boolean isXssFilterRequestParams()
Return true if XSS filter request parameters is enabled.- Returns:
- true if XSS filter request parameters is enabled.
- Since:
- 4.1.0
-
setXssFilterRequestParams
public void setXssFilterRequestParams(boolean xssFilterRequestParams)
Set whether to XSS filter request parameter.- Parameters:
xssFilterRequestParams
- the xssFilterRequestParams to set- Since:
- 4.1.0
-
setAllowCallsAfterSubmission
public void setAllowCallsAfterSubmission(boolean allowCallsAfterSubmission)
Set whether dynamic data calls will be accepted after form submission- Parameters:
allowCallsAfterSubmission
- a parameter determining whether dynamic data calls will be accepted after form submission- Since:
- 4.3.1
-
isAllowCallsAfterSubmission
public boolean isAllowCallsAfterSubmission()
Return whether dynamic data calls will be accepted after form submission- Specified by:
isAllowCallsAfterSubmission
in interfaceIDynamicDataService
- Returns:
- true if dynamic data calls will be accepted after form submission
- Since:
- 4.3.1
-
setEnforceSessionId
public void setEnforceSessionId(boolean enforceSessionId)
This does nothing and is provided as a stub backward compatibility with older service definition parameter configurations.- Parameters:
enforceSessionId
- true to enable session ID monitoring
-
setEnforceIpAddress
public void setEnforceIpAddress(boolean enforceIpAddress)
This does nothing and is provided as a stub backward compatibility with older service definition parameter configurations.- Parameters:
enforceIpAddress
- true to enable IP address monitoring
-
setEnforceAuthentication
public void setEnforceAuthentication(boolean enforceAuthentication)
This does nothing and is provided as a stub backward compatibility with older service definition parameter configurations.- Parameters:
enforceAuthentication
- whether to enforce user authentication
-
setEnforceUserAgent
public void setEnforceUserAgent(boolean enforceUserAgent)
This does nothing and is provided as a stub backward compatibility with older service definition parameter configurations.- Parameters:
enforceUserAgent
- true to enable user agent monitoring
-
-