changeset 400:a8b1875dcd93

Just include a select box for choosing the fis if there is no static part in the describe document. gnv/trunk@563 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 18 Jan 2010 13:42:44 +0000
parents aaf04967bd53
children 002a4d38c16d
files gnv/ChangeLog gnv/src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java gnv/src/main/webapp/WEB-INF/jsp/index.jsp gnv/src/main/webapp/styles/default.css
diffstat 4 files changed, 48 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/gnv/ChangeLog	Sun Jan 17 21:18:30 2010 +0000
+++ b/gnv/ChangeLog	Mon Jan 18 13:42:44 2010 +0000
@@ -1,3 +1,16 @@
+2010-01-18  Ingo Weinzierl <ingo.weinzierl@intevation.de>
+
+	* src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java:
+	  Render the static part of the gui as well - not just the dynamic part.
+
+	* src/main/webapp/WEB-INF/jsp/index.js: Do not include the fis combo box if
+	  the describe document contains a static part, which means that the user
+	  already selected a fis.
+
+	* src/main/webapp/styles/default.css: Added 20px space at the top of the
+	  static table. Otherwise the table hides the links to load and save
+	  projects.
+
 2010-01-17	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/webapp/WEB-INF/jsp/mainlayout.jsp: Simpler
--- a/gnv/src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java	Sun Jan 17 21:18:30 2010 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java	Mon Jan 18 13:42:44 2010 +0000
@@ -13,12 +13,15 @@
 import org.apache.struts.action.ActionForward;
 import org.apache.struts.action.ActionMapping;
 
+import org.w3c.dom.Node;
+
 import de.intevation.gnv.action.sessionmodel.SessionModel;
 import de.intevation.gnv.action.sessionmodel.SessionModelFactory;
 import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient;
 import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory;
 import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription;
 import de.intevation.gnv.artifactdatabase.objects.ArtifactObject;
+import de.intevation.gnv.util.XMLUtils;
 import de.intevation.gnv.util.XSLTransformer;
 
 /**
@@ -73,11 +76,31 @@
                     .getCurrentStepDescription(af, artifact,true);
 
             XSLTransformer transformer = new XSLTransformer();
-            String ui = transformer.transform(artifactdescription
-                    .getCurrentUI(), "UTF-8", request
-                    .getRealPath("WEB-INF/config/templates/describe-ui.xsl"));
 
-            request.setAttribute("ui", ui);
+            Node dynamicUINode =  new XMLUtils().getNodeXPath(
+                artifactdescription.getCurrentUI(), "art:dynamic"
+            );
+
+            if (dynamicUINode != null){
+                String ui = transformer.transform(
+                    dynamicUINode,
+                    "UTF-8",
+                    request.getRealPath("WEB-INF/config/templates/describe-ui.xsl"));
+            
+                request.setAttribute("ui", ui);
+            }
+
+            Node staticUINode = new XMLUtils().getNodeXPath(
+                artifactdescription.getCurrentUI(), "art:static"
+            );
+
+            if (staticUINode != null) {
+                String staticUI = transformer.transform(
+                    staticUINode,
+                    "UTF-8",
+                    request.getRealPath("WEB-INF/config/templates/describe-ui-static.xsl"));
+                request.setAttribute("staticui", staticUI);
+            }
 
             // return succsess
             return super.execute(mapping, form, request, response);
--- a/gnv/src/main/webapp/WEB-INF/jsp/index.jsp	Sun Jan 17 21:18:30 2010 +0000
+++ b/gnv/src/main/webapp/WEB-INF/jsp/index.jsp	Mon Jan 18 13:42:44 2010 +0000
@@ -14,8 +14,9 @@
   }
 %>
     <div>
-    <jsp:include page="includes/display_fis_inc.jsp"></jsp:include>
-    <%if (staticui != null){ %>
+    <%if (staticui == null){ %>
+        <jsp:include page="includes/display_fis_inc.jsp"></jsp:include>
+    <%} else {%>
         <%=staticui.toString()%>
     <%}%>
     
@@ -35,4 +36,4 @@
     </div>
     <%}%>
     </div>
-    <jsp:include page="includes/display_diagramm_inc.jsp"></jsp:include>
\ No newline at end of file
+    <jsp:include page="includes/display_diagramm_inc.jsp"></jsp:include>
--- a/gnv/src/main/webapp/styles/default.css	Sun Jan 17 21:18:30 2010 +0000
+++ b/gnv/src/main/webapp/styles/default.css	Mon Jan 18 13:42:44 2010 +0000
@@ -92,6 +92,10 @@
     font-size: 0.7em;
 }
 
+table.static {
+    padding-top: 20px;
+}
+
 table, th, td {
     margin: 0;
     padding: 0;

http://dive4elements.wald.intevation.org