Interface ParameterControlEditPresenter
-
- All Known Subinterfaces:
RemoteParameterControlProvider
- All Known Implementing Classes:
CheckboxFieldParameterType,EnumParameterType,IntegerFieldParameterType,MultiselectFieldParameterType,ParameterControlProviderAdapter,PasswordFieldParameterType,RemoteParameterType,SelectParameterType,SelectParameterTypeBase,TextFieldParameterType
@UserImplemented(adapterClass=ParameterControlProviderAdapter.class) public interface ParameterControlEditPresenter
Represents parameter control spec editing- Since:
- 7.0
- Author:
- Eugene Petrenko (eugene.petrenko@gmail.com) Date: 09.12.11 19:22
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Map<String,String>convertSpecEditorParameters(Map<String,String> parameters)If validation of parametersvalidateSpecEditorParameters(java.util.Map)succeeded, framework calls this method to convert editor properties into control description parameters type argumentsControlDescription.getParameterTypeArguments()default booleanisValueRequired(javax.servlet.http.HttpServletRequest request, ParameterContext context)Determines whether a value field is required for this spec editor.org.springframework.web.servlet.ModelAndViewrenderSpecEditor(javax.servlet.http.HttpServletRequest request, ParameterEditContext context)Called from framework to get parameter specification editing.Collection<InvalidProperty>validateSpecEditorParameters(Map<String,String> parameters)AfterrenderSpecEditor(javax.servlet.http.HttpServletRequest, ParameterEditContext)form is submitted framework uses this properies provider to validate recieved properties.
-
-
-
Method Detail
-
renderSpecEditor
@NotNull org.springframework.web.servlet.ModelAndView renderSpecEditor(@NotNull javax.servlet.http.HttpServletRequest request, @NotNull ParameterEditContext context) throws InvalidParametersExceptionCalled from framework to get parameter specification editing. To validated parameters framework uses#getSpecEditorPropertiesProcessor()and than#validateParameterDescription(jetbrains.buildServer.controllers.parameters.ParameterContext).
Request contains attribute 'propertiesBean' of typeBasePropertiesBeanwith properties if needed. Implementation may convert properties to necessary view.
ParameterContext.getDescription()method of context parameter returns same parameters as 'propertiesBean'- Parameters:
request- http requestcontext- parameter context- Returns:
- ModelAndView to render
- Throws:
InvalidParametersException- if parameter editing could not be shown- Since:
- 7.0
-
validateSpecEditorParameters
@NotNull Collection<InvalidProperty> validateSpecEditorParameters(@NotNull Map<String,String> parameters)
AfterrenderSpecEditor(javax.servlet.http.HttpServletRequest, ParameterEditContext)form is submitted framework uses this properies provider to validate recieved properties. If validation succeeded, parameters will be converted to control description parameters type arguments viaconvertSpecEditorParameters(java.util.Map)and than it calls#validateParameterDescription(jetbrains.buildServer.controllers.parameters.ParameterContext)to complete validation.- Parameters:
properties- properties to process- Returns:
- collection of invalid properties, if this collection is not empty properties will not be saved into the configuration file.
- Since:
- 7.0
-
convertSpecEditorParameters
@NotNull Map<String,String> convertSpecEditorParameters(@NotNull Map<String,String> parameters) throws InvalidParametersException
If validation of parametersvalidateSpecEditorParameters(java.util.Map)succeeded, framework calls this method to convert editor properties into control description parameters type argumentsControlDescription.getParameterTypeArguments()- Parameters:
parameters- submitted parameters fromrenderSpecEditor(javax.servlet.http.HttpServletRequest, ParameterEditContext)form- Returns:
- converted parameters for
ControlDescription - Throws:
InvalidParametersException- if conversion is impossible and generic error must be shown
-
isValueRequired
default boolean isValueRequired(javax.servlet.http.HttpServletRequest request, @NotNull ParameterContext context)Determines whether a value field is required for this spec editor.- Parameters:
request- http requestcontext- parameter context- Returns:
- true if a value is required, false otherwise
- Since:
- 2024.01 Cloud
-
-