Beispiel #1
0
  @Override
  protected void validate(
      SubmitExpeditedAdverseEventCommand command,
      BeanWrapper commandBean,
      Map<String, InputFieldGroup> fieldGroups,
      Errors errors) {
    Report report = command.getReport();
    ReportVersion lastVersion = report.getLastVersion();
    String emailString = lastVersion.getCcEmails();

    if (emailString != null) {
      String[] emails = emailString.split(",");
      for (String email : emails) {
        if (!isEmailValid(email)) {
          InputField field = fieldGroups.get("ccReport").getFields().get(0);
          errors.rejectValue(
              field.getPropertyName(),
              "SAE_007",
              new Object[] {field.getDisplayName()},
              "Not Valid " + field.getDisplayName());
          break;
        }
      }
    }
  }
Beispiel #2
0
  @Override
  public void postProcess(
      HttpServletRequest request, SubmitExpeditedAdverseEventCommand command, Errors errors) {
    log.debug("In postProcess");

    int targetPage = WebUtils.getTargetPage(request);

    if (log.isDebugEnabled())
      log.debug("Should process SubmitReportTab:postProcess (back button) ? " + !(targetPage < 2));
    if (targetPage < 2) return; // only process if we are moving forward.

    if (log.isDebugEnabled())
      log.debug("Should process SubmitReportTab:postProcess (errors) ? " + !errors.hasErrors());
    if (errors.hasErrors()) return;

    if (log.isDebugEnabled()) log.debug("Report active ? " + command.getReport().isActive());
    if (log.isDebugEnabled())
      log.debug("Report submitted already ? " + command.isSubmissionInprogress());

    if (command.getReport().isActive() && (!command.isSubmissionInprogress())) {
      reportSubmissionService.submitReport(command.getReport());
      command.setSubmissionInprogress(true);
    }
  }
Beispiel #3
0
 @Override
 public Map<String, Object> referenceData(SubmitExpeditedAdverseEventCommand submitCommand) {
   Report report = submitCommand.getReport();
   submitCommand.refreshReportDeliveries(report);
   return super.referenceData(submitCommand);
 }