changeset 998:27029f0ec7e1

Reverted the changes of rev1194. gnv/trunk@1199 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 11 Jun 2010 10:28:50 +0000
parents f55692e3e0ce
children 961c2c89a37c
files gnv/ChangeLog gnv/src/main/java/de/intevation/gnv/action/DescribeUIAction.java gnv/src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java gnv/src/main/java/de/intevation/gnv/util/XSLTransformer.java gnv/src/main/webapp/WEB-INF/config/struts-config.xml gnv/src/main/webapp/WEB-INF/config/templates/describe-ui.xsl gnv/src/main/webapp/WEB-INF/jsp/index.jsp gnv/src/main/webapp/styles/gnv.css
diffstat 9 files changed, 58 insertions(+), 124 deletions(-) [+]
line wrap: on
line diff
--- a/gnv/ChangeLog	Fri Jun 11 09:25:44 2010 +0000
+++ b/gnv/ChangeLog	Fri Jun 11 10:28:50 2010 +0000
@@ -1,3 +1,15 @@
+2010-06-11  Ingo Weinzierl <ingo.weinzierl@intevation.de>
+
+	* src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java,
+	  src/main/java/de/intevation/gnv/action/DescribeUIAction.java,
+	  src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java,
+	  src/main/java/de/intevation/gnv/util/XSLTransformer.java,
+	  src/main/webapp/styles/gnv.css,
+	  src/main/webapp/WEB-INF/config/struts-config.xml,
+	  src/main/webapp/WEB-INF/config/templates/describe-ui.xsl,
+	  src/main/webapp/WEB-INF/jsp/index.jsp: Reverted the changes of rev1194 -
+	  the feature implemented in rev1194 has not been finished so far.
+
 2010-06-11  Tim Englich  <tim.englich@intevation.de>
 
 	* src/main/webapp/scripts/viewport.jsp,
--- a/gnv/src/main/java/de/intevation/gnv/action/DescribeUIAction.java	Fri Jun 11 09:25:44 2010 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/action/DescribeUIAction.java	Fri Jun 11 10:28:50 2010 +0000
@@ -25,8 +25,6 @@
 import de.intevation.gnv.util.XMLUtils;
 import de.intevation.gnv.util.XSLTransformer;
 
-import org.apache.log4j.Logger;
-
 /**
  * This controller is called to fetch the current artifact description using the
  * describe operation. The describe document is used to feed an XSL transformer
@@ -38,9 +36,6 @@
  */
 public class DescribeUIAction extends ArtifactDatabaseActionBase {
 
-    private static Logger log = Logger
-            .getLogger(DescribeUIAction.class);
-
     public static final String XPATH_DYNAMIC_UI = "art:dynamic";
     public static final String XPATH_STATIC_UI  = "art:static";
 
@@ -63,11 +58,6 @@
         super();
     }
 
-    public static String getInputException(HttpServletRequest request) {
-        Object msg = request.getAttribute(CommunicationKeys.REQUEST_EXCEPTION_INPUT_ID);
-        return msg != null ? msg.toString() : "";
-    }
-
 
     @Override
     public ActionForward execute(
@@ -114,10 +104,8 @@
             if (currentUI != null) {
                 ResourceBundle res = ResourceBundle.getBundle(
                     "applicationMessages", locale);
-                String editText = res.getString(
+                String editText           = res.getString(
                     "gnviewer.history.back.button");
-                String submitButton = res.getString(
-                    "gnviewer.select.button.src");
                 String exampleLinestring = res.getString(
                     "gnviewer.example.linestring");
                 String examplePolygon = res.getString(
@@ -125,37 +113,12 @@
 
                 XSLTransformer transformer = new XSLTransformer();
 
-                String nextUrl = response.encodeURL(
-                    mapping.findForward("next").getPath());
-
                 String url = response.encodeURL(
                     mapping.findForward("back").getPath());
-
-
-                transformer.addParameter(
-                    "uuid",
-                    sm.getCurrentArtifact().getDescription());
-
-                transformer.addParameter(
-                    "exception",
-                    getInputException(request));
-
-
-                Object ft = request.getAttribute("furthertargets");
-
-                transformer.addParameter("further",
-                    ft == null || (ft instanceof Boolean && ((Boolean)ft).booleanValue())
-                    ? "true"
-                    : "false");
-
-                transformer.addParameter("next-url", nextUrl);
                 transformer.addParameter("back-url", url);
                 transformer.addParameter("edit", editText);
                 transformer.addParameter("example-polygon", examplePolygon);
                 transformer.addParameter(
-                    "gnviewer-select-button-src",
-                    submitButton);
-                transformer.addParameter(
                     "example-linestring",
                     exampleLinestring);
 
@@ -172,9 +135,10 @@
                 );
 
                 String ui = transformer.transform(
-                    dynamicNode.getParentNode(),
+                    dynamicNode,
                     "UTF-8",
-                    request.getRealPath(XSL_SHEET_DYNAMIC));
+                    request.getRealPath(XSL_SHEET_DYNAMIC
+                ));
 
                 if (ui != null && ui.length() > 1)
                     request.setAttribute("ui", ui);
--- a/gnv/src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java	Fri Jun 11 09:25:44 2010 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java	Fri Jun 11 10:28:50 2010 +0000
@@ -98,7 +98,7 @@
                         );
                     }
                     catch (ArtifactDatabaseInputException e) {
-                        log.debug(e, e);
+                        log.error(e, e);
                         request.setAttribute(
                             CommunicationKeys.REQUEST_EXCEPTION_INPUT_ID,
                             e.getMessage());
@@ -113,7 +113,7 @@
                     Map tmpOuts = ad.getOutputModes();
                     request.setAttribute(
                         "furthertargets",
-                        Boolean.valueOf(tmpOuts == null || tmpOuts.isEmpty())
+                        tmpOuts == null || tmpOuts.isEmpty()
                     );
                 } else {
                     try{
@@ -139,7 +139,7 @@
                             e.getMessage());
                     }
 
