Mercurial > dive4elements > gnv-client
comparison gnv/src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp @ 573:bd67164cf28b
Devided actions and exports. Adjusted output and export actions.
gnv/trunk@704 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 23 Feb 2010 17:43:16 +0000 |
parents | f2ba58011a2d |
children | 2f3d885fed09 |
comparison
equal
deleted
inserted
replaced
572:3f7bbc6dc751 | 573:bd67164cf28b |
---|---|
6 <%@page import="de.intevation.gnv.artifactdatabase.objects.ArtifactObject"%> | 6 <%@page import="de.intevation.gnv.artifactdatabase.objects.ArtifactObject"%> |
7 <%@page import="java.util.Collection"%> | 7 <%@page import="java.util.Collection"%> |
8 <%@page import="java.util.Iterator"%> | 8 <%@page import="java.util.Iterator"%> |
9 <%@page import="java.net.URLEncoder"%> | 9 <%@page import="java.net.URLEncoder"%> |
10 <% | 10 <% |
11 SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); | 11 SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); |
12 ArtifactObject artifact = sm.getCurrentArtifact(); | 12 ArtifactObject artifact = sm.getCurrentArtifact(); |
13 String mimeType = null; | 13 String mimeType = null; |
14 String parameterString = ""; | 14 String wmslayer = null; |
15 String wmslayer = null; | 15 String parameterString = ""; |
16 | |
17 | 16 |
18 String target = "chart"; | 17 String target = "chart"; |
19 String targetCSV = "csv"; | 18 String targetCSV = "csv"; |
20 String targetODV = "odv"; | 19 String targetODV = "odv"; |
21 String targetPDF = "pdf"; | |
22 String targetSVG = "svg"; | |
23 String targetZIP = "zip"; | 20 String targetZIP = "zip"; |
24 String targetWMS = "wms"; | 21 String targetWMS = "wms"; |
25 String targetSta = "statistics"; | 22 String targetSta = "statistics"; |
26 String targetHis = "histogram"; | 23 String targetHis = "histogram"; |
27 | 24 |
28 boolean supportChart = sm.getOutputMode(target) != null; | 25 boolean supportChart = sm.getOutputMode(target) != null; |
29 boolean supportCSV = sm.getOutputMode(targetCSV) != null; | 26 boolean supportCSV = sm.getOutputMode(targetCSV) != null; |
30 boolean supportODV = sm.getOutputMode(targetODV) != null; | 27 boolean supportODV = sm.getOutputMode(targetODV) != null; |
31 boolean supportPDF = sm.getOutputMode(targetPDF) != null; | |
32 boolean supportSVG = sm.getOutputMode(targetSVG) != null; | |
33 boolean supportZIP = sm.getOutputMode(targetZIP) != null; | 28 boolean supportZIP = sm.getOutputMode(targetZIP) != null; |
34 boolean supportWMS = sm.getOutputMode(targetWMS) != null; | 29 boolean supportWMS = sm.getOutputMode(targetWMS) != null; |
35 boolean supportSta = sm.getOutputMode(targetSta) != null; | 30 boolean supportSta = sm.getOutputMode(targetSta) != null; |
36 boolean supportHis = sm.getOutputMode(targetHis) != null; | 31 boolean supportHis = sm.getOutputMode(targetHis) != null; |
37 | 32 |
47 parameterString = parameterString +"&"+parameter.getName()+"="+(diagrammOptions != null ? diagrammOptions.getValue(parameter.getName()): parameter.getValue()); | 42 parameterString = parameterString +"&"+parameter.getName()+"="+(diagrammOptions != null ? diagrammOptions.getValue(parameter.getName()): parameter.getValue()); |
48 } | 43 } |
49 } | 44 } |
50 } | 45 } |
51 | 46 |
52 String mimeTypePDF = null; | |
53 if (supportPDF) { | |
54 mimeTypePDF = sm.getOutputMode(targetPDF).getMimeType(); | |
55 } | |
56 String mimeTypeSVG = null; | |
57 if (supportSVG) { | |
58 mimeTypeSVG = sm.getOutputMode(targetSVG).getMimeType(); | |
59 mimeTypeSVG = URLEncoder.encode(mimeTypeSVG, "UTF-8"); | |
60 } | |
61 String mimeTypeCSV = null; | 47 String mimeTypeCSV = null; |
62 if (supportCSV){ | 48 if (supportCSV){ |
63 mimeTypeCSV = sm.getOutputMode(targetCSV).getMimeType(); | 49 mimeTypeCSV = sm.getOutputMode(targetCSV).getMimeType(); |
64 } | 50 } |
65 | 51 |
79 wmslayer = artifact.getId(); | 65 wmslayer = artifact.getId(); |
80 } | 66 } |
81 %> | 67 %> |
82 | 68 |
83 <%-- display export options if one is supported in this state --%> | 69 <%-- display export options if one is supported in this state --%> |
84 <% if (supportPDF || supportSVG || supportCSV || supportODV || supportWMS || supportZIP) { %> | 70 <% if (supportChart || supportCSV || supportODV || supportWMS || supportZIP) { %> |
85 <div id="export"> | 71 <div id="export"> |
86 <fieldset> | 72 <fieldset> |
87 <legend><bean:message key="gnviewer.export.fieldset.title"/></legend> | 73 <legend><bean:message key="gnviewer.export.fieldset.title"/></legend> |
88 <%if (supportChart) { %> | 74 <%if (supportChart) { %> |
89 <a href="<%=response.encodeURL("chart.do?mimetype="+mimeType+"&target="+target+parameterString+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.save.title"/>"> | 75 <a href="<%=response.encodeURL("chart.do?mimetype="+mimeType+"&target="+target+parameterString+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.save.title"/>"> |
90 <img src="images/chart_curve.png" border="0"/> | 76 <img src="images/chart_curve.png" border="0"/> |
91 </a> | |
92 <a href="<%=response.encodeURL("export.do?mimetype="+mimeType+"&target="+target+parameterString+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.save.title"/>"> | |
93 <img src="images/diagram_export.png" border="0"/> | |
94 </a> | |
95 <%}%> | |
96 <%if (supportPDF) { %> | |
97 <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypePDF+"&target="+targetPDF+parameterString+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.pdf.title"/>"> | |
98 <img src="images/pdf.png" border="0"/> | |
99 </a> | |
100 <%}%> | |
101 <%if (supportSVG) { %> | |
102 <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeSVG+"&target="+targetSVG+parameterString+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.svg.title"/>"> | |
103 <img src="images/svg.png" border="0"/> | |
104 </a> | |
105 <%}%> | |
106 <%if (supportCSV) { %> | |
107 <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeCSV+"&target="+targetCSV+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.csv.title"/>"> | |
108 <img src="images/data_export.png" border="0"/> | |
109 </a> | |
110 <%}%> | |
111 <%if (supportODV) { %> | |
112 <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeODV+"&target="+targetODV+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.odv.title"/>"> | |
113 <img src="images/data_export.png" border="0"/> | |
114 </a> | 77 </a> |
115 <%}%> | 78 <%}%> |
116 <%if (supportWMS) { %> | 79 <%if (supportWMS) { %> |
117 <a href="<%=response.encodeURL("wms.do?mimetype="+mimeTypeWMS+"&target="+targetWMS+"&uid="+System.currentTimeMillis()+"&layer="+wmslayer)%>" title="<bean:message key="gnviewer.output.options.export.wms.title"/>"> | 80 <a href="<%=response.encodeURL("wms.do?mimetype="+mimeTypeWMS+"&target="+targetWMS+"&uid="+System.currentTimeMillis()+"&layer="+wmslayer)%>" title="<bean:message key="gnviewer.output.options.export.wms.title"/>"> |
118 <img src="images/map_go.png" border="0"/> | 81 <img src="images/map_go.png" border="0"/> |
132 | 95 |
133 <%if (supportHis) { %> | 96 <%if (supportHis) { %> |
134 <a href="<%=response.encodeURL("histogram.do")%>" title="<bean:message key="gnviewer.histogram.button"/>"> | 97 <a href="<%=response.encodeURL("histogram.do")%>" title="<bean:message key="gnviewer.histogram.button"/>"> |
135 <img src="images/chart_bar.png" border="0"/> | 98 <img src="images/chart_bar.png" border="0"/> |
136 </a> | 99 </a> |
100 <%}%> | |
101 <%if (supportCSV) { %> | |
102 <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeCSV+"&target="+targetCSV+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.csv.title"/>"> | |
103 <img src="images/data_export.png" border="0"/> | |
104 </a> | |
105 <%}%> | |
106 <%if (supportODV) { %> | |
107 <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeODV+"&target="+targetODV+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.odv.title"/>"> | |
108 <img src="images/data_export.png" border="0"/> | |
109 </a> | |
137 <%}%> | 110 <%}%> |
138 </fieldset> | 111 </fieldset> |
139 </div> | 112 </div> |
140 <%}%> | 113 <%}%> |