Mercurial > dive4elements > gnv-client
annotate gnv/src/main/webapp/WEB-INF/jsp/includes/display_histogram_inc.jsp @ 1145:dfe1ac687c7f tip
added tags
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:16:15 +0200 |
parents | 28a0628b11b0 |
children |
rev | line source |
---|---|
1022
28a0628b11b0
Added license file and license header.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
694
diff
changeset
|
1 <%-- |
28a0628b11b0
Added license file and license header.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
694
diff
changeset
|
2 Copyright (c) 2010 by Intevation GmbH |
28a0628b11b0
Added license file and license header.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
694
diff
changeset
|
3 |
28a0628b11b0
Added license file and license header.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
694
diff
changeset
|
4 This program is free software under the LGPL (>=v2.1) |
28a0628b11b0
Added license file and license header.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
694
diff
changeset
|
5 Read the file LGPL.txt coming with the software for details |
28a0628b11b0
Added license file and license header.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
694
diff
changeset
|
6 or visit http://www.gnu.org/licenses/ if it does not exist. |
28a0628b11b0
Added license file and license header.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
694
diff
changeset
|
7 --%> |
28a0628b11b0
Added license file and license header.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
694
diff
changeset
|
8 |
569
9a5e50e7afaa
Added action and jsp for rendering histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 <%@ 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
|
10 <%@ 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
|
11 <%@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
|
12 <%@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
|
13 <%@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
|
14 <%@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
|
15 <%@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
|
16 <%@page import="java.util.Iterator"%> |
569
9a5e50e7afaa
Added action and jsp for rendering histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 <% |
9a5e50e7afaa
Added action and jsp for rendering histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); |
9a5e50e7afaa
Added action and jsp for rendering histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 |
574
800874dc0b29
Add histogram option parameter to http request for fetching histogram image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
571
diff
changeset
|
20 String parameterString = ""; |
800874dc0b29
Add histogram option parameter to http request for fetching histogram image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
571
diff
changeset
|
21 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
|
22 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
|
23 |
800874dc0b29
Add histogram option parameter to http request for fetching histogram image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
571
diff
changeset
|
24 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
|
25 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
|
26 |
800874dc0b29
Add histogram option parameter to http request for fetching histogram image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
571
diff
changeset
|
27 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
|
28 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
|
29 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
|
30 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
|
31 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
|
32 } |
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
|
33 |
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
|
34 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
|
35 } |
569
9a5e50e7afaa
Added action and jsp for rendering histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 %> |
9a5e50e7afaa
Added action and jsp for rendering histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 |
9a5e50e7afaa
Added action and jsp for rendering histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 <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
|
39 <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
|
40 </div> |