comparison gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp @ 283:ef10bf497a16

Added link in gui to export charts to pdf. gnv/trunk@382 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 30 Nov 2009 09:57:12 +0000
parents f38a86c2c012
children 47e3647af88f
comparison
equal deleted inserted replaced
282:d6c0d426e38a 283:ef10bf497a16
9 SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); 9 SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request);
10 if (diagramm != null){ 10 if (diagramm != null){
11 String target = "chart"; 11 String target = "chart";
12 String targetCSV = "csv"; 12 String targetCSV = "csv";
13 String targetODV = "odv"; 13 String targetODV = "odv";
14 String targetPDF = "pdf";
14 boolean supportChart = sm.getOutputMode(target) != null; 15 boolean supportChart = sm.getOutputMode(target) != null;
15 boolean supportCSV = sm.getOutputMode(targetCSV) != null; 16 boolean supportCSV = sm.getOutputMode(targetCSV) != null;
16 boolean supportODV = sm.getOutputMode(targetODV) != null; 17 boolean supportODV = sm.getOutputMode(targetODV) != null;
18 boolean supportPDF = sm.getOutputMode(targetPDF) != null;
17 String mimeType = null; 19 String mimeType = null;
18 String parameterString = ""; 20 String parameterString = "";
19 if (supportChart){ 21 if (supportChart){
20 mimeType = sm.getOutputMode(target).getMimeType(); 22 mimeType = sm.getOutputMode(target).getMimeType();
21 DiagrammOptions diagrammOptions = sm.getDiagrammOptions(); 23 DiagrammOptions diagrammOptions = sm.getDiagrammOptions();
25 while (it.hasNext()){ 27 while (it.hasNext()){
26 OutputParameter parameter = it.next(); 28 OutputParameter parameter = it.next();
27 parameterString = parameterString +"&"+parameter.getName()+"="+(diagrammOptions != null ? diagrammOptions.getValue(parameter.getName()): parameter.getValue()); 29 parameterString = parameterString +"&"+parameter.getName()+"="+(diagrammOptions != null ? diagrammOptions.getValue(parameter.getName()): parameter.getValue());
28 } 30 }
29 } 31 }
32 }
33 String mimeTypePDF = null;
34 if (supportPDF) {
35 mimeTypePDF = sm.getOutputMode(targetPDF).getMimeType();
30 } 36 }
31 String mimeTypeCSV = null; 37 String mimeTypeCSV = null;
32 if (supportCSV){ 38 if (supportCSV){
33 mimeTypeCSV = sm.getOutputMode(targetCSV).getMimeType(); 39 mimeTypeCSV = sm.getOutputMode(targetCSV).getMimeType();
34 } 40 }
43 <br/> 49 <br/>
44 <div id="export"> 50 <div id="export">
45 <a href="<%=response.encodeURL("export.do?mimetype="+mimeType+"&target="+target+parameterString+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.save.title"/>"> 51 <a href="<%=response.encodeURL("export.do?mimetype="+mimeType+"&target="+target+parameterString+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.save.title"/>">
46 <img src="images/diagram_export.png" border="0"/> 52 <img src="images/diagram_export.png" border="0"/>
47 </a> 53 </a>
54 <%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"/>">
56 <img src="images/diagram_export.png" border="0"/>
57 </a>
58 <%}%>
48 <%if (supportCSV) { %> 59 <%if (supportCSV) { %>
49 <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeCSV+"&target="+targetCSV+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.csv.title"/>"> 60 <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeCSV+"&target="+targetCSV+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.csv.title"/>">
50 <img src="images/data_export.png" border="0"/> 61 <img src="images/data_export.png" border="0"/>
51 </a> 62 </a>
52 <%}%> 63 <%}%>

http://dive4elements.wald.intevation.org