Mercurial > dive4elements > gnv-client
view gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp @ 397:dacfb0755956
Added download links for ZIP files and WMS layers.
gnv/trunk@551 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Sun, 17 Jan 2010 11:52:17 +0000 |
parents | 47e3647af88f |
children | 9005b39c52ac |
line wrap: on
line source
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> <%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> <%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> <%@page import="de.intevation.gnv.action.sessionmodel.DiagrammOptions"%> <%@page import="de.intevation.gnv.artifactdatabase.objects.OutputParameter"%> <%@page import="java.util.Collection"%> <%@page import="java.util.Iterator"%> <%@page import="java.net.URLEncoder"%> <%Object diagramm = request.getAttribute("diagramm"); SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); if (diagramm != null){ String target = "chart"; String targetCSV = "csv"; String targetODV = "odv"; String targetPDF = "pdf"; String targetSVG = "svg"; String targetZIP = "zip"; String targetWMS = "wms"; boolean supportChart = sm.getOutputMode(target) != null; boolean supportCSV = sm.getOutputMode(targetCSV) != null; boolean supportODV = sm.getOutputMode(targetODV) != null; boolean supportPDF = sm.getOutputMode(targetPDF) != null; boolean supportSVG = sm.getOutputMode(targetSVG) != null; boolean supportZIP = sm.getOutputMode(targetZIP) != null; boolean supportWMS = sm.getOutputMode(targetWMS) != null; String mimeType = null; String parameterString = ""; if (supportChart){ mimeType = sm.getOutputMode(target).getMimeType(); DiagrammOptions diagrammOptions = sm.getDiagrammOptions(); Collection<OutputParameter> op = sm.getOutputMode(target).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 mimeTypePDF = null; if (supportPDF) { mimeTypePDF = sm.getOutputMode(targetPDF).getMimeType(); } String mimeTypeSVG = null; if (supportSVG) { mimeTypeSVG = sm.getOutputMode(targetSVG).getMimeType(); mimeTypeSVG = URLEncoder.encode(mimeTypeSVG, "UTF-8"); } String mimeTypeCSV = null; if (supportCSV){ mimeTypeCSV = sm.getOutputMode(targetCSV).getMimeType(); } String mimeTypeODV = null; if (supportODV){ mimeTypeODV = sm.getOutputMode(targetODV).getMimeType(); } String mimeTypeZIP = null; if (supportZIP) { mimeTypeZIP = sm.getOutputMode(targetZIP).getMimeType(); } String mimeTypeWMS = null; if (supportWMS) { mimeTypeWMS = sm.getOutputMode(targetWMS).getMimeType(); } %> <div id="diagram"> <img src='<%=response.encodeURL("out.do?mimetype="+mimeType+"&target="+target+parameterString+"&uid="+System.currentTimeMillis())%>' alt='<bean:message key="gnviewer.output.options.diagramm.alt"/>'/> <br/> <div id="export"> <%if (supportChart) { %> <a href="<%=response.encodeURL("export.do?mimetype="+mimeType+"&target="+target+parameterString+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.save.title"/>"> <img src="images/diagram_export.png" border="0"/> </a> <%}%> <%if (supportPDF) { %> <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypePDF+"&target="+targetPDF+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.pdf.title"/>"> <img src="images/pdf.png" border="0"/> </a> <%}%> <%if (supportSVG) { %> <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeSVG+"&target="+targetSVG+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.svg.title"/>"> <img src="images/svg.png" border="0"/> </a> <%}%> <%if (supportCSV) { %> <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeCSV+"&target="+targetCSV+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.csv.title"/>"> <img src="images/data_export.png" border="0"/> </a> <%}%> <%if (supportODV) { %> <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeODV+"&target="+targetODV+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.odv.title"/>"> <img src="images/data_export.png" border="0"/> </a> <%}%> <%if (supportWMS) { %> <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeWMS+"&target="+targetWMS+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.wms.title"/>"> <img src="images/map_go.png" border="0"/> </a> <%}%> <%if (supportZIP) { %> <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeZIP+"&target="+targetZIP+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.zip.title"/>"> <img src="images/disk.png" border="0"/> </a> <%}%> </div> <jsp:include page="/WEB-INF/jsp/includes/display_diagramm_adons_inc.jsp"></jsp:include> </div> <%}%>