use of com.synopsys.integration.alert.common.rest.HttpServletContentWrapper in project hub-alert by blackducksoftware.
the class AbstractFunctionController method postConfig.
@PostMapping
public T postConfig(HttpServletRequest httpRequest, HttpServletResponse httpResponse, @RequestBody FieldModel restModel) {
HttpServletContentWrapper servletContentWrapper = new HttpServletContentWrapper(httpRequest, httpResponse);
ActionResponse<T> result = functionAction.createResponse(restModel, servletContentWrapper);
return ResponseFactory.createContentResponseFromAction(result);
}
use of com.synopsys.integration.alert.common.rest.HttpServletContentWrapper in project hub-alert by blackducksoftware.
the class ProcessingSelectCustomFunctionAction method createActionResponse.
@Override
public ActionResponse<LabelValueSelectOptions> createActionResponse(FieldModel fieldModel, HttpServletContentWrapper servletContentWrapper) {
String channelName = fieldModel.getFieldValue(ChannelDescriptor.KEY_CHANNEL_NAME).orElse("");
List<LabelValueSelectOption> options = Arrays.stream(ProcessingType.values()).filter(processingType -> this.shouldInclude(processingType, channelName)).map(processingType -> new LabelValueSelectOption(processingType.getLabel(), processingType.name())).collect(Collectors.toList());
LabelValueSelectOptions optionList = new LabelValueSelectOptions(options);
return new ActionResponse<>(HttpStatus.OK, optionList);
}
Aggregations