comparison gnv/src/main/webapp/WEB-INF/jsp/includes/display_histogram_inc.jsp @ 574:800874dc0b29

Add histogram option parameter to http request for fetching histogram image. gnv/trunk@705 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 24 Feb 2010 08:35:26 +0000
parents f2ba58011a2d
children a634d5ee961d
comparison
equal deleted inserted replaced
573:bd67164cf28b 574:800874dc0b29
1 <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> 1 <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
2 <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean-el" prefix="bean-el" %> 2 <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean-el" prefix="bean-el" %>
3 <%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> 3 <%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%>
4 <%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> 4 <%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%>
5 <%@page import="de.intevation.gnv.action.sessionmodel.DiagrammOptions"%>
6 <%@page import="de.intevation.gnv.artifactdatabase.objects.OutputParameter"%>
7 <%@page import="java.util.Collection"%>
8 <%@page import="java.util.Iterator"%>
5 <% 9 <%
6 SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); 10 SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request);
7 11
8 String target = "histogram"; 12 String parameterString = "";
9 String mimeType = sm.getOutputMode(target).getMimeType(); 13 String target = "histogram";
14 String mimeType = sm.getOutputMode(target).getMimeType();
15
16 DiagrammOptions diagrammOptions = sm.getDiagrammOptions();
17 Collection<OutputParameter> op = sm.getOutputMode(target).getOutputParameters();
18
19 if (op != null){
20 Iterator<OutputParameter> it = op.iterator();
21 while (it.hasNext()){
22 OutputParameter parameter = it.next();
23 parameterString = parameterString +"&amp;"+parameter.getName()+"="+(diagrammOptions != null ? diagrammOptions.getValue(parameter.getName()): parameter.getValue());
24 }
25 }
10 %> 26 %>
11 27
12 <jsp:include page="/WEB-INF/jsp/includes/display_histogram_options_inc.jsp"></jsp:include> 28 <jsp:include page="/WEB-INF/jsp/includes/display_histogram_options_inc.jsp"></jsp:include>
13 <div class="histogram"> 29 <div class="histogram">
14 <img src='<%=response.encodeURL("out.do?mimetype="+mimeType+"&amp;target=histogram&amp;uid="+System.currentTimeMillis())%>' alt='<bean:message key="gnviewer.output.options.histogram.alt"/>'/> 30 <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"/>'/>
15 </div> 31 </div>

http://dive4elements.wald.intevation.org