Package com.avoka.fc.core.service.form
Class GroovyFormPrefillService
- java.lang.Object
-
- com.avoka.fc.core.service.BaseService
-
- com.avoka.fc.core.service.AbstractGroovyService
-
- com.avoka.fc.core.service.form.GroovyFormPrefillService
-
- All Implemented Interfaces:
FormPrefillService
,IServiceDefinitionAware
,IUnitTestableService
public class GroovyFormPrefillService extends AbstractGroovyService implements FormPrefillService
Provides an Groovy Script based Form Prefill Service.
-
-
Field Summary
-
Fields inherited from interface com.avoka.fc.core.service.FormPrefillService
RUN_ON_SAVE_RESUME
-
-
Constructor Summary
Constructors Constructor Description GroovyFormPrefillService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IAuthenticationService
getAuthenticationService()
Return the authentication service for determining the authenticated user.String
getErrorType()
String
getFormPrefillData(Form form, Document schemaSeed, HttpServletRequest request)
Return the form pre-population data for the given form, the schema seed and request.boolean
isXssFilterRequestParams()
Return true if XSS filter request parameters is enabled.void
setSubmission(Submission submission)
Optionally set the task submission record before thegetFormPrefillData
method is called.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
-
-
-
-
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
-
setSubmission
public void setSubmission(Submission submission)
Optionally set the task submission record before thegetFormPrefillData
method is called.- Specified by:
setSubmission
in interfaceFormPrefillService
- Parameters:
submission
- the task submission record (required)- Since:
- 4.0.0
-
getAuthenticationService
public IAuthenticationService getAuthenticationService()
Return the authentication service for determining the authenticated user.- Specified by:
getAuthenticationService
in interfaceFormPrefillService
- Returns:
- the authentication service for determining the authenticated user
- See Also:
FormPrefillService.getAuthenticationService()
-
getFormPrefillData
public String getFormPrefillData(Form form, Document schemaSeed, HttpServletRequest request)
Return the form pre-population data for the given form, the schema seed and request. Since 3.6.0 form prefill can throw RedirectException for redirect another page when an error occur. Note that the redirect won't occur in MFW even RedirectException is thrown.- Specified by:
getFormPrefillData
in interfaceFormPrefillService
- Parameters:
form
- the get the pre-population data forschemaSeed
- the form schema seed XMLrequest
- the form request- Returns:
- the XML prefill data
- See Also:
FormPrefillService.getFormPrefillData(Form, Document, HttpServletRequest)
-
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
-
-