changeset 150:c5408b0f34c7

Now the UI will compelte be shown if the User has done an Mistake entering values to input-fields eg. Coordinates or formatted Date-Strings. issue 35 gnv/trunk@242 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Mon, 19 Oct 2009 10:30:28 +0000
parents 9b7f74e58f8d
children 30f0af26b086
files gnv/ChangeLog gnv/src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java
diffstat 2 files changed, 41 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/gnv/ChangeLog	Mon Oct 19 09:10:15 2009 +0000
+++ b/gnv/ChangeLog	Mon Oct 19 10:30:28 2009 +0000
@@ -1,5 +1,11 @@
 2009-10-19  Tim Englich  <tim.englich@intevation.de>
 
+	* src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (execute): 
+	  Now the UI will compelte be shown if the User has done an Mistake entering 
+	  values to input-fields eg. Coordinates or formatted Date-Strings. issue 35
+	  
+2009-10-19  Tim Englich  <tim.englich@intevation.de>
+	
 	* src/main/resources/applicationMessages_en.properties:
 	  Changed Lablevalues according to issue47
 	* src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: 
--- a/gnv/src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java	Mon Oct 19 09:10:15 2009 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java	Mon Oct 19 10:30:28 2009 +0000
@@ -55,7 +55,6 @@
     public ActionForward execute(ActionMapping mapping, ActionForm form,
                                  HttpServletRequest request,
                                  HttpServletResponse response) throws Exception {
-        try {
             log.debug("NextArtifactStepAction.execute");
             SessionModel sm = SessionModelFactory.getInstance()
                     .getSessionModel(request);
@@ -90,9 +89,18 @@
                     target = ad.getReachableStates().iterator().next();
                 }
 
-                ArtifactDescription artifactDescription = adc.doNextStep(sm
-                        .getSelectedArtifactFactory(), sm.getCurrentArtifact(),
-                        target, ips);
+                ArtifactDescription artifactDescription;
+                try {
+                    artifactDescription = adc.doNextStep(sm.getSelectedArtifactFactory(), 
+                                                         sm.getCurrentArtifact(),
+                                                         target, ips);
+                } catch (Exception e) {
+                    log.error(e, e);
+                    request.setAttribute(
+                            CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, e
+                                    .getMessage());
+                    artifactDescription = sm.getArtifactDescription();
+                }
 
                 Node currentUI = artifactDescription.getCurrentUI();
                 XSLTransformer transformer = new XSLTransformer();
@@ -120,23 +128,30 @@
                                 .getReachableStates().isEmpty()));
 
             } else {
-
-                adc.doFeed(sm.getSelectedArtifactFactory(), sm
-                        .getCurrentArtifact(), ips);
-
-                request.setAttribute("diagramm", true);
-
                 // statistic abholen und in das sessionmodell schreiben.
-
-                Collection<ArtifactStatisticValue> statistics = adc
-                        .calculateStatistics(sm.getSelectedArtifactFactory(),
-                                sm.getCurrentArtifact());
-                sm.setStatistics(statistics);
-
-                ArtifactDescription artifactDescription = adc
-                        .getCurrentStepDescription(sm
-                                .getSelectedArtifactFactory(), sm
-                                .getCurrentArtifact());
+                ArtifactDescription artifactDescription;
+                try{
+                    adc.doFeed(sm.getSelectedArtifactFactory(), sm
+                            .getCurrentArtifact(), ips);
+                    
+                    Collection<ArtifactStatisticValue> statistics = adc
+                            .calculateStatistics(sm.getSelectedArtifactFactory(),
+                                    sm.getCurrentArtifact());
+                    sm.setStatistics(statistics);
+                    artifactDescription = adc
+                            .getCurrentStepDescription(sm
+                                    .getSelectedArtifactFactory(), sm
+                                    .getCurrentArtifact());
+                    
+                    request.setAttribute("diagramm", true);
+                    
+                } catch (Exception e) {
+                    log.error(e, e);
+                    request.setAttribute(
+                            CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, e
+                                    .getMessage());
+                    artifactDescription = sm.getArtifactDescription();
+                }
 
                 Node currentUI = artifactDescription.getCurrentUI();
                 XSLTransformer transformer = new XSLTransformer();
@@ -162,13 +177,6 @@
                 request.setAttribute("furthertargets", false);
             }
             return super.execute(mapping, form, request, response);
-        } catch (Exception e) {
-            log.error(e, e);
-            request.setAttribute(
-                    CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, e
-                            .getMessage());
-            return super.getExceptionForward(mapping);
-        }
     }
 
 }

http://dive4elements.wald.intevation.org