Package com.avoka.fc.core.service.form
Class GroovyFormVersionSelectorService
- java.lang.Object
-
- com.avoka.fc.core.service.BaseService
-
- com.avoka.fc.core.service.AbstractGroovyService
-
- com.avoka.fc.core.service.form.GroovyFormVersionSelectorService
-
- All Implemented Interfaces:
IFormVersionSelectorService
,IServiceDefinitionAware
,IUnitTestableService
public class GroovyFormVersionSelectorService extends AbstractGroovyService implements IFormVersionSelectorService
Provides a service that returns the form version to be used in rendering. The Groovy script contains the logic to select the version.- Since:
- 4.1.0
-
-
Constructor Summary
Constructors Constructor Description GroovyFormVersionSelectorService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getErrorType()
TemplateVersion
getFormVersionToRender(Form form, HttpServletRequest request)
Select the form version that shall be used to fulfil a form render request.boolean
isIgnoreFormVersionRequestParameter()
Return whether the service will ignore the request parameterParams.REQUEST_FORM_VERSION
.void
setIgnoreFormVersionRequestParameter(boolean ignoreFormVersionRequestParameter)
Determine whether the service will ignore the request parameterParams.REQUEST_FORM_VERSION
-
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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.avoka.fc.core.service.IServiceDefinitionAware
getServiceDefinition, setServiceDefinition
-
-
-
-
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
-
getFormVersionToRender
public TemplateVersion getFormVersionToRender(Form form, HttpServletRequest request)
Select the form version that shall be used to fulfil a form render request.- Specified by:
getFormVersionToRender
in interfaceIFormVersionSelectorService
- Parameters:
form
- the form (required)request
- the HTTP servlet request (required)- Returns:
- the template version that shall be used when rendering the form
- See Also:
IFormVersionSelectorService.getFormVersionToRender(Form, HttpServletRequest)
-
isIgnoreFormVersionRequestParameter
public boolean isIgnoreFormVersionRequestParameter()
Return whether the service will ignore the request parameterParams.REQUEST_FORM_VERSION
. If set, the service will always return the current form version.- Returns:
- true if the service will ignore the request parameter
Params.REQUEST_FORM_VERSION
-
setIgnoreFormVersionRequestParameter
public void setIgnoreFormVersionRequestParameter(boolean ignoreFormVersionRequestParameter)
Determine whether the service will ignore the request parameterParams.REQUEST_FORM_VERSION
- Parameters:
ignoreFormVersionRequestParameter
- whether to ignore the service parameter request parameterParams.REQUEST_FORM_VERSION
-
-