changeset 589:960ae818296e

img-Exports will get a file extension that corresponds to their mime-type (issue187). gnv/trunk@744 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 08 Mar 2010 07:07:44 +0000
parents 15af6e7ecf3a
children 5f5f273c8566
files gnv/ChangeLog gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java
diffstat 2 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gnv/ChangeLog	Sat Mar 06 08:08:16 2010 +0000
+++ b/gnv/ChangeLog	Mon Mar 08 07:07:44 2010 +0000
@@ -1,3 +1,12 @@
+2010-03-08  Ingo Weinzierl <ingo.weinzierl@intevation.de>
+
+	  Issue187
+
+	* src/main/java/de/intevation/gnv/action/DoExportAction.java: Exports with
+	  target 'img' will get a file extension that corresponds to their
+	  mime-type. There was no code path for 'img' before, which caused the
+	  problem, that 'img'-exports had a '.txt'-file extension.
+
 2010-03-06	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/gnv/action/DoExportAction.java:
--- a/gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java	Sat Mar 06 08:08:16 2010 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java	Mon Mar 08 07:07:44 2010 +0000
@@ -178,6 +178,9 @@
             String fileName = "GNVEXPORT_" + System.currentTimeMillis() + ".";
 
             target = target.toLowerCase();
+            log.debug("******************************************************");
+            log.debug("TARGET: " + target);
+            log.debug("MIMETYPE: " + mimeType);
 
             if (target.equals("chart")) {
                 fileName = fileName
@@ -187,6 +190,10 @@
                 fileName = fileName
                            + mimeType.substring(mimeType.indexOf("/") + 1);
             }
+            else if (target.equals("img")) {
+                fileName = fileName
+                           + mimeType.substring(mimeType.indexOf("/") + 1);
+            }
             else if (target.equals("pdf")) {
                 fileName = fileName + "pdf";
             } else if (target.equals("svg")) {

http://dive4elements.wald.intevation.org