예제 #1
0
 private MageTabDocumentSet getDocumentSet(MageTabFileSet mtfs) {
   try {
     MageTabDocumentSet mtds = MageTabParser.INSTANCE.parse(mtfs);
     return mtds;
   } catch (Exception ex) {
     throw new Error(ex);
   }
 }
예제 #2
0
  public MageTabDocumentSet selectRefFiles(Project project, CaArrayFileSet idfFileSet) {
    MageTabDocumentSet documentSet = null;
    final MageTabFileSet inputSet = getInputFileSet(project, idfFileSet);
    try {

      documentSet = MageTabParser.INSTANCE.parseDataFileNames(inputSet);
      handleSelectRefFilesResult(idfFileSet, this.translator.validate(documentSet, idfFileSet));
    } catch (final MageTabParsingException e) {
      updateFileStatus(idfFileSet, FileStatus.VALIDATION_ERRORS);
    } catch (final InvalidDataException e) {
      handleResult(idfFileSet, e.getValidationResult());
    }

    return documentSet;
  }
예제 #3
0
 public MageTabDocumentSet validateFiles(Project targetProject, CaArrayFileSet fileSet) {
   LOG.info("Validating MAGE-TAB document set");
   updateFileStatus(fileSet, FileStatus.VALIDATING);
   MageTabDocumentSet documentSet = null;
   final MageTabFileSet inputSet = getInputFileSet(targetProject, fileSet);
   try {
     updateFileStatus(fileSet, FileStatus.VALIDATED);
     documentSet = MageTabParser.INSTANCE.parse(inputSet);
     handleResult(fileSet, this.translator.validate(documentSet, fileSet));
   } catch (final MageTabParsingException e) {
     updateFileStatus(fileSet, FileStatus.VALIDATION_ERRORS);
   } catch (final InvalidDataException e) {
     handleResult(fileSet, e.getValidationResult());
   }
   this.searchDao.save(fileSet.getFiles());
   return documentSet;
 }
예제 #4
0
 /** {@inheritDoc} */
 @Override
 public MageTabDocumentSet importFiles(Project targetProject, CaArrayFileSet fileSet)
     throws MageTabParsingException {
   LOG.info("Importing MAGE-TAB document set");
   updateFileStatus(fileSet, FileStatus.IMPORTING);
   final MageTabFileSet inputSet = getInputFileSet(targetProject, fileSet);
   MageTabDocumentSet documentSet = null;
   try {
     documentSet = MageTabParser.INSTANCE.parse(inputSet);
     final CaArrayTranslationResult translationResult =
         this.translator.translate(documentSet, fileSet);
     save(targetProject, translationResult);
     updateFileStatus(fileSet, FileStatus.IMPORTED);
   } catch (final InvalidDataException e) {
     handleResult(fileSet, e.getValidationResult());
   }
   this.searchDao.save(fileSet.getFiles());
   return documentSet;
 }