changeset 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 2ac194c2af8d
files gnv/ChangeLog gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java gnv/src/main/resources/applicationMessages.properties gnv/src/main/resources/applicationMessages_en.properties gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp gnv/src/main/webapp/WEB-INF/web.xml
diffstat 6 files changed, 31 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gnv/ChangeLog	Mon Nov 30 09:57:12 2009 +0000
+++ b/gnv/ChangeLog	Mon Nov 30 17:46:57 2009 +0000
@@ -1,3 +1,15 @@
+2009-12-30  Ingo Weinzierl <ingo.weinzierl@intevation.de>
+
+	* src/main/java/de/intevation/gnv/action/DoExportAction.java: Add svg
+	  extension to file when exporting charts to svg.
+
+	* src/main/resources/applicationMessages.properties,
+	  src/main/resources/applicationMessages_en.properties: Added label for svg 
+	  export link.
+
+	* src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp: Added link
+	  for svg export in html gui.
+
 2009-12-30  Ingo Weinzierl <ingo.weinzierl@intevation.de>
 
 	* src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp: Added
--- a/gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java	Mon Nov 30 09:57:12 2009 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java	Mon Nov 30 17:46:57 2009 +0000
@@ -41,6 +41,9 @@
             } 
             else if (target.equalsIgnoreCase("pdf")) {
                 fileName = fileName + "pdf";
+            }
+            else if (target.equalsIgnoreCase("svg")) {
+                fileName = fileName + "svg";
             } else if (target.equalsIgnoreCase("CSV")) {
                 fileName = fileName + "csv";
             } else {
--- a/gnv/src/main/resources/applicationMessages.properties	Mon Nov 30 09:57:12 2009 +0000
+++ b/gnv/src/main/resources/applicationMessages.properties	Mon Nov 30 17:46:57 2009 +0000
@@ -63,6 +63,7 @@
 gnviewer.output.options.export.csv.title=Daten als CSV exportieren
 gnviewer.output.options.export.odv.title=Daten als ODV exportieren
 gnviewer.output.options.export.pdf.title=Diagramm als PDF exportieren
+gnviewer.output.options.export.svg.title=Diagramm als SVG exportieren
 
 height=H\u00f6he
 width=Breite
--- a/gnv/src/main/resources/applicationMessages_en.properties	Mon Nov 30 09:57:12 2009 +0000
+++ b/gnv/src/main/resources/applicationMessages_en.properties	Mon Nov 30 17:46:57 2009 +0000
@@ -63,6 +63,7 @@
 gnviewer.output.options.export.csv.title=Export Data as CSV
 gnviewer.output.options.export.odv.title=Export Data as ODV
 gnviewer.output.options.export.pdf.title=Export chart as PDF
+gnviewer.output.options.export.svg.title=Export chart as SVG
 
 height=Height
 width=Width
--- 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"/>
--- a/gnv/src/main/webapp/WEB-INF/web.xml	Mon Nov 30 09:57:12 2009 +0000
+++ b/gnv/src/main/webapp/WEB-INF/web.xml	Mon Nov 30 17:46:57 2009 +0000
@@ -35,7 +35,7 @@
               The first one must be 1 -->
          <init-param>
             <param-name>de.intevation.gnv.artifactdatabase.client.ArtifactDatabase.url.1</param-name>
-            <param-value>http://localhost:8181</param-value>
+            <param-value>http://localhost:8383</param-value>
         </init-param>
         
         <!--  Load the Servlet once on Systemstartup. 

http://dive4elements.wald.intevation.org