Mercurial > dive4elements > gnv-client
view gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp @ 986:d3e0f505f50c
Customize Look and Feel of the Mapclient to the css of this project.
gnv/trunk@1172 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Tue, 08 Jun 2010 12:44:06 +0000 |
parents | 2444da07e487 |
children | 28a0628b11b0 |
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 = "chart"; 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('diagramOptionsContent');" class="expandableFieldset"> <bean:message key="gnviewer.diagram.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 class="static"> <%if (outputMode != null && outputMode.getOutputParameters() != null && !outputMode.getOutputParameters().isEmpty()){ Iterator<OutputParameter> it = outputMode.getOutputParameters().iterator(); while (it.hasNext()){ OutputParameter om = it.next(); %> <tr> <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> <div class="exportBar"> <input type="image" name="target" value="chart" src="images/arrow_refresh.png" alt="<bean:message key="gnviewer.draw.button"/>" title="<bean:message key="gnviewer.output.options.refresh.title"/>"/> <%}%> <%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.export.png.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> <%}%> </div> </form> </fieldset> </div>