Example #1
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 #2
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);
    }
  }
Example #3
0
 private void addInputFile(MageTabFileSet inputFileSet, CaArrayFile caArrayFile) {
   final FileType type = caArrayFile.getFileType();
   final FileRef fileRef = new CaArrayFileRef(caArrayFile, this.dataStorageFacade);
   if (FileTypeRegistry.MAGE_TAB_IDF.equals(type)) {
     inputFileSet.addIdf(fileRef);
   } else if (FileTypeRegistry.MAGE_TAB_SDRF.equals(type)) {
     inputFileSet.addSdrf(fileRef);
   } else if (type.isDataMatrix()) {
     inputFileSet.addDataMatrix(fileRef);
   } else {
     inputFileSet.addNativeData(fileRef);
   }
 }
Example #4
0
 private boolean isMageTabFile(CaArrayFile file) {
   return FileCategory.MAGE_TAB == file.getFileType().getCategory();
 }