Mercurial > dive4elements > gnv-client
annotate 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 |
rev | line source |
---|---|
29
bba8fd97e549
Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents:
22
diff
changeset
|
1 <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> |
22
367a00e4b9ad
Some GUI-Improvements done
Tim Englich <tim.englich@intevation.de>
parents:
18
diff
changeset
|
2 <%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> |
30
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
3 <%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
4 <%@page import="de.intevation.gnv.action.sessionmodel.DiagrammOptions"%> |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
5 <%@page import="de.intevation.gnv.artifactdatabase.objects.OutputParameter"%> |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
6 <%@page import="java.util.Collection"%> |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
7 <%@page import="java.util.Iterator"%> |
284
47e3647af88f
Added link in gui to export charts to svg.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
8 <%@page import="java.net.URLEncoder"%> |
22
367a00e4b9ad
Some GUI-Improvements done
Tim Englich <tim.englich@intevation.de>
parents:
18
diff
changeset
|
9 <%Object diagramm = request.getAttribute("diagramm"); |
30
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
10 SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); |
22
367a00e4b9ad
Some GUI-Improvements done
Tim Englich <tim.englich@intevation.de>
parents:
18
diff
changeset
|
11 if (diagramm != null){ |
29
bba8fd97e549
Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents:
22
diff
changeset
|
12 String target = "chart"; |
bba8fd97e549
Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents:
22
diff
changeset
|
13 String targetCSV = "csv"; |
158
f38a86c2c012
Added link to export data as odv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
31
diff
changeset
|
14 String targetODV = "odv"; |
283
ef10bf497a16
Added link in gui to export charts to pdf.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
158
diff
changeset
|
15 String targetPDF = "pdf"; |
284
47e3647af88f
Added link in gui to export charts to svg.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
16 String targetSVG = "svg"; |
30
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
17 boolean supportChart = sm.getOutputMode(target) != null; |
283
ef10bf497a16
Added link in gui to export charts to pdf.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
158
diff
changeset
|
18 boolean supportCSV = sm.getOutputMode(targetCSV) != null; |
ef10bf497a16
Added link in gui to export charts to pdf.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
158
diff
changeset
|
19 boolean supportODV = sm.getOutputMode(targetODV) != null; |
ef10bf497a16
Added link in gui to export charts to pdf.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
158
diff
changeset
|
20 boolean supportPDF = sm.getOutputMode(targetPDF) != null; |
284
47e3647af88f
Added link in gui to export charts to svg.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
21 boolean supportSVG = sm.getOutputMode(targetSVG) != null; |
30
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
22 String mimeType = null; |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
23 String parameterString = ""; |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
24 if (supportChart){ |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
25 mimeType = sm.getOutputMode(target).getMimeType(); |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
26 DiagrammOptions diagrammOptions = sm.getDiagrammOptions(); |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
27 Collection<OutputParameter> op = sm.getOutputMode(target).getOutputParameters(); |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
28 if (op != null){ |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
29 Iterator<OutputParameter> it = op.iterator(); |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
30 while (it.hasNext()){ |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
31 OutputParameter parameter = it.next(); |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
32 parameterString = parameterString +"&"+parameter.getName()+"="+(diagrammOptions != null ? diagrammOptions.getValue(parameter.getName()): parameter.getValue()); |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
33 } |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
34 } |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
35 } |
283
ef10bf497a16
Added link in gui to export charts to pdf.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
158
diff
changeset
|
36 String mimeTypePDF = null; |
ef10bf497a16
Added link in gui to export charts to pdf.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
158
diff
changeset
|
37 if (supportPDF) { |
ef10bf497a16
Added link in gui to export charts to pdf.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
158
diff
changeset
|
38 mimeTypePDF = sm.getOutputMode(targetPDF).getMimeType(); |
ef10bf497a16
Added link in gui to export charts to pdf.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
158
diff
changeset
|
39 } |
284
47e3647af88f
Added link in gui to export charts to svg.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
40 String mimeTypeSVG = null; |
47e3647af88f
Added link in gui to export charts to svg.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
41 if (supportSVG) { |
47e3647af88f
Added link in gui to export charts to svg.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
42 mimeTypeSVG = sm.getOutputMode(targetSVG).getMimeType(); |
47e3647af88f
Added link in gui to export charts to svg.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
43 mimeTypeSVG = URLEncoder.encode(mimeTypeSVG, "UTF-8"); |
47e3647af88f
Added link in gui to export charts to svg.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
44 } |
30
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
45 String mimeTypeCSV = null; |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
46 if (supportCSV){ |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
47 mimeTypeCSV = sm.getOutputMode(targetCSV).getMimeType(); |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
48 } |
158
f38a86c2c012
Added link to export data as odv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
31
diff
changeset
|
49 |
f38a86c2c012
Added link to export data as odv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
31
diff
changeset
|
50 String mimeTypeODV = null; |
f38a86c2c012
Added link to export data as odv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
31
diff
changeset
|
51 if (supportODV){ |
f38a86c2c012
Added link to export data as odv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
31
diff
changeset
|
52 mimeTypeODV = sm.getOutputMode(targetODV).getMimeType(); |
f38a86c2c012
Added link to export data as odv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
31
diff
changeset
|
53 } |
29
bba8fd97e549
Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents:
22
diff
changeset
|
54 %> |
30
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
55 <div id="diagram"> |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
56 <img src='<%=response.encodeURL("out.do?mimetype="+mimeType+"&target="+target+parameterString+"&uid="+System.currentTimeMillis())%>' alt='<bean:message key="gnviewer.output.options.diagramm.alt"/>'/> |
29
bba8fd97e549
Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents:
22
diff
changeset
|
57 <br/> |
bba8fd97e549
Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents:
22
diff
changeset
|
58 <div id="export"> |
30
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
59 <a href="<%=response.encodeURL("export.do?mimetype="+mimeType+"&target="+target+parameterString+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.save.title"/>"> |
29
bba8fd97e549
Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents:
22
diff
changeset
|
60 <img src="images/diagram_export.png" border="0"/> |
bba8fd97e549
Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents:
22
diff
changeset
|
61 </a> |
283
ef10bf497a16
Added link in gui to export charts to pdf.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
158
diff
changeset
|
62 <%if (supportPDF) { %> |
ef10bf497a16
Added link in gui to export charts to pdf.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
158
diff
changeset
|
63 <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypePDF+"&target="+targetPDF+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.pdf.title"/>"> |
ef10bf497a16
Added link in gui to export charts to pdf.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
158
diff
changeset
|
64 <img src="images/diagram_export.png" border="0"/> |
ef10bf497a16
Added link in gui to export charts to pdf.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
158
diff
changeset
|
65 </a> |
ef10bf497a16
Added link in gui to export charts to pdf.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
158
diff
changeset
|
66 <%}%> |
284
47e3647af88f
Added link in gui to export charts to svg.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
67 <%if (supportSVG) { %> |
47e3647af88f
Added link in gui to export charts to svg.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
68 <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeSVG+"&target="+targetSVG+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.svg.title"/>"> |
47e3647af88f
Added link in gui to export charts to svg.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
69 <img src="images/diagram_export.png" border="0"/> |
47e3647af88f
Added link in gui to export charts to svg.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
70 </a> |
47e3647af88f
Added link in gui to export charts to svg.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
71 <%}%> |
29
bba8fd97e549
Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents:
22
diff
changeset
|
72 <%if (supportCSV) { %> |
158
f38a86c2c012
Added link to export data as odv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
31
diff
changeset
|
73 <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeCSV+"&target="+targetCSV+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.csv.title"/>"> |
f38a86c2c012
Added link to export data as odv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
31
diff
changeset
|
74 <img src="images/data_export.png" border="0"/> |
f38a86c2c012
Added link to export data as odv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
31
diff
changeset
|
75 </a> |
f38a86c2c012
Added link to export data as odv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
31
diff
changeset
|
76 <%}%> |
f38a86c2c012
Added link to export data as odv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
31
diff
changeset
|
77 <%if (supportODV) { %> |
f38a86c2c012
Added link to export data as odv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
31
diff
changeset
|
78 <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeODV+"&target="+targetODV+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.odv.title"/>"> |
29
bba8fd97e549
Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents:
22
diff
changeset
|
79 <img src="images/data_export.png" border="0"/> |
bba8fd97e549
Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents:
22
diff
changeset
|
80 </a> |
bba8fd97e549
Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents:
22
diff
changeset
|
81 <%}%> |
bba8fd97e549
Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents:
22
diff
changeset
|
82 </div> |
30
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
83 <jsp:include page="/WEB-INF/jsp/includes/display_diagramm_adons_inc.jsp"></jsp:include> |
18
87002cbd194c
Static UI -integration an some refactoringwork done
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
84 </div> |
158
f38a86c2c012
Added link to export data as odv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
31
diff
changeset
|
85 <%}%> |