annotate gnv/src/main/webapp/WEB-INF/jsp/includes/display_histogram_inc.jsp @ 581:f0f0d4eaee58

Display chart when reaching a final state which doesn't need any further user input (issue184). gnv/trunk@722 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 02 Mar 2010 09:02:31 +0000
parents a634d5ee961d
children 2f3d885fed09
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
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">
574
800874dc0b29 Add histogram option parameter to http request for fetching histogram image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 571
diff changeset
32 <img src='<%=response.encodeURL("out.do?mimetype="+mimeType+"&amp;target=histogram"+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
33 </div>

http://dive4elements.wald.intevation.org