Mercurial > dive4elements > gnv-client
annotate 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 |
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"%> |
22
367a00e4b9ad
Some GUI-Improvements done
Tim Englich <tim.englich@intevation.de>
parents:
18
diff
changeset
|
8 <%Object diagramm = request.getAttribute("diagramm"); |
30
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
9 SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); |
22
367a00e4b9ad
Some GUI-Improvements done
Tim Englich <tim.englich@intevation.de>
parents:
18
diff
changeset
|
10 if (diagramm != null){ |
29
bba8fd97e549
Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents:
22
diff
changeset
|
11 String target = "chart"; |
bba8fd97e549
Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents:
22
diff
changeset
|
12 String targetCSV = "csv"; |
158
f38a86c2c012
Added link to export data as odv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
31
diff
changeset
|
13 String targetODV = "odv"; |
283
ef10bf497a16
Added link in gui to export charts to pdf.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
158
diff
changeset
|
14 String targetPDF = "pdf"; |
30
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
15 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
|
16 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
|
17 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
|
18 boolean supportPDF = sm.getOutputMode(targetPDF) != null; |
30
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
19 String mimeType = null; |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
20 String parameterString = ""; |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
21 if (supportChart){ |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
22 mimeType = sm.getOutputMode(target).getMimeType(); |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
23 DiagrammOptions diagrammOptions = sm.getDiagrammOptions(); |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
24 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
|
25 if (op != null){ |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
26 Iterator<OutputParameter> it = op.iterator(); |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
27 while (it.hasNext()){ |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
28 OutputParameter parameter = it.next(); |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
29 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
|
30 } |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
31 } |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
32 } |
283
ef10bf497a16
Added link in gui to export charts to pdf.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
158
diff
changeset
|
33 String mimeTypePDF = null; |
ef10bf497a16
Added link in gui to export charts to pdf.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
158
diff
changeset
|
34 if (supportPDF) { |
ef10bf497a16
Added link in gui to export charts to pdf.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
158
diff
changeset
|
35 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
|
36 } |
30
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
37 String mimeTypeCSV = null; |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
38 if (supportCSV){ |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
39 mimeTypeCSV = sm.getOutputMode(targetCSV).getMimeType(); |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
40 } |
158
f38a86c2c012
Added link to export data as odv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
31
diff
changeset
|
41 |
f38a86c2c012
Added link to export data as odv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
31
diff
changeset
|
42 String mimeTypeODV = null; |
f38a86c2c012
Added link to export data as odv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
31
diff
changeset
|
43 if (supportODV){ |
f38a86c2c012
Added link to export data as odv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
31
diff
changeset
|
44 mimeTypeODV = sm.getOutputMode(targetODV).getMimeType(); |
f38a86c2c012
Added link to export data as odv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
31
diff
changeset
|
45 } |
29
bba8fd97e549
Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents:
22
diff
changeset
|
46 %> |
30
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
47 <div id="diagram"> |
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
48 <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
|
49 <br/> |
bba8fd97e549
Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents:
22
diff
changeset
|
50 <div id="export"> |
30
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
51 <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
|
52 <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
|
53 </a> |
283
ef10bf497a16
Added link in gui to export charts to pdf.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
158
diff
changeset
|
54 <%if (supportPDF) { %> |
ef10bf497a16
Added link in gui to export charts to pdf.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
158
diff
changeset
|
55 <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
|
56 <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
|
57 </a> |
ef10bf497a16
Added link in gui to export charts to pdf.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
158
diff
changeset
|
58 <%}%> |
29
bba8fd97e549
Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents:
22
diff
changeset
|
59 <%if (supportCSV) { %> |
158
f38a86c2c012
Added link to export data as odv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
31
diff
changeset
|
60 <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
|
61 <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
|
62 </a> |
f38a86c2c012
Added link to export data as odv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
31
diff
changeset
|
63 <%}%> |
f38a86c2c012
Added link to export data as odv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
31
diff
changeset
|
64 <%if (supportODV) { %> |
f38a86c2c012
Added link to export data as odv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
31
diff
changeset
|
65 <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
|
66 <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
|
67 </a> |
bba8fd97e549
Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents:
22
diff
changeset
|
68 <%}%> |
bba8fd97e549
Export and Diagrammoptions integrated into GUI
Tim Englich <tim.englich@intevation.de>
parents:
22
diff
changeset
|
69 </div> |
30
07e9c137a2f1
Added dynamic Outputparameter Support and Outputparameter-manipulation
Tim Englich <tim.englich@intevation.de>
parents:
29
diff
changeset
|
70 <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
|
71 </div> |
158
f38a86c2c012
Added link to export data as odv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
31
diff
changeset
|
72 <%}%> |