changeset 686:734e8301c9ea

Added links to reload the application and rebuild the user interface (issue13, issue18). gnv/trunk@864 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 29 Mar 2010 10:45:08 +0000
parents e47e6762b431
children acf62a4a23db
files gnv/ChangeLog gnv/src/main/resources/applicationMessages.properties gnv/src/main/resources/applicationMessages_en.properties gnv/src/main/webapp/WEB-INF/config/struts-config.xml gnv/src/main/webapp/WEB-INF/jsp/header.jsp gnv/src/main/webapp/WEB-INF/jsp/mainlayout.jsp gnv/src/main/webapp/styles/default.css
diffstat 7 files changed, 67 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/gnv/ChangeLog	Mon Mar 29 10:41:50 2010 +0000
+++ b/gnv/ChangeLog	Mon Mar 29 10:45:08 2010 +0000
@@ -1,3 +1,29 @@
+2010-03-29  Ingo Weinzierl <ingo.weinzierl@intevation.de>
+
+	  Issue13 & Issue18
+
+	* src/main/webapp/WEB-INF/jsp/mainlayout.jsp,
+	  src/main/webapp/WEB-INF/jsp/header.jsp: Added a reload link. A click on
+	  this link rebuilds the ui with the description of the current artifact.
+
+	  Note: If the artifact server ist down, nothing happens when using this
+	  link. A click on this link triggers a controller which sends a
+	  describe-request to the artifact server.
+
+	* src/main/webapp/WEB-INF/config/struts-config.xml: Added a new controller
+	  to build the current user interface. This could be used if the artifact
+	  server is down and the ui brakes after an user interaction. After the 
+	  artifact server being restarted, this controller can be called to rebuild
+	  the ui with the current artifact description.
+
+	* src/main/webapp/styles/default.css: Moved exception message and reload
+	  link a bit to avoid overlapping elements. Added a new class to adjust the
+	  style of the reload link.
+
+	* src/main/resources/applicationMessages.properties,
+	  src/main/resources/applicationMessages_en.properties: Added strings for
+	  reload-link.
+
 2010-03-29	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/gnv/**/package.html: New.
--- a/gnv/src/main/resources/applicationMessages.properties	Mon Mar 29 10:41:50 2010 +0000
+++ b/gnv/src/main/resources/applicationMessages.properties	Mon Mar 29 10:45:08 2010 +0000
@@ -2,6 +2,7 @@
 application.name=${pom.name}
 application.version=${pom.version}
 application.releasedate=${timestamp}
+application.reload=Klicken Sie hier um es erneut zu versuchen
 
 gnviewer.app.title = BSH-GDI genericViewer
 
--- a/gnv/src/main/resources/applicationMessages_en.properties	Mon Mar 29 10:41:50 2010 +0000
+++ b/gnv/src/main/resources/applicationMessages_en.properties	Mon Mar 29 10:45:08 2010 +0000
@@ -2,6 +2,7 @@
 application.name=${pom.name}
 application.version=${pom.version}
 application.releasedate=${timestamp}
+application.reload=Click here to try again
 
 gnviewer.app.title = BSH-GDI genericViewer
 
--- a/gnv/src/main/webapp/WEB-INF/config/struts-config.xml	Mon Mar 29 10:41:50 2010 +0000
+++ b/gnv/src/main/webapp/WEB-INF/config/struts-config.xml	Mon Mar 29 10:45:08 2010 +0000
@@ -205,7 +205,21 @@
                 name="success"
                 path="/WEB-INF/jsp/mainlayout.jsp"/>
         </action>
-       </action-mappings>
+        <action path="/describe"
+                type="de.intevation.gnv.action.DescribeUIAction"
+                scope="request"
+                validate="false">
+            <forward
+                name="back"
+                path="/gnv/back.do"/>
+            <forward
+                name="selectfis"
+                path="/gnv/selectFis.do"/>
+            <forward
+                name="success"
+                path="/WEB-INF/jsp/mainlayout.jsp"/>
+        </action>
+    </action-mappings>
        
        <message-resources parameter="applicationMessages" null="false"/>
 </struts-config>
--- a/gnv/src/main/webapp/WEB-INF/jsp/header.jsp	Mon Mar 29 10:41:50 2010 +0000
+++ b/gnv/src/main/webapp/WEB-INF/jsp/header.jsp	Mon Mar 29 10:45:08 2010 +0000
@@ -44,7 +44,13 @@
             </tr>
         </table>
         <%if (exceptionProject != null) {%>
-            <div class="projectException"><bean:message key="<%=exceptionProject%>"/></div>
+            <div class="projectException">
+                <bean:message key="<%=exceptionProject%>"/>
+                <br/>
+                <a href="<%=response.encodeURL("describe.do?uid="+System.currentTimeMillis())%>" title="<bean:message key="application.reload"/>">
+                    <bean:message key="application.reload"/>
+                </a>
+            </div>
         <%}%>
             
         <br/>
@@ -55,6 +61,11 @@
     <div class="errormsg" id="load_error">
          <%if (exceptionMessage != null){ %>
             <bean-el:message key="<%=exceptionMessage.toString()%>"/>
+            <p class="reload">
+                <a href="<%=response.encodeURL("describe.do?uid="+System.currentTimeMillis())%>" title="<bean:message key="application.reload"/>">
+                    <bean:message key="application.reload"/>
+                </a>
+            </p>
          <%}%>
      </div>
 </div>
--- a/gnv/src/main/webapp/WEB-INF/jsp/mainlayout.jsp	Mon Mar 29 10:41:50 2010 +0000
+++ b/gnv/src/main/webapp/WEB-INF/jsp/mainlayout.jsp	Mon Mar 29 10:45:08 2010 +0000
@@ -59,6 +59,11 @@
         <div id="overlayContent">
             <p>
                 <bean:message key="gnviewer.productselection.overlay.title"/>
+                <p class="reload">
+                    <a href="<%=response.encodeURL("describe.do?uid="+System.currentTimeMillis())%>" title="<bean:message key="application.reload"/>">
+                        <bean:message key="application.reload"/>
+                    </a>
+                </p>
             </p>
         </div>
     </div>
--- a/gnv/src/main/webapp/styles/default.css	Mon Mar 29 10:41:50 2010 +0000
+++ b/gnv/src/main/webapp/styles/default.css	Mon Mar 29 10:45:08 2010 +0000
@@ -205,8 +205,12 @@
 }
 #head a {
 	clear:left;
-	
 }
+
+.reload {
+    margin-top: 10px;
+}
+
 #project {
 	position:absolute;
 	top:27px;	
@@ -226,8 +230,8 @@
 
 #load_error {
     position:absolute;
-    top:27px;   
-    left:425px;
+    top:75px;   
+    left:375px;
     width: 400px;
     text-align: left;
     

http://dive4elements.wald.intevation.org