-                    request.setAttribute("furthertargets", Boolean.FALSE);
+                    request.setAttribute("furthertargets", false);
                 }
             }else{
                 log.warn("SessionTimeout has occured");
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java	Fri Jun 11 09:25:44 2010 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java	Fri Jun 11 10:28:50 2010 +0000
@@ -25,11 +25,9 @@
  */
 public interface ArtifactDatabaseClient {
 
-    public final static String ARTIFACTDATABASE_COUNT_ID =
-        "de.intevation.gnv.artifactdatabase.client.ArtifactDatabase.count";
+    public final static String ARTIFACTDATABASE_COUNT_ID = "de.intevation.gnv.artifactdatabase.client.ArtifactDatabase.count";
 
-    public final static String ARTIFACTDATABASE_URL_ID =
-        "de.intevation.gnv.artifactdatabase.client.ArtifactDatabase.url";
+    public final static String ARTIFACTDATABASE_URL_ID = "de.intevation.gnv.artifactdatabase.client.ArtifactDatabase.url";
 
     /**
      * Return the Artifactfactories which can be resolved.
--- a/gnv/src/main/java/de/intevation/gnv/util/XSLTransformer.java	Fri Jun 11 09:25:44 2010 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/util/XSLTransformer.java	Fri Jun 11 10:28:50 2010 +0000
@@ -98,7 +98,7 @@
      */
     public void addParameter(String name, String value) {
         if (params == null) {
-            params = new HashMap<String, String>();
+            params = new HashMap<String, String>(3);
         }
 
         params.put(name, value);
--- a/gnv/src/main/webapp/WEB-INF/config/struts-config.xml	Fri Jun 11 09:25:44 2010 +0000
+++ b/gnv/src/main/webapp/WEB-INF/config/struts-config.xml	Fri Jun 11 10:28:50 2010 +0000
@@ -91,9 +91,6 @@
            <forward
                name="back"
                path="/gnv/back.do"/>
-           <forward
-               name="next"
-               path="/gnv/next.do"/>
             <forward
                 name="selectfis"
                 path="/gnv/selectFis.do"/>
@@ -109,9 +106,6 @@
                 name="back"
                 path="/gnv/back.do"/>
             <forward
-                name="next"
-                path="/gnv/next.do"/>
-            <forward
                 name="selectfis"
                 path="/gnv/selectFis.do"/>
         </action>
@@ -130,9 +124,6 @@
            <forward
                 name="success"
                 path="/WEB-INF/jsp/mainlayout.jsp"/>
-           <forward
-               name="next"
-               path="/gnv/next.do"/>
             <forward
                 name="back"
                 path="/gnv/back.do"/>
@@ -158,9 +149,6 @@
             <forward
                 name="success"
                 path="/WEB-INF/jsp/wmslayout.jsp"/>
-           <forward
-               name="next"
-               path="/gnv/next.do"/>
             <forward
                 name="back"
                 path="/gnv/back.do"/>
@@ -192,9 +180,6 @@
             <forward
                 name="success"
                 path="/WEB-INF/jsp/mainlayout.jsp"/>
-           <forward
-               name="next"
-               path="/gnv/next.do"/>
             <forward
                 name="back"
                 path="/gnv/back.do"/>
@@ -209,9 +194,6 @@
             <forward
                 name="success"
                 path="/WEB-INF/jsp/mainlayout.jsp"/>
-           <forward
-               name="next"
-               path="/gnv/next.do"/>
             <forward
                 name="back"
                 path="/gnv/back.do"/>
@@ -226,9 +208,6 @@
             <forward
                 name="success"
                 path="/WEB-INF/jsp/mainlayout.jsp"/>
-           <forward
-               name="next"
-               path="/gnv/next.do"/>
             <forward
                 name="back"
                 path="/gnv/back.do"/>
@@ -240,9 +219,6 @@
                 type="de.intevation.gnv.action.ShowStatisticAction"
                 scope="request"
                 validate="false">
-           <forward
-               name="next"
-               path="/gnv/next.do"/>
             <forward
                 name="back"
                 path="/gnv/back.do"/>
@@ -261,9 +237,6 @@
                 name="back"
                 path="/gnv/back.do"/>
             <forward
-                name="next"
-                path="/gnv/next.do"/>
-            <forward
                 name="selectfis"
                 path="/gnv/selectFis.do"/>
             <forward
@@ -277,9 +250,6 @@
             <forward
                 name="success"
                 path="/WEB-INF/jsp/mainlayout.jsp"/>
-           <forward
-               name="next"
-               path="/gnv/next.do"/>
             <forward
                 name="back"
                 path="/gnv/back.do"/>
--- a/gnv/src/main/webapp/WEB-INF/config/templates/describe-ui.xsl	Fri Jun 11 09:25:44 2010 +0000
+++ b/gnv/src/main/webapp/WEB-INF/config/templates/describe-ui.xsl	Fri Jun 11 10:28:50 2010 +0000
@@ -11,45 +11,19 @@
 
     <xsl:param name="example-linestring"/>
     <xsl:param name="example-polygon"/>
-    <xsl:param name="next-url">/gnv/next.do</xsl:param>
-    <xsl:param name="further">false</xsl:param>
-    <xsl:param name="exception"/>
-    <xsl:param name="gnviewer-select-button-src">./images/auswaehlen.png</xsl:param>
-
-    <xsl:template match="node()">
-        <div id="timeseriesfilter"> 
-            <form id="fisSelectionForm" 
-                  onsubmit="displayOverlay()" 
-                  action="{$next-url}" 
-                  method="post">
-                <fieldset>
-                    <xsl:if test="$exception != ''">
-                         <div class="inputException"><xsl:value-of select="$exception"/></div>
-                    </xsl:if>
-                    <xsl:apply-templates mode="basic"/>
-                    <h2>Here i am</h2>
-                    <h2>"<xsl:value-of select="$further"/>"</h2>
-                    <xsl:if test="$further = 'true'">
-                        <br/>
-                        <input style="margin-top: 5px;" type="image" src="{$gnviewer-select-button-src}"/>
-                    </xsl:if>
-                </fieldset>
-            </form>
-        </div>
-    </xsl:template>
 
     <!-- single select -->
-    <xsl:template match="xform:select1" mode="basic">
+    <xsl:template match="xform:select1">
         <xsl:variable name="selectName" select="@ref"/>
         <legend><xsl:value-of select="xform:label"/></legend>
         <select name="{$selectName}">
-            <xsl:apply-templates  mode="basic"/>
+            <xsl:apply-templates />
         </select>
     </xsl:template>
 
 
     <!-- multi select -->
-    <xsl:template match="xform:select" mode="basic">
+    <xsl:template match="xform:select">
         <xsl:variable name="selectName" select="@ref"/>
         <xsl:variable name="items" select="count(//xform:item)"/>
         <legend>
@@ -64,12 +38,12 @@
             </xsl:when>
             <xsl:when test="$items &lt; 5">
                 <select name="{$selectName}" multiple="multiple" size="{$items}">
-                    <xsl:apply-templates mode="basic"/>
+                    <xsl:apply-templates/>
                 </select>
             </xsl:when>
             <xsl:otherwise>
                 <select name="{$selectName}" multiple="multiple" size="5">
-                    <xsl:apply-templates  mode="basic"/>
+                    <xsl:apply-templates />
                 </select>
             </xsl:otherwise>
         </xsl:choose>
@@ -77,7 +51,7 @@
 
 
     <!-- options for select -->
-    <xsl:template match="xform:item" mode="basic">
+    <xsl:template match="xform:item">
         <xsl:variable name="optionValue" select="xform:value"/>
         <xsl:choose>
             <xsl:when test="@selected = 'true'">
@@ -103,7 +77,7 @@
 
 
 
-    <xsl:template match="xform:group" mode="basic">
+    <xsl:template match="xform:group">
         <xsl:variable name="selectcount" select="count(xform:select)"/>
 
         <legend>
@@ -113,7 +87,7 @@
         <xsl:choose>
             <xsl:when test="$selectcount &lt; '1'">
                 <table class="dynamic">
-                    <xsl:apply-templates mode="basic"/>
+                    <xsl:apply-templates/>
                 </table>
             </xsl:when>
             <xsl:otherwise>
@@ -178,7 +152,7 @@
     </xsl:template>
 
 
-    <xsl:template match="xform:input" mode="basic">
+    <xsl:template match="xform:input">
         <xsl:variable name="inputValue" select="xform:value"/>
         <xsl:variable name="inputName" select="@ref"/>
         <xsl:variable name="label" select="xform:label"/>
@@ -207,7 +181,7 @@
     </xsl:template>
 
 
-    <xsl:template match="xform:label" mode="basic">
+    <xsl:template match="xform:label">
         <!-- do nothing here -->
     </xsl:template>
 
--- a/gnv/src/main/webapp/WEB-INF/jsp/index.jsp	Fri Jun 11 09:25:44 2010 +0000
+++ b/gnv/src/main/webapp/WEB-INF/jsp/index.jsp	Fri Jun 11 10:28:50 2010 +0000
@@ -1,10 +1,13 @@
 <%@ 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="java.util.Collection"%>
 <%@page import="de.intevation.gnv.artifactdatabase.objects.ArtifactObject"%>
 <%@page import="de.intevation.gnv.action.CommunicationKeys"%>
 <%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%>
 <%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%>
+<%@page import="java.util.Iterator"%>
 <%  
+    String exception       = (String)request.getAttribute(CommunicationKeys.REQUEST_EXCEPTION_INPUT_ID);
     SessionModel sm        = SessionModelFactory.getInstance().getSessionModel(request);
     Object ui              = request.getAttribute("ui");
     Object staticui        = request.getAttribute("staticui");
@@ -12,6 +15,7 @@
     Object statistic       = request.getAttribute("statistic");
     Object histogram       = request.getAttribute("histogram");
     Object wms_published   = request.getAttribute("wms_published");
+    boolean furthertargets = true;
 
     if (chart == null && statistic == null && histogram == null && wms_published == null) {
         boolean supportChart = sm.getOutputMode("chart") != null;
@@ -20,6 +24,10 @@
         }
     }
 
+    Object furthertargetsObject = request.getAttribute("furthertargets");
+    if (furthertargetsObject != null){
+        furthertargets = ((Boolean)furthertargetsObject).booleanValue();
+    }
 
     Object exceptionMessage = request.getAttribute(CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID);
     exceptionMessage = (exceptionMessage != null ? exceptionMessage.toString().replaceAll(" ", ".").replaceAll(":",".").toLowerCase() : null);
@@ -86,8 +94,24 @@
                 <%}%>
 
                 <%-- render the dynamic part to feed the state and advance to the next state --%>
-                <%if (ui != null) { %>
-                     <%= ui.toString().replaceAll("&nbsp;", "") %>
+                <%if (ui != null){%> 
+                    <div id="timeseriesfilter"> 
+                        <form id="fisSelectionForm" onsubmit="displayOverlay()" action="<%=response.encodeURL("next.do")%>" method="post">
+                           <fieldset>
+
+                            <%-- error message, if user input was not valid --%>
+                            <%if (exception != null) {%>
+                                <div class="inputException"><%=exception%></div>
+                            <%}%>
+                            <%=ui != null ? ui.toString().replaceAll("&nbsp;", "") : "" %>
+
+                            <%if(furthertargets){%>
+                                <br/>
+                                <input style="margin-top: 5px;" type="image" src="<bean:message key="gnviewer.select.button.src"/>"/>
+                            <%}%>
+                            </fieldset>
+                        </form>
+                    </div>
                 <%}%>
 
                     <%-- render export options if existing for this state --%>
--- a/gnv/src/main/webapp/styles/gnv.css	Fri Jun 11 09:25:44 2010 +0000
+++ b/gnv/src/main/webapp/styles/gnv.css	Fri Jun 11 10:28:50 2010 +0000
@@ -117,14 +117,6 @@
 }
 
 /* Some classes for the content */
-a.linkButton {
-    border:          1px solid #000000;
-    color:           #ff6600;
-    font-size:       1.2em;
-    padding:         1px;
-    text-decoration: none;
-}
-
 #contentElement {
     float:  left;
     height: 90%;

http://dive4elements.wald.intevation.org