This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository echobase. See http://git.codelutin.com/echobase.git commit 8ff27cb07aa85357b363dbace02bb47ff3ef62d8 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Dec 8 14:37:53 2014 +0100 fixes #6056: Impossible d'exporter une table depuis le menu "modifier données" d'Echobase --- .../ifremer/echobase/ui/actions/dbeditor/ExportTable.java | 13 ++++++++++--- .../ui/actions/exportQuery/DownloadExportQueryResult.java | 5 +++-- .../echobase/ui/actions/workingDb/DownloadDriver.java | 3 +-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/dbeditor/ExportTable.java b/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/dbeditor/ExportTable.java index 5b0514d..539b264 100644 --- a/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/dbeditor/ExportTable.java +++ b/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/dbeditor/ExportTable.java @@ -95,15 +95,22 @@ public class ExportTable extends EchoBaseActionSupport { public String execute() throws Exception { TableMeta<EchoBaseUserEntityEnum> table = dbEditorService.getTableMeta(entityType); + if (log.isInfoEnabled()) { + log.info("Will generate content to export to file: " + exportFileName); + } String content = exportService.exportData(table, exportAsSeen); if (log.isDebugEnabled()) { log.debug("file to export " + content); } - //FIXME tchemit 2012-01-05 : use the double size to be sure to have the correct length :( find out which caracters are not unicode aware in baracouda datas - contentLength = content.length() * 2; + byte[] bytes = content.getBytes(); + contentLength = bytes.length; + if (log.isDebugEnabled()) { + log.debug("Export content length: " + contentLength); + } contentType = "text/csv"; - inputStream = new ByteArrayInputStream(content.getBytes()); + + inputStream = new ByteArrayInputStream(bytes); return SUCCESS; } diff --git a/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportQuery/DownloadExportQueryResult.java b/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportQuery/DownloadExportQueryResult.java index 78c74a5..09367ba 100644 --- a/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportQuery/DownloadExportQueryResult.java +++ b/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportQuery/DownloadExportQueryResult.java @@ -87,8 +87,9 @@ public class DownloadExportQueryResult extends EchoBaseActionSupport { contentType = "text/csv"; String content = exportQueryService.createCsvFileContent(queryId); - contentLength = content.length(); - inputStream = new ByteArrayInputStream(content.getBytes()); + byte[] bytes = content.getBytes(); + contentLength = bytes.length; + inputStream = new ByteArrayInputStream(bytes); return SUCCESS; } diff --git a/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/workingDb/DownloadDriver.java b/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/workingDb/DownloadDriver.java index cbe0560..d60ab23 100644 --- a/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/workingDb/DownloadDriver.java +++ b/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/workingDb/DownloadDriver.java @@ -81,8 +81,7 @@ public class DownloadDriver extends EchoBaseActionSupport { JdbcConfiguration dbConfiguration = getEchoBaseSession().getWorkingDbConfiguration(); - fileName = - dbConfiguration.getDriverType().getPilotFileName(configuration); + fileName = dbConfiguration.getDriverType().getPilotFileName(configuration); File file = new File(configuration.getLibDirectory(), fileName); -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.