Mercurial > dive4elements > river
changeset 230:6de435235927
Added error messages that are displayed during the feed operation.
flys-client/trunk@1720 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 18 Apr 2011 13:27:49 +0000 |
parents | 924da6695800 |
children | aa496a344901 |
files | flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties flys-client/src/main/java/de/intevation/flys/client/server/StepForwardServiceImpl.java |
diffstat | 6 files changed, 74 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-client/ChangeLog Thu Apr 14 07:53:01 2011 +0000 +++ b/flys-client/ChangeLog Mon Apr 18 13:27:49 2011 +0000 @@ -1,3 +1,16 @@ +2011-04-18 Ingo Weinzierl <ingo@intevation.de> + + * src/main/java/de/intevation/flys/client/server/StepForwardServiceImpl.java: + The error key that is provided by the FLYS artifact server is read from + feed() result document and used to bring up an error popup with an + translated error message. + + * src/main/java/de/intevation/flys/client/client/FLYSConstants.properties, + src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties, + src/main/java/de/intevation/flys/client/client/FLYSConstants.java, + src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties: + Added error messages for the feed operation. + 2011-04-14 Ingo Weinzierl <ingo@intevation.de> * src/main/java/de/intevation/flys/client/client/Config.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java Thu Apr 14 07:53:01 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java Mon Apr 18 13:27:49 2011 +0000 @@ -139,5 +139,25 @@ String error_not_logged_in(); String error_load_parameterization(); + + String error_feed_no_data(); + + String error_feed_from_out_of_range(); + + String error_feed_to_out_of_range(); + + String error_feed_from_bigger_to(); + + String error_feed_invalid_wq_mode(); + + String error_feed_number_format_float(); + + String error_feed_invalid_calculation_mode(); + + String error_feed_no_calculation_mode(); + + String error_feed_no_such_river(); + + String error_feed_no_river_selected(); } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties Thu Apr 14 07:53:01 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties Mon Apr 18 13:27:49 2011 +0000 @@ -67,3 +67,14 @@ error_no_such_user = Error - no such user found. error_not_logged_in = You need to log in before you are allowed to start your work. error_load_parameterization = Could not load the parameterization. + +error_feed_no_data = No input data found. +error_feed_from_out_of_range = The lower value is bigger than the upper value. +error_feed_to_out_of_range = The upper value is out or the valid range. +error_feed_from_bigger_to = The lower value is bigger than the upper value. +error_feed_invalid_wq_mode = Invalid WQ-Mode selected. +error_feed_number_format_float = The inserted value is no floating point number. +error_feed_invalid_calculation_mode = The chosen calculation method is invalid. +error_feed_no_calculation_mode = No calculation method chosen. +error_feed_no_such_river = The selected river is not provided. +error_feed_no_river_selected = No river selected.
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties Thu Apr 14 07:53:01 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties Mon Apr 18 13:27:49 2011 +0000 @@ -67,3 +67,14 @@ error_no_such_user = Fehler - Kein Benutzer vorhanden. error_not_logged_in = Sie m\u00fcssen sich erst einloggen um mit der Arbeit beginnen zu k\u00f6nnen. error_load_parameterization = Fehler beim Laden der Parametrisierung. + +error_feed_no_data = Keine Eingabedaten gefunden. +error_feed_from_out_of_range = Der untere Wert liegt au\u00dferhalb des g\u00fcltigen Wertebereiches. +error_feed_to_out_of_range = Der obere Wert liegt au\u00dferhalb des g\u00fcltigen Wertebereiches. +error_feed_from_bigger_to = Der untere Wert ist gr\u00f6\u00dfer als der obere Wert. +error_feed_invalid_wq_mode = Ung\u00fcltiger Modus f\u00fcr die WQ-Eingabe gew\u00e4hlt. +error_feed_number_format_float = Der eingegebene Wert ist keine Flie\u00dfkommazahl. +error_feed_invalid_calculation_mode = Die gew\u00e4hlte Berechnungsart ist ung\u00fcltig. +error_feed_no_calculation_mode = Es ist keine Berechnungsart gew\u00e4hlt. +error_feed_no_such_river = Der gew\u00e4hlte Fluss wird nicht unterst\u00fctzt. +error_feed_no_river_selected = Es wurde kein Fluss gew\u00e4hlt.
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties Thu Apr 14 07:53:01 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties Mon Apr 18 13:27:49 2011 +0000 @@ -67,3 +67,14 @@ error_no_such_user = Error - no such user. error_not_logged_in = You need to log in before you are allowed to start your work. error_load_parameterization = Could not load the parameterization. + +error_feed_no_data = No input data found. +error_feed_from_out_of_range = The lower value is bigger than the upper value. +error_feed_to_out_of_range = The upper value is out or the valid range. +error_feed_from_bigger_to = The lower value is bigger than the upper value. +error_feed_invalid_wq_mode = Invalid WQ-Mode selected. +error_feed_number_format_float = The inserted value is no floating point number. +error_feed_invalid_calculation_mode = The chosen calculation method is invalid. +error_feed_no_calculation_mode = No calculation method chosen. +error_feed_no_such_river = The selected river is not provided. +error_feed_no_river_selected = No river selected.
--- a/flys-client/src/main/java/de/intevation/flys/client/server/StepForwardServiceImpl.java Thu Apr 14 07:53:01 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/server/StepForwardServiceImpl.java Mon Apr 18 13:27:49 2011 +0000 @@ -32,6 +32,9 @@ /** XPath that points to the result type of a feed or advance operation.*/ public static final String XPATH_RESULT = "/art:result/@art:type"; + /** XPath that points to the result type of a feed or advance operation.*/ + public static final String XPATH_RESULT_MSG = "/art:result/text()"; + /** A constant that marks errors.*/ public static final String OPERATION_FAILURE = "FAILURE"; @@ -101,8 +104,6 @@ artifact.getHash(), createKVP(data)); - XMLDebug.out(feed); - HttpClient client = new HttpClientImpl(url, locale); try { @@ -128,7 +129,11 @@ return (Artifact) new FLYSArtifactCreator().create(description); } else if (result != null && result.equals(OPERATION_FAILURE)) { - throw new ServerException(ERROR_FEED_DATA); + String msg = XMLUtils.xpathString( + description, + XPATH_RESULT_MSG, + ArtifactNamespaceContext.INSTANCE); + throw new ServerException(msg); } } catch (ConnectionException ce) {