diff gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp @ 284:47e3647af88f

Added link in gui to export charts to svg. gnv/trunk@388 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 30 Nov 2009 17:46:57 +0000
parents ef10bf497a16
children dacfb0755956
line wrap: on
line diff
--- a/gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp	Mon Nov 30 09:57:12 2009 +0000
+++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp	Mon Nov 30 17:46:57 2009 +0000
@@ -5,6 +5,7 @@
 <%@page import="de.intevation.gnv.artifactdatabase.objects.OutputParameter"%>
 <%@page import="java.util.Collection"%>
 <%@page import="java.util.Iterator"%>
+<%@page import="java.net.URLEncoder"%>
 <%Object diagramm = request.getAttribute("diagramm");
 SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request);
 if (diagramm != null){
@@ -12,10 +13,12 @@
     String targetCSV = "csv";
     String targetODV = "odv";
     String targetPDF = "pdf";
+    String targetSVG = "svg";
     boolean supportChart = sm.getOutputMode(target) != null;
     boolean supportCSV   = sm.getOutputMode(targetCSV) != null;
     boolean supportODV   = sm.getOutputMode(targetODV) != null;
     boolean supportPDF   = sm.getOutputMode(targetPDF) != null;
+    boolean supportSVG   = sm.getOutputMode(targetSVG) != null;
     String mimeType = null;
     String parameterString = "";
     if (supportChart){
@@ -34,6 +37,11 @@
     if (supportPDF) {
        mimeTypePDF = sm.getOutputMode(targetPDF).getMimeType();
     }
+    String mimeTypeSVG = null;
+    if (supportSVG) {
+        mimeTypeSVG = sm.getOutputMode(targetSVG).getMimeType();
+        mimeTypeSVG = URLEncoder.encode(mimeTypeSVG, "UTF-8");
+    }
     String mimeTypeCSV = null;
     if (supportCSV){
         mimeTypeCSV = sm.getOutputMode(targetCSV).getMimeType();
@@ -56,6 +64,11 @@
                 <img src="images/diagram_export.png" border="0"/>
             </a>
             <%}%>
+            <%if (supportSVG) { %>
+            <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeSVG+"&target="+targetSVG+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.svg.title"/>">
+                <img src="images/diagram_export.png" border="0"/>
+            </a>
+            <%}%>
             <%if (supportCSV) { %>
             <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeCSV+"&target="+targetCSV+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.csv.title"/>">
                 <img src="images/data_export.png" border="0"/>

http://dive4elements.wald.intevation.org