annotate gnv/src/main/webapp/WEB-INF/jsp/includes/display_histogram_inc.jsp @ 949:11d8cc2deb92 1.0

merged doc/1.0
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 28 Sep 2012 12:13:58 +0200
parents 271ec4d11a9f
children 28a0628b11b0
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 +"&amp;"+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 += "&amp;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
9a5e50e7afaa Added action and jsp for rendering histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30 <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
31 <img src='<%=response.encodeURL("out.do?mimetype="+mimeType+"&amp;target="+target+"&amp;mode=img"+parameterString+"&amp;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
32 </div>

http://dive4elements.wald.intevation.org