Example #1
0
 private void handleSelectRefFilesResult(CaArrayFileSet fileSet, ValidationResult result) {
   for (final String fileName : result.getFileNames()) {
     final CaArrayFile caArrayFile = fileSet.getFile(fileName);
     final FileValidationResult fileResult = result.getFileValidationResult(fileName);
     if (!fileResult.isValid()) {
       // check whether any of the validation errors are other than data file checks
       saveErrorMessages(fileResult, caArrayFile);
     }
   }
 }
Example #2
0
 private void handleResult(CaArrayFileSet fileSet, ValidationResult result) {
   for (final String fileName : result.getFileNames()) {
     final CaArrayFile caArrayFile = fileSet.getFile(fileName);
     final FileValidationResult fileResult = result.getFileValidationResult(fileName);
     if (!fileResult.isValid()) {
       caArrayFile.setFileStatus(FileStatus.VALIDATION_ERRORS);
     } else {
       caArrayFile.setFileStatus(FileStatus.VALIDATED);
     }
     caArrayFile.setValidationResult(fileResult);
     this.projectDao.save(caArrayFile);
   }
 }
Example #3
0
  private void saveErrorMessages(
      FileValidationResult fileValidationResult, CaArrayFile caArrayFile) {
    final FileValidationResult newResult = new FileValidationResult();
    for (final ValidationMessage vm : fileValidationResult.getMessages()) {
      if (vm.getType().equals(Type.ERROR)
          && !Pattern.matches(".*Array Data.*not found in the document set.*", vm.getMessage())) {
        newResult.addMessage(Type.ERROR, vm.getMessage());
      }
    }

    if (newResult.getMessages().size() > 0) {
      caArrayFile.setFileStatus(FileStatus.VALIDATION_ERRORS);
      caArrayFile.setValidationResult(newResult);
      this.projectDao.save(caArrayFile);
    }
  }