Exemplo n.º 1
0
 private MageTabDocumentSet getDocumentSet(MageTabFileSet mtfs) {
   try {
     MageTabDocumentSet mtds = MageTabParser.INSTANCE.parse(mtfs);
     return mtds;
   } catch (Exception ex) {
     throw new Error(ex);
   }
 }
Exemplo n.º 2
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;
 }
Exemplo n.º 3
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;
 }