Package com.avoka.fc.core.service.form
Class CurrentVersionSelectorService
- java.lang.Object
-
- com.avoka.fc.core.service.form.CurrentVersionSelectorService
-
- All Implemented Interfaces:
IFormVersionSelectorService
,IServiceDefinitionAware
public class CurrentVersionSelectorService extends Object implements IFormVersionSelectorService
Provides a service that returns the current form version unless the request parameterParams.REQUEST_FORM_VERSION
is set and specifies a valid version number.- Since:
- 4.1.0
-
-
Constructor Summary
Constructors Constructor Description CurrentVersionSelectorService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TemplateVersion
getFormVersionToRender(Form form, HttpServletRequest request)
Select the form version that shall be used to fulfill a form render request.ServiceDefinition
getServiceDefinition()
Return the service definition on which this service is based.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
void
setServiceDefinition(ServiceDefinition serviceDefinition)
Set the service definition on which this service is based.
-
-
-
Method Detail
-
getFormVersionToRender
public TemplateVersion getFormVersionToRender(Form form, HttpServletRequest request)
Select the form version that shall be used to fulfill 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
-
getServiceDefinition
public ServiceDefinition getServiceDefinition()
Return the service definition on which this service is based.- Specified by:
getServiceDefinition
in interfaceIServiceDefinitionAware
- Returns:
- the service definition
-
setServiceDefinition
public void setServiceDefinition(ServiceDefinition serviceDefinition)
Set the service definition on which this service is based.- Specified by:
setServiceDefinition
in interfaceIServiceDefinitionAware
- Parameters:
serviceDefinition
- the service definition
-
-