Mercurial > dive4elements > gnv-client
annotate gnv/src/main/webapp/WEB-INF/jsp/includes/display_histogram_inc.jsp @ 678:2943f69e006f
Removed xml parsing from InputStream while exporting an artifact. Just copy the input stream to the output stream.
gnv/trunk@813 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 22 Mar 2010 10:15:33 +0000 |
parents | 2f3d885fed09 |
children | 271ec4d11a9f |
rev | line source |
---|---|
569
9a5e50e7afaa
Added action and jsp for rendering histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> |
9a5e50e7afaa
Added action and jsp for rendering histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean-el" prefix="bean-el" %> |
9a5e50e7afaa
Added action and jsp for rendering histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 <%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> |
9a5e50e7afaa
Added action and jsp for rendering histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 <%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> |
574
800874dc0b29
Add histogram option parameter to http request for fetching histogram image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
571
diff
changeset
|
5 <%@page import="de.intevation.gnv.action.sessionmodel.DiagrammOptions"%> |
800874dc0b29
Add histogram option parameter to http request for fetching histogram image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
571
diff
changeset
|
6 <%@page import="de.intevation.gnv.artifactdatabase.objects.OutputParameter"%> |
800874dc0b29
Add histogram option parameter to http request for fetching histogram image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
571
diff
changeset
|
7 <%@page import="java.util.Collection"%> |
800874dc0b29
Add histogram option parameter to http request for fetching histogram image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
571
diff
changeset
|
8 <%@page import="java.util.Iterator"%> |
569
9a5e50e7afaa
Added action and jsp for rendering histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 <% |
9a5e50e7afaa
Added action and jsp for rendering histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); |
9a5e50e7afaa
Added action and jsp for rendering histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 |
574
800874dc0b29
Add histogram option parameter to http request for fetching histogram image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
571
diff
changeset
|
12 String parameterString = ""; |
800874dc0b29
Add histogram option parameter to http request for fetching histogram image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
571
diff
changeset
|
13 String target = "histogram"; |
800874dc0b29
Add histogram option parameter to http request for fetching histogram image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
571
diff
changeset
|
14 String mimeType = sm.getOutputMode(target).getMimeType(); |
800874dc0b29
Add histogram option parameter to http request for fetching histogram image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
571
diff
changeset
|
15 |
800874dc0b29
Add histogram option parameter to http request for fetching histogram image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
571
diff
changeset
|
16 DiagrammOptions diagrammOptions = sm.getDiagrammOptions(); |
800874dc0b29
Add histogram option parameter to http request for fetching histogram image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
571
diff
changeset
|
17 Collection<OutputParameter> op = sm.getOutputMode(target).getOutputParameters(); |
800874dc0b29
Add histogram option parameter to http request for fetching histogram image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
571
diff
changeset
|
18 |
800874dc0b29
Add histogram option parameter to http request for fetching histogram image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
571
diff
changeset
|
19 if (op != null){ |
800874dc0b29
Add histogram option parameter to http request for fetching histogram image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
571
diff
changeset
|
20 Iterator<OutputParameter> it = op.iterator(); |
800874dc0b29
Add histogram option parameter to http request for fetching histogram image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
571
diff
changeset
|
21 while (it.hasNext()){ |
800874dc0b29
Add histogram option parameter to http request for fetching histogram image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
571
diff
changeset
|
22 OutputParameter parameter = it.next(); |
800874dc0b29
Add histogram option parameter to http request for fetching histogram image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
571
diff
changeset
|
23 parameterString = parameterString +"&"+parameter.getName()+"="+(diagrammOptions != null ? diagrammOptions.getValue(parameter.getName()): parameter.getValue()); |
800874dc0b29
Add histogram option parameter to http request for fetching histogram image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
571
diff
changeset
|
24 } |
575
a634d5ee961d
Added checkboxes for selecting the field which is used to adjust the number of bins in histogram charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
574
diff
changeset
|
25 |
a634d5ee961d
Added checkboxes for selecting the field which is used to adjust the number of bins in histogram charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
574
diff
changeset
|
26 parameterString += "&bintype="+request.getAttribute("bintype"); |
574
800874dc0b29
Add histogram option parameter to http request for fetching histogram image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
571
diff
changeset
|
27 } |
569
9a5e50e7afaa
Added action and jsp for rendering histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 %> |
9a5e50e7afaa
Added action and jsp for rendering histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 |
571
f2ba58011a2d
Added histogram option panel. Show chart/histogram options panel after the user selected chart or histogram. Moved options panel beneath action panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
569
diff
changeset
|
30 <jsp:include page="/WEB-INF/jsp/includes/display_histogram_options_inc.jsp"></jsp:include> |
569
9a5e50e7afaa
Added action and jsp for rendering histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 <div class="histogram"> |
583
2f3d885fed09
Adjusted http requests and appended a new parameter export mode to 'out'-xml document to choose between svg, pdf or image exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
575
diff
changeset
|
32 <img src='<%=response.encodeURL("out.do?mimetype="+mimeType+"&target="+target+"&mode=img"+parameterString+"&uid="+System.currentTimeMillis())%>' alt='<bean:message key="gnviewer.output.options.histogram.alt"/>'/> |
569
9a5e50e7afaa
Added action and jsp for rendering histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 </div> |