Mercurial > dive4elements > gnv-client
view gnv/src/main/webapp/WEB-INF/jsp/includes/display_histogram_options_inc.jsp @ 993:9b126bceb0b2
gnv/issue219: Added rendering of direct links.
gnv/trunk@1194 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 10 Jun 2010 22:01:23 +0000 |
parents | c7f8a9b4b006 |
children | de9a0b16e99f |
line wrap: on
line source
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean-el" prefix="bean-el" %> <%@page import="de.intevation.gnv.action.CommunicationKeys"%> <%@page import="de.intevation.gnv.action.sessionmodel.DiagrammOptions"%> <%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> <%@page import="de.intevation.gnv.artifactdatabase.objects.OutputMode"%> <%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> <%@page import="de.intevation.gnv.artifactdatabase.objects.OutputParameter"%> <%@page import="de.intevation.gnv.artifactdatabase.objects.ExportMode"%> <%@page import="java.util.Collection"%> <%@page import="java.util.Iterator"%> <%@page import="java.util.Locale"%> <%@page import="java.net.URLEncoder"%> <% String exceptionMsg = (String)request.getAttribute(CommunicationKeys.REQUEST_EXCEPTION_MESSAGE); String exceptionValue = (String)request.getAttribute(CommunicationKeys.REQUEST_EXCEPTION_VALUE); String target = "histogram"; String targetPDF = "pdf"; String targetSVG = "svg"; String targetIMG = "img"; SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); Locale locale = sm.getCurrentLocale(); OutputMode outputMode = sm.getOutputMode(target); DiagrammOptions diagrammOptions = sm.getDiagrammOptions(); boolean useDiagrammOptions = diagrammOptions != null; ExportMode supportIMG = outputMode.getExportMode(targetIMG); ExportMode supportPDF = outputMode.getExportMode(targetPDF); ExportMode supportSVG = outputMode.getExportMode(targetSVG); String mimeType = outputMode.getMimeType(); String parameterString = ""; Collection<OutputParameter> op = outputMode.getOutputParameters(); if (op != null){ Iterator<OutputParameter> it = op.iterator(); while (it.hasNext()){ OutputParameter parameter = it.next(); parameterString = parameterString +"&"+parameter.getName()+"="+(diagrammOptions != null ? diagrammOptions.getValue(parameter.getName()): parameter.getValue()); } } String mimeTypeIMG = null; if (supportIMG != null) { mimeTypeIMG = supportIMG.getMimeType(); } String mimeTypePDF = null; if (supportPDF != null) { mimeTypePDF = supportPDF.getMimeType(); } String mimeTypeSVG = null; if (supportSVG != null) { mimeTypeSVG = supportSVG.getMimeType(); mimeTypeSVG = URLEncoder.encode(mimeTypeSVG, "UTF-8"); } %> <div id="diagramOptionsContent"> <fieldset> <legend onmousedown="displayDiv('histogramOptionsContent');" class="expandableFieldset"> <bean:message key="gnviewer.histogram.options.header.title"/> </legend> <% if (exceptionMsg != null) {%> <div id="chartException" class="chartException"> '<%=exceptionValue%>' <bean-el:message key="<%=exceptionMsg%>"/> </div> <%}%> <form id="outputOptionsForm" method="post" action="<%=response.encodeURL("changeOptions.do?target="+target)%>"> <table> <%if (outputMode != null && outputMode.getOutputParameters() != null && !outputMode.getOutputParameters().isEmpty()){ Iterator<OutputParameter> it = outputMode.getOutputParameters().iterator(); while (it.hasNext()){ OutputParameter om = it.next(); String diaOpts = null; if (diagrammOptions != null) { diaOpts = request.getParameter("bintype"); }%> <tr> <td> <%if (om.getName().equals("bincount")) { String check = ""; if (diaOpts != null && diaOpts.equalsIgnoreCase("binwidth")) { check = ""; } else { check = "checked=\"checked\""; }%> <input type="checkbox" <%= check %> name="bintype" value="bincount" id="checkCount" onClick="toggleBinType('checkWidth')"> </input> <%}%> <%if (om.getName().equals("binwidth")) { String check = ""; if (diaOpts != null && diaOpts.equalsIgnoreCase("binwidth")) { check = "checked=\"checked\""; } else if (diaOpts == null) { check = ""; }%> <input type="checkbox" <%= check %> name="bintype" value="binwidth" id="checkWidth" onClick="toggleBinType('checkCount')"> </input> <%}%> </td> <td class="parameter"> <bean-el:message key="<%=om.getName()%>"/> </td> <td> <%if (om.getType().equalsIgnoreCase("boolean")){ boolean checked = useDiagrammOptions ? "true".equalsIgnoreCase(diagrammOptions.getValue(om.getName(), locale)) : om.getValue().equalsIgnoreCase("true"); %> <input type="checkbox" name="<%=om.getName() %>" <%=checked ? " value=\"true\" checked=\"checked\"": "" %>/> <%}else{%> <input type="text" name="<%=om.getName() %>" value="<%=useDiagrammOptions ? diagrammOptions.getValue(om.getName(), locale): om.getValue()%>"/> <%}%> </td> </tr> <%}%> </table> <input type="image" name="target" value="histogram" src="images/arrow_refresh.png" alt="<bean:message key="gnviewer.draw.button"/>"/> <%}%> <%if (supportIMG != null) { %> <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeIMG+"&target="+target+"&mode="+targetIMG+parameterString+"uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.save.title"/>"> <img src="images/diagram_export.png" border="0"/></a> <%}%> <%if (supportPDF != null) { %> <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypePDF+"&target="+target+"&mode="+targetPDF+parameterString+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.pdf.title"/>"> <img src="images/pdf.png" border="0"/></a> <%}%> <%if (supportSVG != null) { %> <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeSVG+"&target="+target+"&mode="+targetSVG+parameterString+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.svg.title"/>"> <img src="images/svg.png" border="0"/></a> <%}%> </form> </fieldset> </div>