# HG changeset patch # User Ingo Weinzierl # Date 1259575032 0 # Node ID ef10bf497a16d114d8a7de91d12c02b18518a99e # Parent d6c0d426e38a99dd985907e0635c255bda01696a Added link in gui to export charts to pdf. gnv/trunk@382 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r d6c0d426e38a -r ef10bf497a16 gnv/ChangeLog --- a/gnv/ChangeLog Mon Nov 23 16:30:33 2009 +0000 +++ b/gnv/ChangeLog Mon Nov 30 09:57:12 2009 +0000 @@ -1,3 +1,17 @@ +2009-12-30 Ingo Weinzierl + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp: Added + link for pdf export in html gui. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added label for pdf + export link. + + * src/main/java/de/intevation/gnv/action/DoExportAction.java: Added pdf + extension to file when exporting charts as pdf. + + NOTE: Update gnv-artifacts to rev381 which supports pdf export. + 2009-11-23 Tim Englich * src/main/resources/applicationMessages*.properties: diff -r d6c0d426e38a -r ef10bf497a16 gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java --- a/gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java Mon Nov 23 16:30:33 2009 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java Mon Nov 30 09:57:12 2009 +0000 @@ -38,6 +38,9 @@ if (target.equalsIgnoreCase("chart")) { fileName = fileName + mimeType.substring(mimeType.indexOf("/") + 1); + } + else if (target.equalsIgnoreCase("pdf")) { + fileName = fileName + "pdf"; } else if (target.equalsIgnoreCase("CSV")) { fileName = fileName + "csv"; } else { diff -r d6c0d426e38a -r ef10bf497a16 gnv/src/main/resources/applicationMessages.properties --- a/gnv/src/main/resources/applicationMessages.properties Mon Nov 23 16:30:33 2009 +0000 +++ b/gnv/src/main/resources/applicationMessages.properties Mon Nov 30 09:57:12 2009 +0000 @@ -62,6 +62,7 @@ gnviewer.output.options.save.title=Diagramm speichern 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 height=H\u00f6he width=Breite diff -r d6c0d426e38a -r ef10bf497a16 gnv/src/main/resources/applicationMessages_en.properties --- a/gnv/src/main/resources/applicationMessages_en.properties Mon Nov 23 16:30:33 2009 +0000 +++ b/gnv/src/main/resources/applicationMessages_en.properties Mon Nov 30 09:57:12 2009 +0000 @@ -62,6 +62,7 @@ gnviewer.output.options.save.title=Save Diagram 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 height=Height width=Width @@ -71,4 +72,4 @@ no.inputdata.given..please.select.at.least.one.entry = No Entry was chosen. Please select at least one entry. de.intevation.gnv.geobackend.base.query.exception.queryexception..java.sql.sqlexception: A internal Server error has occurred. Please contact the Support. java.io.ioexception..the.server.encountered.an.unexpected.condition.which.prevented.it.from.fulfilling.the.request = A internal Server error has occurred. Please contact the Support. -java.lang.illegalargumentexception..inputstream.cannot.be.null = A internal Server error has occurred. Please contact the Support. \ No newline at end of file +java.lang.illegalargumentexception..inputstream.cannot.be.null = A internal Server error has occurred. Please contact the Support. diff -r d6c0d426e38a -r ef10bf497a16 gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp --- a/gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp Mon Nov 23 16:30:33 2009 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp Mon Nov 30 09:57:12 2009 +0000 @@ -11,9 +11,11 @@ String target = "chart"; String targetCSV = "csv"; String targetODV = "odv"; + String targetPDF = "pdf"; boolean supportChart = sm.getOutputMode(target) != null; - boolean supportCSV = sm.getOutputMode(targetCSV) != null; - boolean supportODV = sm.getOutputMode(targetODV) != null; + boolean supportCSV = sm.getOutputMode(targetCSV) != null; + boolean supportODV = sm.getOutputMode(targetODV) != null; + boolean supportPDF = sm.getOutputMode(targetPDF) != null; String mimeType = null; String parameterString = ""; if (supportChart){ @@ -28,6 +30,10 @@ } } } + String mimeTypePDF = null; + if (supportPDF) { + mimeTypePDF = sm.getOutputMode(targetPDF).getMimeType(); + } String mimeTypeCSV = null; if (supportCSV){ mimeTypeCSV = sm.getOutputMode(targetCSV).getMimeType(); @@ -45,6 +51,11 @@ "> + <%if (supportPDF) { %> + "> + + + <%}%> <%if (supportCSV) { %> ">