use of org.asqatasun.webapp.validator.AuditSetUpFormValidator in project Asqatasun by Asqatasun.
the class AuditScenarioController method submitForm.
@RequestMapping(value = TgolKeyStore.AUDIT_SCENARIO_SET_UP_CONTRACT_URL, method = RequestMethod.POST)
@Secured({ TgolKeyStore.ROLE_USER_KEY, TgolKeyStore.ROLE_ADMIN_KEY })
protected String submitForm(@ModelAttribute(TgolKeyStore.ADD_SCENARIO_COMMAND_KEY) AuditSetUpCommand auditSetUpCommand, BindingResult result, Model model, HttpServletRequest request) {
Contract contract = getContractDataService().read(auditSetUpCommand.getContractId());
Map<String, List<AuditSetUpFormField>> formFielMap = getFreshAuditSetUpFormFieldMap(contract, getScenarioOptionFormFieldBuilderMap());
AuditSetUpFormValidator auditSetUpFormValidator = getAuditSiteSetUpFormValidator();
return submitForm(contract, auditSetUpCommand, formFielMap, auditSetUpFormValidator, model, result, request);
}
use of org.asqatasun.webapp.validator.AuditSetUpFormValidator in project Asqatasun by Asqatasun.
the class AuditSetUpController method submitAuditSetUpForm.
/**
* Submit in case of site audit
* @param auditSetUpCommand
* @param result
* @param model
* @param request
* @return
*/
@RequestMapping(method = RequestMethod.POST)
@Secured({ TgolKeyStore.ROLE_USER_KEY, TgolKeyStore.ROLE_ADMIN_KEY })
protected String submitAuditSetUpForm(@ModelAttribute(TgolKeyStore.AUDIT_SET_UP_COMMAND_KEY) AuditSetUpCommand auditSetUpCommand, BindingResult result, Model model, HttpServletRequest request) {
Contract contract = getContractDataService().read(auditSetUpCommand.getContractId());
Map<String, List<AuditSetUpFormField>> formFielMap = null;
AuditSetUpFormValidator auditSetUpFormValidator = null;
if (auditSetUpCommand.getRelaunch()) {
return launchAudit(contract, auditSetUpCommand, model, request);
}
switch(auditSetUpCommand.getScope()) {
case DOMAIN:
formFielMap = getFreshAuditSetUpFormFieldMap(contract, getSiteOptionFormFieldBuilderMap());
auditSetUpFormValidator = getAuditSiteSetUpFormValidator();
break;
case PAGE:
formFielMap = getFreshAuditSetUpFormFieldMap(contract, getPageOptionFormFieldBuilderMap());
auditSetUpFormValidator = getAuditPageSetUpFormValidator();
break;
case FILE:
formFielMap = getFreshAuditSetUpFormFieldMap(contract, getUploadOptionFormFieldBuilderMap());
auditSetUpFormValidator = getAuditUploadSetUpFormValidator();
break;
}
return submitForm(contract, auditSetUpCommand, formFielMap, auditSetUpFormValidator, model, result, request);
}
Aggregations