private FileResourceStream export() { File downloadFile = null; String username = state.getObject().getMode() .equals(Mode.AUTOMATION) && preferences.getObject().documentType .equals(SELECTEXPORT.AUTOMATED.toString()) ? "CORRECTION_USER" : SecurityContextHolder.getContext().getAuthentication() .getName(); try { downloadFile = importExportService.exportAnnotationDocument( state.getObject().getDocument(), username, importExportService.getFormatByName(preferences.getObject().format) .get(), state.getObject().getDocument().getName(), state.getObject().getMode()); } catch (Exception e) { LOG.error("Export failed", e); error("Export failed:" + ExceptionUtils.getRootCauseMessage(e)); // This will cause the open dialog to pop up again, but at least // the error feedback message will be visible. With the // RestartResponseException the feedback message only flashes. throw new NonResettingRestartException(getPage().getPageClass()); } return new FileResourceStream(downloadFile); }
File downloadableFile = importExportService.exportAnnotationDocument(srcDoc, annotatorName, format, annDoc.getName(), Mode.ANNOTATION);
File downloadableFile = importExportService.exportAnnotationDocument(srcDocument, WebAnnoConst.CURATION_USER, format, srcDocument.getName(), Mode.CURATION);
File downloadableFile = importExportService.exportAnnotationDocument(srcDoc, annotatorName, format, annDoc.getName(), Mode.ANNOTATION);
byte[] resource; try { exportedAnnoFile = importExportService.exportAnnotationDocument(doc, aAnnotatorId, format, doc.getName(), Mode.ANNOTATION); resource = FileUtils.readFileToByteArray(exportedAnnoFile);
File downloadableFile = importExportService.exportAnnotationDocument(srcDocument, WebAnnoConst.CURATION_USER, format, srcDocument.getName(), Mode.CURATION);
byte[] resource; try { exportedAnnoFile = importExportService.exportAnnotationDocument(doc, aAnnotatorId, format, doc.getName(), Mode.ANNOTATION); resource = FileUtils.readFileToByteArray(exportedAnnoFile);
File curationFile = importExportService.exportAnnotationDocument( sourceDocument, WebAnnoConst.CURATION_USER, format, WebAnnoConst.CURATION_USER, Mode.CURATION);
File curationFile = importExportService.exportAnnotationDocument( sourceDocument, WebAnnoConst.CURATION_USER, format, WebAnnoConst.CURATION_USER, Mode.CURATION);
annotationFile = importExportService.exportAnnotationDocument( sourceDocument, annotationDocument.getUser(), format, annotationDocument.getUser(), Mode.ANNOTATION, false); aStage + CURATION_FOLDER + sourceDocument.getName()); FileUtils.forceMkdir(curationDir); File correctionFile = importExportService.exportAnnotationDocument( sourceDocument, CORRECTION_USER, format, CORRECTION_USER, Mode.CORRECTION);
File curationFile = importExportService.exportAnnotationDocument( sourceDocument, WebAnnoConst.CURATION_USER, format, WebAnnoConst.CURATION_USER, Mode.CURATION);
File curationFile = importExportService.exportAnnotationDocument( sourceDocument, WebAnnoConst.CURATION_USER, format, WebAnnoConst.CURATION_USER, Mode.CURATION);
annotationFile = importExportService.exportAnnotationDocument( sourceDocument, annotationDocument.getUser(), format, annotationDocument.getUser(), Mode.ANNOTATION, false); aStage + CURATION_FOLDER + sourceDocument.getName()); FileUtils.forceMkdir(curationDir); File correctionFile = importExportService.exportAnnotationDocument( sourceDocument, CORRECTION_USER, format, CORRECTION_USER, Mode.CORRECTION);