changeset 398:9005b39c52ac

Only display chart addons if we really display a chart. gnv/trunk@555 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sun, 17 Jan 2010 17:09:21 +0000
parents dacfb0755956
children aaf04967bd53
files gnv/ChangeLog gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp
diffstat 3 files changed, 20 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/gnv/ChangeLog	Sun Jan 17 11:52:17 2010 +0000
+++ b/gnv/ChangeLog	Sun Jan 17 17:09:21 2010 +0000
@@ -1,3 +1,11 @@
+2010-01-17	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp:
+	  Only render chart addons when we have a chart.
+
+	* src/main/java/de/intevation/gnv/action/DoExportAction.java:
+	  Set right file extensions if we have WMS or ZIP export.
+
 2010-01-17	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp:
--- a/gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java	Sun Jan 17 11:52:17 2010 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java	Sun Jan 17 17:09:21 2010 +0000
@@ -35,17 +35,22 @@
             super.setHeaders(target, mimeType, response, request);
             String fileName = "GNVEXPORT_" + System.currentTimeMillis() + ".";
 
-            if (target.equalsIgnoreCase("chart")) {
+            target = target.toLowerCase();
+
+            if (target.equals("chart")) {
                 fileName = fileName
                            + mimeType.substring(mimeType.indexOf("/") + 1);
             } 
-            else if (target.equalsIgnoreCase("pdf")) {
+            else if (target.equals("pdf")) {
                 fileName = fileName + "pdf";
-            }
-            else if (target.equalsIgnoreCase("svg")) {
+            } else if (target.equals("svg")) {
                 fileName = fileName + "svg";
-            } else if (target.equalsIgnoreCase("CSV")) {
+            } else if (target.equals("csv")) {
                 fileName = fileName + "csv";
+            } else if (target.equals("zip")) {
+                fileName = fileName + "zip";
+            } else if (target.equals("wms")) {
+                fileName = fileName + "xml";
             } else {
                 fileName = fileName + "txt";
             }
@@ -56,5 +61,4 @@
             log.error(e, e);
         }
     }
-
 }
--- a/gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp	Sun Jan 17 11:52:17 2010 +0000
+++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp	Sun Jan 17 17:09:21 2010 +0000
@@ -106,6 +106,8 @@
             </a>
             <%}%>
         </div>
+        <%if (supportChart) { %>
         <jsp:include page="/WEB-INF/jsp/includes/display_diagramm_adons_inc.jsp"></jsp:include>
+        <%}%>
     </div>
 <%}%>

http://dive4elements.wald.intevation.org