# HG changeset patch # User Tim Englich # Date 1276606771 0 # Node ID 41630b457b6a9d55425ebb266b152dfe8b367a3b # Parent c961cd9a13f74c7b9ea5fdf209d5240568267ed8 ISSUE297: Localized generated exceptionmessage gnv-artifacts/trunk@1218 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r c961cd9a13f7 -r 41630b457b6a gnv-artifacts/ChangeLog --- a/gnv-artifacts/ChangeLog Mon Jun 14 21:12:23 2010 +0000 +++ b/gnv-artifacts/ChangeLog Tue Jun 15 12:59:31 2010 +0000 @@ -1,3 +1,14 @@ +2010-06-15 Tim Englich + + ISSUE297 + + * src/main/resources/lang/artifactMessages*.properties: + Added localized exceptionmessage for MinMaxState. + + * src/main/java/de/intevation/gnv/state/MinMaxState.java (feed): + Localized exceptionmessage which will be displayed in the GUI of the GNV + Web-Client. + 2010-06-14 Ingo Weinzierl * pom.xml: Write svn revision to MANIFEST file while creating jar archive. diff -r c961cd9a13f7 -r 41630b457b6a gnv-artifacts/src/main/java/de/intevation/gnv/state/MinMaxState.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/MinMaxState.java Mon Jun 14 21:12:23 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/MinMaxState.java Tue Jun 15 12:59:31 2010 +0000 @@ -6,6 +6,7 @@ import java.util.GregorianCalendar; import java.util.Iterator; import java.util.List; +import java.util.Locale; import org.apache.log4j.Logger; import org.w3c.dom.Document; @@ -39,7 +40,13 @@ */ private static Logger log = Logger.getLogger(MinMaxState.class); - /** + /** + * Key to lookup the localized exceptionmessage in the ResourceFiles. + */ + public static final String EXCEPTION_INVALID_MIN_MAX_INPUT = + "input.is.not.valid.minmax"; + + /** * Constructor */ public MinMaxState() { @@ -123,8 +130,16 @@ } if (min != null && max != null) { - if (!InputValidator.isInputValid((String) min, (String) max, type)) { - String msg = "Input is not valid for this state."; + if (!InputValidator.isInputValid((String) min, + (String) max, + type)) { + Locale[] serverLocales = resFactory.getLocales(); + Locale locale = context.getMeta() + .getPreferredLocale( + serverLocales); + String msg = resFactory.getRessource(locale, + EXCEPTION_INVALID_MIN_MAX_INPUT, + EXCEPTION_INVALID_MIN_MAX_INPUT); log.error(msg); return feedFailure(msg); } diff -r c961cd9a13f7 -r 41630b457b6a gnv-artifacts/src/main/resources/lang/artifactMessages.properties --- a/gnv-artifacts/src/main/resources/lang/artifactMessages.properties Mon Jun 14 21:12:23 2010 +0000 +++ b/gnv-artifacts/src/main/resources/lang/artifactMessages.properties Tue Jun 15 12:59:31 2010 +0000 @@ -81,6 +81,7 @@ no.input.data= No Entry was chosen. Please select at least one entry. input.is.not.valid=Invalid input. Please try again. input.is.not.valid.date.required=Invalid input. A date is required. Please try again. +input.is.not.valid.minmax=Input is not valid for this state. start.date.after.end.date=Start date lies after end date. Please try again. date.out.of.range=Date is out of range. missing.data.field=Can't validate selected date. Missing date, lower or upper date bound. diff -r c961cd9a13f7 -r 41630b457b6a gnv-artifacts/src/main/resources/lang/artifactMessages_de.properties --- a/gnv-artifacts/src/main/resources/lang/artifactMessages_de.properties Mon Jun 14 21:12:23 2010 +0000 +++ b/gnv-artifacts/src/main/resources/lang/artifactMessages_de.properties Tue Jun 15 12:59:31 2010 +0000 @@ -81,6 +81,7 @@ no.input.data=Es wurde kein Eintrag ausgew\u00e4hlt. Bitte w\u00e4hlen sie mindestens einen Eintrag aus. input.is.not.valid=Ung\u00fcltige Eingabe. Bitte versuchen Sie es erneut. input.is.not.valid.date.required=Ung\u00fcltige Eingabe. Ein Datum wird ben\u00f6tigt. Bitte versuchen Sie es erneut. +input.is.not.valid.minmax=Die get\u00e4tigte Eingabe ist ung\u00fctig. start.date.after.end.date=Anfangsdatum liegt hinter dem Enddatum. Bitte versuchen Sie es erneut. date.out.of.range=Das gew\u00e4hlte Datum liegt au\u00dferhalb des gültigen Wertebereiches. missing.data.field=Validierung der Datumseingabe nicht m\u00f6glich. Datum, obere oder untere Grenze fehlt. diff -r c961cd9a13f7 -r 41630b457b6a gnv-artifacts/src/main/resources/lang/artifactMessages_de_DE.properties --- a/gnv-artifacts/src/main/resources/lang/artifactMessages_de_DE.properties Mon Jun 14 21:12:23 2010 +0000 +++ b/gnv-artifacts/src/main/resources/lang/artifactMessages_de_DE.properties Tue Jun 15 12:59:31 2010 +0000 @@ -81,6 +81,7 @@ no.input.data=Es wurde kein Eintrag ausgew\u00e4hlt. Bitte w\u00e4hlen sie mindestens einen Eintrag aus. input.is.not.valid=Ung\u00fcltige Eingabe. Bitte versuchen Sie es erneut. input.is.not.valid.date.required=Ung\u00fcltige Eingabe. Ein Datum wird ben\u00f6tigt. Bitte versuchen Sie es erneut. +input.is.not.valid.minmax=Die get\u00e4tigte Eingabe ist ung\u00fctig. start.date.after.end.date=Anfangsdatum liegt nach dem Enddatum. Bitte versuchen Sie es erneut. date.out.of.range=Das gew\u00e4hlte Datum liegt au\u00dferhalb des gültigen Wertebereiches. missing.data.field=Validierung der Datumseingabe nicht m\u00f6glich. Datum, obere oder untere Grenze fehlt. diff -r c961cd9a13f7 -r 41630b457b6a gnv-artifacts/src/main/resources/lang/artifactMessages_en.properties --- a/gnv-artifacts/src/main/resources/lang/artifactMessages_en.properties Mon Jun 14 21:12:23 2010 +0000 +++ b/gnv-artifacts/src/main/resources/lang/artifactMessages_en.properties Tue Jun 15 12:59:31 2010 +0000 @@ -82,6 +82,7 @@ no.input.data= No Entry was chosen. Please select at least one entry. input.is.not.valid=Invalid input. Please try again. input.is.not.valid.date.required=Invalid input. A date is required. Please try again. +input.is.not.valid.minmax=Input is not valid for this state. start.date.after.end.date=Start date lies after end date. Please try again. date.out.of.range=Date is out of range. missing.data.field=Can't validate selected date. Missing date, lower or upper date bound.