comparison 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
comparison
equal deleted inserted replaced
283:ef10bf497a16 284:47e3647af88f
3 <%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> 3 <%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%>
4 <%@page import="de.intevation.gnv.action.sessionmodel.DiagrammOptions"%> 4 <%@page import="de.intevation.gnv.action.sessionmodel.DiagrammOptions"%>
5 <%@page import="de.intevation.gnv.artifactdatabase.objects.OutputParameter"%> 5 <%@page import="de.intevation.gnv.artifactdatabase.objects.OutputParameter"%>
6 <%@page import="java.util.Collection"%> 6 <%@page import="java.util.Collection"%>
7 <%@page import="java.util.Iterator"%> 7 <%@page import="java.util.Iterator"%>
8 <%@page import="java.net.URLEncoder"%>
8 <%Object diagramm = request.getAttribute("diagramm"); 9 <%Object diagramm = request.getAttribute("diagramm");
9 SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); 10 SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request);
10 if (diagramm != null){ 11 if (diagramm != null){
11 String target = "chart"; 12 String target = "chart";
12 String targetCSV = "csv"; 13 String targetCSV = "csv";
13 String targetODV = "odv"; 14 String targetODV = "odv";
14 String targetPDF = "pdf"; 15 String targetPDF = "pdf";
16 String targetSVG = "svg";
15 boolean supportChart = sm.getOutputMode(target) != null; 17 boolean supportChart = sm.getOutputMode(target) != null;
16 boolean supportCSV = sm.getOutputMode(targetCSV) != null; 18 boolean supportCSV = sm.getOutputMode(targetCSV) != null;
17 boolean supportODV = sm.getOutputMode(targetODV) != null; 19 boolean supportODV = sm.getOutputMode(targetODV) != null;
18 boolean supportPDF = sm.getOutputMode(targetPDF) != null; 20 boolean supportPDF = sm.getOutputMode(targetPDF) != null;
21 boolean supportSVG = sm.getOutputMode(targetSVG) != null;
19 String mimeType = null; 22 String mimeType = null;
20 String parameterString = ""; 23 String parameterString = "";
21 if (supportChart){ 24 if (supportChart){
22 mimeType = sm.getOutputMode(target).getMimeType(); 25 mimeType = sm.getOutputMode(target).getMimeType();
23 DiagrammOptions diagrammOptions = sm.getDiagrammOptions(); 26 DiagrammOptions diagrammOptions = sm.getDiagrammOptions();
31 } 34 }
32 } 35 }
33 String mimeTypePDF = null; 36 String mimeTypePDF = null;
34 if (supportPDF) { 37 if (supportPDF) {
35 mimeTypePDF = sm.getOutputMode(targetPDF).getMimeType(); 38 mimeTypePDF = sm.getOutputMode(targetPDF).getMimeType();
39 }
40 String mimeTypeSVG = null;
41 if (supportSVG) {
42 mimeTypeSVG = sm.getOutputMode(targetSVG).getMimeType();
43 mimeTypeSVG = URLEncoder.encode(mimeTypeSVG, "UTF-8");
36 } 44 }
37 String mimeTypeCSV = null; 45 String mimeTypeCSV = null;
38 if (supportCSV){ 46 if (supportCSV){
39 mimeTypeCSV = sm.getOutputMode(targetCSV).getMimeType(); 47 mimeTypeCSV = sm.getOutputMode(targetCSV).getMimeType();
40 } 48 }
54 <%if (supportPDF) { %> 62 <%if (supportPDF) { %>
55 <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypePDF+"&target="+targetPDF+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.pdf.title"/>"> 63 <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypePDF+"&target="+targetPDF+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.pdf.title"/>">
56 <img src="images/diagram_export.png" border="0"/> 64 <img src="images/diagram_export.png" border="0"/>
57 </a> 65 </a>
58 <%}%> 66 <%}%>
67 <%if (supportSVG) { %>
68 <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeSVG+"&target="+targetSVG+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.svg.title"/>">
69 <img src="images/diagram_export.png" border="0"/>
70 </a>
71 <%}%>
59 <%if (supportCSV) { %> 72 <%if (supportCSV) { %>
60 <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeCSV+"&target="+targetCSV+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.csv.title"/>"> 73 <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeCSV+"&target="+targetCSV+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.csv.title"/>">
61 <img src="images/data_export.png" border="0"/> 74 <img src="images/data_export.png" border="0"/>
62 </a> 75 </a>
63 <%}%> 76 <%}%>

http://dive4elements.wald.intevation.org