Search in sources :

Example 1 with LocalizationExcelExporter

use of com.runwaysdk.localization.LocalizationExcelExporter in project geoprism-registry by terraframe.

the class LocalizationService method exportSpreadsheetInRequest.

@Request(RequestType.SESSION)
public InputStreamResponse exportSpreadsheetInRequest(String sessionId) {
    ServiceFactory.getRolePermissionService().enforceSRA();
    ByteArrayOutputStream bytes = new ByteArrayOutputStream();
    BufferedOutputStream buffer = new BufferedOutputStream(bytes);
    LocalizationExcelExporter exporter = new LocalizationExcelExporter(buildConfig(), buffer);
    exporter.export();
    ByteArrayInputStream is = new ByteArrayInputStream(bytes.toByteArray());
    return new InputStreamResponse(is, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "localization.xlsx");
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) LocalizationExcelExporter(com.runwaysdk.localization.LocalizationExcelExporter) InputStreamResponse(com.runwaysdk.mvc.InputStreamResponse) ByteArrayOutputStream(java.io.ByteArrayOutputStream) BufferedOutputStream(java.io.BufferedOutputStream) Request(com.runwaysdk.session.Request)

Aggregations

LocalizationExcelExporter (com.runwaysdk.localization.LocalizationExcelExporter)1 InputStreamResponse (com.runwaysdk.mvc.InputStreamResponse)1 Request (com.runwaysdk.session.Request)1 BufferedOutputStream (java.io.BufferedOutputStream)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1