@@ -70,6 +70,7 @@ public class ExternalMessageGrid extends FilteredGrid<ExternalMessageIndexDto, E
7070
7171 private static final String PLACEHOLDER_SPACE = String .join ("" , Collections .nCopies (35 , " " ));
7272 private static final String PDF_FILENAME_FORMAT = "sormas_lab_message_%s_%s.pdf" ;
73+ private static final String XML_FILENAME_FORMAT = "sormas_lab_message_%s_%s.xml" ;
7374
7475 private DataProviderListener <ExternalMessageIndexDto > dataProviderListener ;
7576
@@ -230,12 +231,15 @@ private Button buildDownloadButton(ExternalMessageIndexDto labMessage) {
230231 Button downloadButton = new Button (VaadinIcons .DOWNLOAD );
231232 downloadButton .setDescription (I18nProperties .getString (Strings .headingExternalMessageDownload ));
232233 final String fileName =
233- String .format (PDF_FILENAME_FORMAT , DataHelper .getShortUuid (labMessage .getUuid ()), DateHelper .formatDateForExport (new Date ()));
234+ String .format (XML_FILENAME_FORMAT , DataHelper .getShortUuid (labMessage .getUuid ()), DateHelper .formatDateForExport (new Date ()));
234235
235236 StreamResource streamResource = new StreamResource (
236- () -> ControllerProvider .getExternalMessageController ().convertToPDF (labMessage .getUuid ()).map (ByteArrayInputStream ::new ).orElse (null ),
237+ () -> ControllerProvider .getExternalMessageController ()
238+ .downloadExternalMessageAttachment (labMessage .getUuid ())
239+ .map (ByteArrayInputStream ::new )
240+ .orElse (null ),
237241 fileName );
238- streamResource .setMIMEType ("text/pdf " );
242+ streamResource .setMIMEType ("application/xml " );
239243
240244 FileDownloader fileDownloader = new FileDownloader (streamResource );
241245 fileDownloader .extend (downloadButton );
0 commit comments