view gnv/src/main/webapp/WEB-INF/jsp/includes/display_wms_options_inc.jsp @ 1022:28a0628b11b0

Added license file and license header. gnv/trunk@1258 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 02 Nov 2010 17:15:08 +0000
parents 3e6e07142a48
children
line wrap: on
line source
<%--
 Copyright (c) 2010 by Intevation GmbH

 This program is free software under the LGPL (>=v2.1)
 Read the file LGPL.txt coming with the software for details
 or visit http://www.gnu.org/licenses/ if it does not exist.
--%>

<%@ 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.SessionModel"%>
<%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%>
<%@page import="de.intevation.gnv.artifactdatabase.objects.OutputMode"%>
<%@page import="de.intevation.gnv.artifactdatabase.objects.OutputParameter"%>
<%@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 layer         = (String) request.getAttribute("layer");
    String target        = "wms";
    SessionModel      sm = SessionModelFactory.getInstance().getSessionModel(request);
    Locale locale        = sm.getCurrentLocale();
    OutputMode        om = sm.getOutputMode(target);
    DiagrammOptions opts = sm.getDiagrammOptions();
    String uuid          = sm.getCurrentArtifact().getId();
%>

<div id="diagramOptionsContent">
    <fieldset>
        <legend onmousedown="displayDiv('diagramOptionsContent');" class="expandableFieldset">
            <bean:message key="gnviewer.wms.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("wms.do")%>">
            <table>
            <%  Collection<OutputParameter> params = om.getOutputParameters();
                if (om != null && params != null && !params.isEmpty()) {
                    Iterator<OutputParameter> iter = params.iterator();
                    while (iter.hasNext()) {
                        OutputParameter param = iter.next(); %>

                        <tr>
                            <td class="parameter"><bean-el:message key="<%=param.getName()%>"/></td>
                            <td>
                                <%if (param.getType().equalsIgnoreCase("boolean")) {
                                    boolean checked = (opts != null) ? "true".equalsIgnoreCase(opts.getValue(param.getName(), locale)) : param.getValue().equalsIgnoreCase("true");
                                %>
                                    <input type="checkbox" name="<%=param.getName()%>" <%=checked ? " value=\"true\" checked=\"checked\"": "" %>/>
                                <%}
                                else {%>
                                    <input type="text" name="<%=param.getName() %>" value="<%= (opts != null) ? opts.getValue(param.getName()) : param.getValue()%>"/>
                                <%}%>
                            </td>
                        </tr>
                    <%}
                }%>
                <tr>
                    <td>
                        <input type="image" name="target" value="wms" src="images/arrow_refresh.png" alt="<bean:message key="gnviewer.draw.button"/>"/>
                    </td>
                </tr>
            </table>
        </form>
    </fieldset>
</div>

http://dive4elements.wald.intevation.org