tim@29: <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> tim@22: <%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> tim@30: <%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> tim@30: <%@page import="de.intevation.gnv.action.sessionmodel.DiagrammOptions"%> tim@30: <%@page import="de.intevation.gnv.artifactdatabase.objects.OutputParameter"%> tim@30: <%@page import="java.util.Collection"%> tim@30: <%@page import="java.util.Iterator"%> ingo@284: <%@page import="java.net.URLEncoder"%> tim@22: <%Object diagramm = request.getAttribute("diagramm"); tim@30: SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); tim@22: if (diagramm != null){ tim@29: String target = "chart"; tim@29: String targetCSV = "csv"; ingo@158: String targetODV = "odv"; ingo@283: String targetPDF = "pdf"; ingo@284: String targetSVG = "svg"; sascha@397: String targetZIP = "zip"; sascha@397: String targetWMS = "wms"; tim@30: boolean supportChart = sm.getOutputMode(target) != null; ingo@283: boolean supportCSV = sm.getOutputMode(targetCSV) != null; ingo@283: boolean supportODV = sm.getOutputMode(targetODV) != null; ingo@283: boolean supportPDF = sm.getOutputMode(targetPDF) != null; ingo@284: boolean supportSVG = sm.getOutputMode(targetSVG) != null; sascha@397: boolean supportZIP = sm.getOutputMode(targetZIP) != null; sascha@397: boolean supportWMS = sm.getOutputMode(targetWMS) != null; tim@30: String mimeType = null; tim@30: String parameterString = ""; tim@30: if (supportChart){ tim@30: mimeType = sm.getOutputMode(target).getMimeType(); tim@30: DiagrammOptions diagrammOptions = sm.getDiagrammOptions(); tim@30: Collection op = sm.getOutputMode(target).getOutputParameters(); tim@30: if (op != null){ tim@30: Iterator it = op.iterator(); tim@30: while (it.hasNext()){ tim@30: OutputParameter parameter = it.next(); tim@30: parameterString = parameterString +"&"+parameter.getName()+"="+(diagrammOptions != null ? diagrammOptions.getValue(parameter.getName()): parameter.getValue()); tim@30: } tim@30: } tim@30: } ingo@283: String mimeTypePDF = null; ingo@283: if (supportPDF) { ingo@283: mimeTypePDF = sm.getOutputMode(targetPDF).getMimeType(); ingo@283: } ingo@284: String mimeTypeSVG = null; ingo@284: if (supportSVG) { ingo@284: mimeTypeSVG = sm.getOutputMode(targetSVG).getMimeType(); ingo@284: mimeTypeSVG = URLEncoder.encode(mimeTypeSVG, "UTF-8"); ingo@284: } tim@30: String mimeTypeCSV = null; tim@30: if (supportCSV){ tim@30: mimeTypeCSV = sm.getOutputMode(targetCSV).getMimeType(); tim@30: } ingo@158: ingo@158: String mimeTypeODV = null; ingo@158: if (supportODV){ ingo@158: mimeTypeODV = sm.getOutputMode(targetODV).getMimeType(); ingo@158: } sascha@397: sascha@397: String mimeTypeZIP = null; sascha@397: if (supportZIP) { sascha@397: mimeTypeZIP = sm.getOutputMode(targetZIP).getMimeType(); sascha@397: } sascha@397: sascha@397: String mimeTypeWMS = null; sascha@397: if (supportWMS) { sascha@397: mimeTypeWMS = sm.getOutputMode(targetWMS).getMimeType(); sascha@397: } tim@29: %> tim@30:
tim@30: <bean:message key="gnviewer.output.options.diagramm.alt"/> tim@29:
tim@29:
sascha@397: <%if (supportChart) { %> tim@30: "> tim@29: tim@29: sascha@397: <%}%> ingo@283: <%if (supportPDF) { %> ingo@283: "> sascha@397: ingo@283: ingo@283: <%}%> ingo@284: <%if (supportSVG) { %> ingo@284: "> sascha@397: ingo@284: ingo@284: <%}%> tim@29: <%if (supportCSV) { %> ingo@158: "> ingo@158: ingo@158: ingo@158: <%}%> ingo@158: <%if (supportODV) { %> ingo@158: "> tim@29: tim@29: tim@29: <%}%> sascha@397: <%if (supportWMS) { %> sascha@397: "> sascha@397: sascha@397: sascha@397: <%}%> sascha@397: <%if (supportZIP) { %> sascha@397: "> sascha@397: sascha@397: sascha@397: <%}%> tim@29:
tim@30: tim@18:
ingo@158: <%}%>