comparison gnv/src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp @ 408:b5733f9f386b

Design improvements: Moved chart option panel and export actions beneath the parameterization panel on the left side. Do not render a useless 'draw' button after reaching the final state. gnv/trunk@594 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 22 Jan 2010 09:49:34 +0000
parents
children 9602f4bffc07
comparison
equal deleted inserted replaced
407:55dae5bb76db 408:b5733f9f386b
1 <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
2 <%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%>
3 <%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%>
4 <%@page import="de.intevation.gnv.action.sessionmodel.DiagrammOptions"%>
5 <%@page import="de.intevation.gnv.artifactdatabase.objects.OutputParameter"%>
6 <%@page import="java.util.Collection"%>
7 <%@page import="java.util.Iterator"%>
8 <%@page import="java.net.URLEncoder"%>
9 <%
10 SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request);
11 String mimeType = null;
12 String parameterString = "";
13
14 String target = "chart";
15 String targetCSV = "csv";
16 String targetODV = "odv";
17 String targetPDF = "pdf";
18 String targetSVG = "svg";
19 String targetZIP = "zip";
20 String targetWMS = "wms";
21
22 boolean supportChart = sm.getOutputMode(target) != null;
23 boolean supportCSV = sm.getOutputMode(targetCSV) != null;
24 boolean supportODV = sm.getOutputMode(targetODV) != null;
25 boolean supportPDF = sm.getOutputMode(targetPDF) != null;
26 boolean supportSVG = sm.getOutputMode(targetSVG) != null;
27 boolean supportZIP = sm.getOutputMode(targetZIP) != null;
28 boolean supportWMS = sm.getOutputMode(targetWMS) != null;
29
30 if (supportChart){
31 mimeType = sm.getOutputMode(target).getMimeType();
32 DiagrammOptions diagrammOptions = sm.getDiagrammOptions();
33 Collection<OutputParameter> op = sm.getOutputMode(target).getOutputParameters();
34
35 if (op != null){
36 Iterator<OutputParameter> it = op.iterator();
37 while (it.hasNext()){
38 OutputParameter parameter = it.next();
39 parameterString = parameterString +"&amp;"+parameter.getName()+"="+(diagrammOptions != null ? diagrammOptions.getValue(parameter.getName()): parameter.getValue());
40 }
41 }
42 }
43
44 String mimeTypePDF = null;
45 if (supportPDF) {
46 mimeTypePDF = sm.getOutputMode(targetPDF).getMimeType();
47 }
48 String mimeTypeSVG = null;
49 if (supportSVG) {
50 mimeTypeSVG = sm.getOutputMode(targetSVG).getMimeType();
51 mimeTypeSVG = URLEncoder.encode(mimeTypeSVG, "UTF-8");
52 }
53 String mimeTypeCSV = null;
54 if (supportCSV){
55 mimeTypeCSV = sm.getOutputMode(targetCSV).getMimeType();
56 }
57
58 String mimeTypeODV = null;
59 if (supportODV){
60 mimeTypeODV = sm.getOutputMode(targetODV).getMimeType();
61 }
62
63 String mimeTypeZIP = null;
64 if (supportZIP) {
65 mimeTypeZIP = sm.getOutputMode(targetZIP).getMimeType();
66 }
67
68 String mimeTypeWMS = null;
69 if (supportWMS) {
70 mimeTypeWMS = sm.getOutputMode(targetWMS).getMimeType();
71 }
72 %>
73
74 <%-- display export options if one is supported in this state --%>
75 <% if (supportPDF || supportSVG || supportCSV || supportODV || supportWMS || supportZIP) { %>
76 <div id="export">
77 <fieldset>
78 <legend><bean:message key="gnviewer.export.fieldset.title"/></legend>
79 <%if (supportChart) { %>
80 <a href="<%=response.encodeURL("export.do?mimetype="+mimeType+"&amp;target="+target+parameterString+"&amp;uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.save.title"/>">
81 <img src="images/diagram_export.png" border="0"/>
82 </a>
83 <%}%>
84 <%if (supportPDF) { %>
85 <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypePDF+"&amp;target="+targetPDF+"&amp;uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.pdf.title"/>">
86 <img src="images/pdf.png" border="0"/>
87 </a>
88 <%}%>
89 <%if (supportSVG) { %>
90 <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeSVG+"&amp;target="+targetSVG+"&amp;uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.svg.title"/>">
91 <img src="images/svg.png" border="0"/>
92 </a>
93 <%}%>
94 <%if (supportCSV) { %>
95 <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeCSV+"&amp;target="+targetCSV+"&amp;uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.csv.title"/>">
96 <img src="images/data_export.png" border="0"/>
97 </a>
98 <%}%>
99 <%if (supportODV) { %>
100 <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeODV+"&amp;target="+targetODV+"&amp;uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.odv.title"/>">
101 <img src="images/data_export.png" border="0"/>
102 </a>
103 <%}%>
104 <%if (supportWMS) { %>
105 <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeWMS+"&amp;target="+targetWMS+"&amp;uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.wms.title"/>">
106 <img src="images/map_go.png" border="0"/>
107 </a>
108 <%}%>
109 <%if (supportZIP) { %>
110 <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeZIP+"&amp;target="+targetZIP+"&amp;uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.zip.title"/>">
111 <img src="images/disk.png" border="0"/>
112 </a>
113 <%}%>
114 </fieldset>
115 </div>
116 <%}%>

http://dive4elements.wald.intevation.org