changeset 229:924da6695800

Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient. flys-client/trunk@1681 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 14 Apr 2011 07:53:01 +0000
parents bbe32496dc84
children 6de435235927
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/Config.java flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java flys-client/src/main/java/de/intevation/flys/client/client/services/AddArtifactService.java flys-client/src/main/java/de/intevation/flys/client/client/services/AddArtifactServiceAsync.java flys-client/src/main/java/de/intevation/flys/client/client/services/AdvanceService.java flys-client/src/main/java/de/intevation/flys/client/client/services/AdvanceServiceAsync.java flys-client/src/main/java/de/intevation/flys/client/client/services/ArtifactService.java flys-client/src/main/java/de/intevation/flys/client/client/services/ArtifactServiceAsync.java flys-client/src/main/java/de/intevation/flys/client/client/services/CreateCollectionService.java flys-client/src/main/java/de/intevation/flys/client/client/services/CreateCollectionServiceAsync.java flys-client/src/main/java/de/intevation/flys/client/client/services/DescribeCollectionService.java flys-client/src/main/java/de/intevation/flys/client/client/services/DescribeCollectionServiceAsync.java flys-client/src/main/java/de/intevation/flys/client/client/services/DistanceInfoService.java flys-client/src/main/java/de/intevation/flys/client/client/services/DistanceInfoServiceAsync.java flys-client/src/main/java/de/intevation/flys/client/client/services/GetArtifactService.java flys-client/src/main/java/de/intevation/flys/client/client/services/GetArtifactServiceAsync.java flys-client/src/main/java/de/intevation/flys/client/client/services/RiverService.java flys-client/src/main/java/de/intevation/flys/client/client/services/RiverServiceAsync.java flys-client/src/main/java/de/intevation/flys/client/client/services/StepForwardService.java flys-client/src/main/java/de/intevation/flys/client/client/services/StepForwardServiceAsync.java flys-client/src/main/java/de/intevation/flys/client/client/services/UserCollectionsService.java flys-client/src/main/java/de/intevation/flys/client/client/services/UserCollectionsServiceAsync.java flys-client/src/main/java/de/intevation/flys/client/client/services/UserService.java flys-client/src/main/java/de/intevation/flys/client/client/services/UserServiceAsync.java flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java flys-client/src/main/java/de/intevation/flys/client/server/AddArtifactServiceImpl.java flys-client/src/main/java/de/intevation/flys/client/server/AdvanceServiceImpl.java flys-client/src/main/java/de/intevation/flys/client/server/ArtifactServiceImpl.java flys-client/src/main/java/de/intevation/flys/client/server/CreateCollectionServiceImpl.java flys-client/src/main/java/de/intevation/flys/client/server/DescribeCollectionServiceImpl.java flys-client/src/main/java/de/intevation/flys/client/server/DistanceInfoServiceImpl.java flys-client/src/main/java/de/intevation/flys/client/server/GetArtifactServiceImpl.java flys-client/src/main/java/de/intevation/flys/client/server/RiverServiceImpl.java flys-client/src/main/java/de/intevation/flys/client/server/StepForwardServiceImpl.java flys-client/src/main/java/de/intevation/flys/client/server/UserCollectionsServiceImpl.java flys-client/src/main/java/de/intevation/flys/client/server/UserServiceImpl.java
diffstat 39 files changed, 237 insertions(+), 73 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/ChangeLog	Thu Apr 14 07:53:01 2011 +0000
@@ -1,3 +1,50 @@
+2011-04-14  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/Config.java:
+	  A new method returns the name of the current locale now.
+
+	* src/main/java/de/intevation/flys/client/server/DescribeCollectionServiceImpl.java,
+	  src/main/java/de/intevation/flys/client/server/ArtifactServiceImpl.java,
+	  src/main/java/de/intevation/flys/client/server/UserCollectionsServiceImpl.java,
+	  src/main/java/de/intevation/flys/client/server/GetArtifactServiceImpl.java,
+	  src/main/java/de/intevation/flys/client/server/UserServiceImpl.java,
+	  src/main/java/de/intevation/flys/client/server/CreateCollectionServiceImpl.java,
+	  src/main/java/de/intevation/flys/client/server/StepForwardServiceImpl.java,
+	  src/main/java/de/intevation/flys/client/server/AdvanceServiceImpl.java,
+	  src/main/java/de/intevation/flys/client/server/AddArtifactServiceImpl.java,
+	  src/main/java/de/intevation/flys/client/server/DistanceInfoServiceImpl.java,
+	  src/main/java/de/intevation/flys/client/server/RiverServiceImpl.java,
+	  src/main/java/de/intevation/flys/client/client/services/UserService.java,
+	  src/main/java/de/intevation/flys/client/client/services/CreateCollectionService.java,
+	  src/main/java/de/intevation/flys/client/client/services/RiverServiceAsync.java,
+	  src/main/java/de/intevation/flys/client/client/services/RiverService.java,
+	  src/main/java/de/intevation/flys/client/client/services/DescribeCollectionServiceAsync.java,
+	  src/main/java/de/intevation/flys/client/client/services/GetArtifactServiceAsync.java,
+	  src/main/java/de/intevation/flys/client/client/services/ArtifactServiceAsync.java,
+	  src/main/java/de/intevation/flys/client/client/services/DescribeCollectionService.java,
+	  src/main/java/de/intevation/flys/client/client/services/ArtifactService.java,
+	  src/main/java/de/intevation/flys/client/client/services/GetArtifactService.java,
+	  src/main/java/de/intevation/flys/client/client/services/StepForwardServiceAsync.java,
+	  src/main/java/de/intevation/flys/client/client/services/AdvanceServiceAsync.java,
+	  src/main/java/de/intevation/flys/client/client/services/StepForwardService.java,
+	  src/main/java/de/intevation/flys/client/client/services/AdvanceService.java,
+	  src/main/java/de/intevation/flys/client/client/services/AddArtifactServiceAsync.java,
+	  src/main/java/de/intevation/flys/client/client/services/DistanceInfoServiceAsync.java,
+	  src/main/java/de/intevation/flys/client/client/services/AddArtifactService.java,
+	  src/main/java/de/intevation/flys/client/client/services/DistanceInfoService.java,
+	  src/main/java/de/intevation/flys/client/client/services/UserCollectionsServiceAsync.java,
+	  src/main/java/de/intevation/flys/client/client/services/UserServiceAsync.java,
+	  src/main/java/de/intevation/flys/client/client/services/CreateCollectionServiceAsync.java,
+	  src/main/java/de/intevation/flys/client/client/services/UserCollectionsService.java:
+	  Introduced a "locale" parameter that stores the name of the current
+	  locale. This is used to set the locale of the request object manually.
+
+	* src/main/java/de/intevation/flys/client/client/FLYS.java,
+	  src/main/java/de/intevation/flys/client/client/ui/ProjectList.java,
+	  src/main/java/de/intevation/flys/client/client/ui/ParameterList.java,
+	  src/main/java/de/intevation/flys/client/client/ui/CollectionView.java:
+	  Modified the RPC service calls (introduction of a locale).
+
 2011-04-12  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/ui/CollectionView.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/Config.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/Config.java	Thu Apr 14 07:53:01 2011 +0000
@@ -1,5 +1,8 @@
 package de.intevation.flys.client.client;
 
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.i18n.client.LocaleInfo;
+
 import com.google.gwt.xml.client.Document;
 import com.google.gwt.xml.client.Node;
 
@@ -68,5 +71,15 @@
         Node server = config.getElementsByTagName("server").item(0);
         return server.getFirstChild().getNodeValue();
     }
+
+
+    /**
+     * Returns the name of the current locale.
+     *
+     * @return the name of the current locale.
+     */
+    public String getLocale() {
+        return LocaleInfo.getCurrentLocale().getLocaleName();
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java	Thu Apr 14 07:53:01 2011 +0000
@@ -114,11 +114,14 @@
         RootPanel.get("app").add(vertical);
 
         initConfiguration();
-        String serverUrl = Config.getInstance().getServerUrl();
+
+        Config config = Config.getInstance();
+        String url    = config.getServerUrl();
+        String locale = config.getLocale();
 
         getRivers();
 
-        userService.getCurrentUser(serverUrl, new AsyncCallback<User>() {
+        userService.getCurrentUser(url, locale, new AsyncCallback<User>() {
             public void onFailure(Throwable caught) {
                 GWT.log("Could not find a logged in user.");
                 SC.warn(MSG.getString(caught.getMessage()));
@@ -188,10 +191,13 @@
 
 
     protected void readRivers() {
-        String url = Config.getInstance().getServerUrl();
+        Config config = Config.getInstance();
+        String url    = config.getServerUrl();
+        String locale = config.getLocale();
+
         GWT.log("Fetch rivers from server '" + url + "'");
 
-        riverService.list(url, new AsyncCallback<River[]>() {
+        riverService.list(url, locale, new AsyncCallback<River[]>() {
             public void onFailure(Throwable caught) {
                 GWT.log("Could not recieve a list of rivers.");
                 SC.warn(MSG.getString(caught.getMessage()));
@@ -238,10 +244,11 @@
 
         GWT.log("Open existing project: " + collectionID);
 
-        Config config    = Config.getInstance();
-        final String url = config.getServerUrl();
+        Config config       = Config.getInstance();
+        final String url    = config.getServerUrl();
+        final String locale = config.getLocale();
 
-        describeCollectionService.describe(collectionID, url,
+        describeCollectionService.describe(collectionID, url, locale,
             new AsyncCallback<Collection>() {
                 public void onFailure(Throwable caught) {
                     SC.warn(MSG.getString(caught.getMessage()));
@@ -258,6 +265,7 @@
 
                     getArtifactService.getArtifact(
                         url,
+                        locale,
                         item.identifier(),
                         item.hash(),
                         new AsyncCallback<Artifact>() {
@@ -285,17 +293,20 @@
      * Create a new Artifact.
      */
     public void newArtifact(String factory) {
-        String url = Config.getInstance().getServerUrl();
+        Config config = Config.getInstance();
+        String url    = config.getServerUrl();
+        String locale = config.getLocale();
 
-        artifactService.create(url, factory, new AsyncCallback<Artifact>() {
-            public void onFailure(Throwable caught) {
-                GWT.log("Could not create the new artifact.");
-                GWT.log(caught.getMessage());
-            }
+        artifactService.create(url, locale, factory,
+            new AsyncCallback<Artifact>() {
+                public void onFailure(Throwable caught) {
+                    GWT.log("Could not create the new artifact.");
+                    SC.warn(MSG.getString(caught.getMessage()));
+                }
 
-            public void onSuccess(Artifact artifact) {
-                GWT.log("Successfully created a new artifact.");
-            }
+                public void onSuccess(Artifact artifact) {
+                    GWT.log("Successfully created a new artifact.");
+                }
         });
     }
 }
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/AddArtifactService.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/AddArtifactService.java	Thu Apr 14 07:53:01 2011 +0000
@@ -26,7 +26,11 @@
      *
      * @return the Collection after the operation.
      */
-    Collection add(Collection collection, Artifact artifact, String url)
+    Collection add(
+        Collection collection,
+        Artifact   artifact,
+        String     url,
+        String     locale)
     throws ServerException;
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/AddArtifactServiceAsync.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/AddArtifactServiceAsync.java	Thu Apr 14 07:53:01 2011 +0000
@@ -15,6 +15,7 @@
         Collection collection,
         Artifact   artifact,
         String     url,
+        String     locale,
         AsyncCallback<Collection> callback);
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/AdvanceService.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/AdvanceService.java	Thu Apr 14 07:53:01 2011 +0000
@@ -18,12 +18,17 @@
      * This method inserts new data into the an existing artifact.
      *
      * @param serverUrl The url of the artifact server.
+     * @param locale The locale used for the request.
      * @param artifact The artifact.
      * @param target The identifier of the target state.
      *
      * @return the artifact which description might have been changed.
      */
-    public Artifact advance(String serverUrl, Artifact artifact, String target)
+    public Artifact advance(
+        String   serverUrl,
+        String   locale,
+        Artifact artifact,
+        String   target)
     throws ServerException;
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/AdvanceServiceAsync.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/AdvanceServiceAsync.java	Thu Apr 14 07:53:01 2011 +0000
@@ -14,6 +14,7 @@
 
     public void advance(
         String                  serverUrl,
+        String                  locale,
         Artifact                artifact,
         String                  target,
         AsyncCallback<Artifact> callback);
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/ArtifactService.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/ArtifactService.java	Thu Apr 14 07:53:01 2011 +0000
@@ -19,11 +19,12 @@
      * This method creates a new artifact based on the given <i>factory</i>.
      *
      * @param serverUrl The url of the artifact server.
+     * @param locale The locale used for the request.
      * @param factory The factory that should be used for the artifact creation.
      *
      * @return the new artifact.
      */
-    public Artifact create(String serverUrl, String factory)
+    public Artifact create(String serverUrl, String locale, String factory)
     throws ServerException;
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/ArtifactServiceAsync.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/ArtifactServiceAsync.java	Thu Apr 14 07:53:01 2011 +0000
@@ -14,6 +14,9 @@
 public interface ArtifactServiceAsync {
 
     public void create(
-        String serverUrl, String factory, AsyncCallback<Artifact> callback);
+        String serverUrl,
+        String locale,
+        String factory,
+        AsyncCallback<Artifact> callback);
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/CreateCollectionService.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/CreateCollectionService.java	Thu Apr 14 07:53:01 2011 +0000
@@ -21,7 +21,7 @@
      *
      * @return the uuid of the created collection.
      */
-    Collection create(String serverUrl, String ownerId)
+    Collection create(String serverUrl, String locale, String ownerId)
     throws ServerException;
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/CreateCollectionServiceAsync.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/CreateCollectionServiceAsync.java	Thu Apr 14 07:53:01 2011 +0000
@@ -14,6 +14,7 @@
 
     void create(
         String serverUrl,
+        String locale,
         String owner,
         AsyncCallback<Collection> callback);
 }
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/DescribeCollectionService.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/DescribeCollectionService.java	Thu Apr 14 07:53:01 2011 +0000
@@ -21,10 +21,11 @@
      *
      * @param uuid The uuid of the desired collection.
      * @param url  The url of the artifact server.
+     * @param locale The name of the locale used for the request.
      *
      * @return the Collection after the operation.
      */
-    Collection describe(String uuid, String url)
+    Collection describe(String uuid, String url, String locale)
     throws ServerException;
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/DescribeCollectionServiceAsync.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/DescribeCollectionServiceAsync.java	Thu Apr 14 07:53:01 2011 +0000
@@ -13,6 +13,7 @@
     public void describe(
         String uuid,
         String url,
+        String locale,
         AsyncCallback<Collection> callback);
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/DistanceInfoService.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/DistanceInfoService.java	Thu Apr 14 07:53:01 2011 +0000
@@ -18,7 +18,10 @@
     /**
      * This method returns a list of DistanceInfoObjects for a specific river.
      */
-    DistanceInfoObject[] getDistanceInfo(String serverUrl, String river)
+    DistanceInfoObject[] getDistanceInfo(
+        String serverUrl,
+        String locale,
+        String river)
     throws ServerException;
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/DistanceInfoServiceAsync.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/DistanceInfoServiceAsync.java	Thu Apr 14 07:53:01 2011 +0000
@@ -12,6 +12,7 @@
 
     void getDistanceInfo(
         String url,
+        String locale,
         String river,
         AsyncCallback<DistanceInfoObject[]> cb);
 }
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/GetArtifactService.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/GetArtifactService.java	Thu Apr 14 07:53:01 2011 +0000
@@ -17,13 +17,15 @@
     /**
      * This method inserts new data into the an existing artifact.
      *
-     * @param serverUrl The url of the artifact server.
+     * @param url The url of the artifact server.
+     * @param locale The string representation of a locale that is used for the
+     * request.
      * @param uuid The artifact's identifier.
      * @param hash The artifact's hash.
      *
      * @return the artifact.
      */
-    Artifact getArtifact(String url, String uuid, String hash)
+    Artifact getArtifact(String url, String locale, String uuid, String hash)
     throws ServerException;
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/GetArtifactServiceAsync.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/GetArtifactServiceAsync.java	Thu Apr 14 07:53:01 2011 +0000
@@ -12,6 +12,7 @@
 
     public void getArtifact(
         String                  serverUrl,
+        String                  locale,
         String                  uuid,
         String                  hash,
         AsyncCallback<Artifact> callback);
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/RiverService.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/RiverService.java	Thu Apr 14 07:53:01 2011 +0000
@@ -19,10 +19,11 @@
      * This method returns a list of rivers provided by the artifact server.
      *
      * @param serverUrl The url of the artifact server.
+     * @param locale The locale used for the request.
      *
      * @return a list of rivers provided by the artifact server.
      */
-    public River[] list(String serverUrl)
+    public River[] list(String serverUrl, String locale)
     throws ServerException;
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/RiverServiceAsync.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/RiverServiceAsync.java	Thu Apr 14 07:53:01 2011 +0000
@@ -13,6 +13,9 @@
  */
 public interface RiverServiceAsync {
 
-    public void list(String serverUrl, AsyncCallback<River[]> callback);
+    public void list(
+        String serverUrl,
+        String locale,
+        AsyncCallback<River[]> callback);
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/StepForwardService.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/StepForwardService.java	Thu Apr 14 07:53:01 2011 +0000
@@ -19,12 +19,17 @@
      * This method inserts new data into the an existing artifact.
      *
      * @param serverUrl The url of the artifact server.
+     * @param locale The locale used for the request.
      * @param artifact The artifact.
      * @param data The data that should be inserted.
      *
      * @return the artifact which description might have been changed.
      */
-    public Artifact go(String serverUrl, Artifact artifact, Data[] data)
+    public Artifact go(
+        String   serverUrl,
+        String   locale,
+        Artifact artifact,
+        Data[]   data)
     throws ServerException;
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/StepForwardServiceAsync.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/StepForwardServiceAsync.java	Thu Apr 14 07:53:01 2011 +0000
@@ -15,6 +15,7 @@
 
     public void go(
         String                  serverUrl,
+        String                  locale,
         Artifact                artifact,
         Data[]                  data,
         AsyncCallback<Artifact> callback);
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/UserCollectionsService.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/UserCollectionsService.java	Thu Apr 14 07:53:01 2011 +0000
@@ -19,9 +19,14 @@
      * This method retrieves the user that is currently logged in.
      *
      * @param serverUrl The url of the artifact server.
+     * @param locale The locale used for the request object.
+     * @param userid The identifier of the owner.
      *
      * @return the current {@link User}.
      */
-    Collection[] getUserCollections(String serverUrl, String userid);
+    Collection[] getUserCollections(
+        String serverUrl,
+        String locale,
+        String userid);
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/UserCollectionsServiceAsync.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/UserCollectionsServiceAsync.java	Thu Apr 14 07:53:01 2011 +0000
@@ -15,6 +15,7 @@
 
     void getUserCollections(
         String serverUrl,
+        String locale,
         String userid,
         AsyncCallback<Collection[]> callback);
 }
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/UserService.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/UserService.java	Thu Apr 14 07:53:01 2011 +0000
@@ -22,7 +22,7 @@
      *
      * @return the current {@link User}.
      */
-    User getCurrentUser(String serverUrl)
+    User getCurrentUser(String serverUrl, String locale)
     throws AuthenticationException;
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/UserServiceAsync.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/UserServiceAsync.java	Thu Apr 14 07:53:01 2011 +0000
@@ -12,6 +12,9 @@
  */
 public interface UserServiceAsync {
 
-    void getCurrentUser(String serverUrl, AsyncCallback<User> callback);
+    void getCurrentUser(
+        String serverUrl,
+        String locale,
+        AsyncCallback<User> callback);
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Thu Apr 14 07:53:01 2011 +0000
@@ -161,11 +161,12 @@
     protected void createNewCollection(String ownerId) {
         GWT.log("CollectionView.createNewCollection");
 
-        Config config          = Config.getInstance();
-        final String serverUrl = config.getServerUrl();
+        Config config       = Config.getInstance();
+        final String url    = config.getServerUrl();
+        final String locale = config.getLocale();
 
         createCollectionService.create(
-            serverUrl, ownerId,
+            url, locale, ownerId,
             new AsyncCallback<Collection>() {
                 public void onFailure(Throwable caught) {
                     GWT.log("Could not create the new collection.");
@@ -176,7 +177,7 @@
                     GWT.log("Successfully created a new collection.");
 
                     Artifact artifact = getArtifact();
-                    addArtifactService.add(collection, artifact, serverUrl,
+                    addArtifactService.add(collection, artifact, url, locale,
                         new AsyncCallback<Collection>() {
 
                             public void onFailure(Throwable caught) {
@@ -274,17 +275,18 @@
         setArtifact(art);
         clearOutputTabs();
 
-        Collection collection = getCollection();
+        Collection c = getCollection();
 
-        if (outs != null && collection == null) {
+        if (outs != null && c == null) {
             User user = getFlys().getCurrentUser();
             createNewCollection(user.identifier());
         }
-        else if (outs != null && collection != null) {
+        else if (outs != null && c != null) {
             Config config = Config.getInstance();
             String url    = config.getServerUrl();
+            String locale = config.getLocale();
 
-            describeCollectionService.describe(collection.identifier(), url,
+            describeCollectionService.describe(c.identifier(), url, locale,
                 new AsyncCallback<Collection>() {
                     public void onFailure(Throwable caught) {
                         GWT.log("Could not DESCRIBE collection.");
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java	Thu Apr 14 07:53:01 2011 +0000
@@ -233,10 +233,14 @@
                 String newTitle = MSG.getString(module);
                 setTitle(newTitle);
 
-                final String serverUrl = Config.getInstance().getServerUrl();
+                Config config       = Config.getInstance();
+                final String url    = config.getServerUrl();
+                final String locale = config.getLocale();
+
                 final Data[] feedData  = new Data[] { data[1] };
+
                 artifactService.create(
-                    serverUrl, module.toLowerCase(),
+                    url, locale, module.toLowerCase(),
                     new AsyncCallback<Artifact>() {
                         public void onFailure(Throwable caught) {
                             GWT.log("Could not create the new artifact.");
@@ -246,7 +250,7 @@
                         public void onSuccess(Artifact artifact) {
                             GWT.log("Successfully created a new artifact.");
 
-                            forwardService.go(serverUrl, artifact, feedData,
+                            forwardService.go(url, locale, artifact, feedData,
                             new AsyncCallback<Artifact>() {
                                 public void onFailure(Throwable caught) {
                                     GWT.log("Could not feed the artifact.");
@@ -372,9 +376,12 @@
      */
     public void onStepForward(StepForwardEvent event) {
         GWT.log("CollectionView - onStepForward()");
-        String serverUrl = Config.getInstance().getServerUrl();
 
-        forwardService.go(serverUrl, artifact, event.getData(),
+        Config config    = Config.getInstance();
+        String serverUrl = config.getServerUrl();
+        String locale    = config.getLocale();
+
+        forwardService.go(serverUrl, locale, artifact, event.getData(),
             new AsyncCallback<Artifact>() {
                 public void onFailure(Throwable caught) {
                     GWT.log("Could not feed the artifact.");
@@ -397,9 +404,12 @@
      */
     public void onStepBack(StepBackEvent e) {
         final String target    = e.getTarget();
-        final String serverUrl = Config.getInstance().getServerUrl();
 
-        advanceService.advance(serverUrl, artifact, target,
+        Config config          = Config.getInstance();
+        final String serverUrl = config.getServerUrl();
+        final String locale    = config.getLocale();
+
+        advanceService.advance(serverUrl, locale, artifact, target,
             new AsyncCallback<Artifact>() {
                 public void onFailure(Throwable caught) {
                     GWT.log("Could not go back to '" + target + "'");
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java	Thu Apr 14 07:53:01 2011 +0000
@@ -192,8 +192,9 @@
     protected void updateUserCollections() {
         Config config = Config.getInstance();
         String url    = config.getServerUrl();
+        String locale = config.getLocale();
 
-        userCollectionsService.getUserCollections(url, user.identifier(),
+        userCollectionsService.getUserCollections(url, locale, user.identifier(),
             new AsyncCallback<Collection[]>() {
                 public void onFailure(Throwable caught) {
                     GWT.log("Could not recieve a list of user collections.");
--- a/flys-client/src/main/java/de/intevation/flys/client/server/AddArtifactServiceImpl.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/AddArtifactServiceImpl.java	Thu Apr 14 07:53:01 2011 +0000
@@ -24,7 +24,11 @@
 {
     public static final String ERROR_ADD_ARTIFACT = "error_add_artifact";
 
-    public Collection add(Collection collection, Artifact artifact, String url)
+    public Collection add(
+        Collection collection,
+        Artifact   artifact,
+        String     url,
+        String     locale)
     throws ServerException
     {
         System.out.println("AddArtifactServiceImpl.add");
@@ -32,7 +36,7 @@
         Document add = ClientProtocolUtils.newAddArtifactDocument(
             artifact.getUuid(), null);
 
-        HttpClient client = new HttpClientImpl(url);
+        HttpClient client = new HttpClientImpl(url, locale);
 
         try {
             Document response = (Document) client.doCollectionAction(
--- a/flys-client/src/main/java/de/intevation/flys/client/server/AdvanceServiceImpl.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/AdvanceServiceImpl.java	Thu Apr 14 07:53:01 2011 +0000
@@ -34,15 +34,21 @@
     public static final String ERROR_ADVANCE_ARTIFACT = "error_advance_artifact";
 
 
-    public Artifact advance(String serverUrl, Artifact artifact, String target)
+    public Artifact advance(
+        String   serverUrl,
+        String   locale,
+        Artifact artifact,
+        String   target)
     throws ServerException
     {
+        System.out.println("AdvanceServiceImpl.advance");
+
         Document advance = ClientProtocolUtils.newAdvanceDocument(
             artifact.getUuid(),
             artifact.getHash(),
             target);
 
-        HttpClient client = new HttpClientImpl(serverUrl);
+        HttpClient client = new HttpClientImpl(serverUrl, locale);
 
         try {
             Document description = (Document) client.advance(
--- a/flys-client/src/main/java/de/intevation/flys/client/server/ArtifactServiceImpl.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/ArtifactServiceImpl.java	Thu Apr 14 07:53:01 2011 +0000
@@ -30,11 +30,13 @@
     public static final String ERROR_CREATE_ARTIFACT = "error_create_artifact";
 
 
-    public Artifact create(String serverUrl, String factory)
+    public Artifact create(String serverUrl, String locale, String factory)
     throws ServerException
     {
+        System.out.println("ArtifactServiceImpl.create");
+
         Document create   = ClientProtocolUtils.newCreateDocument(factory);
-        HttpClient client = new HttpClientImpl(serverUrl);
+        HttpClient client = new HttpClientImpl(serverUrl, locale);
 
         try {
             return (Artifact) client.create(create, new FLYSArtifactCreator());
--- a/flys-client/src/main/java/de/intevation/flys/client/server/CreateCollectionServiceImpl.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/CreateCollectionServiceImpl.java	Thu Apr 14 07:53:01 2011 +0000
@@ -39,14 +39,14 @@
         "error_create_collection";
 
 
-    public Collection create(String serverUrl, String ownerId)
+    public Collection create(String serverUrl, String locale, String ownerId)
     throws ServerException
     {
         System.out.println("Start creating a new collection.");
 
         Document create   =
             ClientProtocolUtils.newCreateCollectionDocument(null);
-        HttpClient client = new HttpClientImpl(serverUrl);
+        HttpClient client = new HttpClientImpl(serverUrl, locale);
 
         try {
             Document doc = (Document) client.createCollection(
--- a/flys-client/src/main/java/de/intevation/flys/client/server/DescribeCollectionServiceImpl.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/DescribeCollectionServiceImpl.java	Thu Apr 14 07:53:01 2011 +0000
@@ -47,7 +47,7 @@
         "error_describe_collection";
 
 
-    public Collection describe(String uuid, String serverUrl)
+    public Collection describe(String uuid, String serverUrl, String locale)
     throws ServerException
     {
         System.out.println("DescribeCollectionServiceImpl.describe");
@@ -55,7 +55,7 @@
         Document describe = ClientProtocolUtils.newDescribeCollectionDocument(
             uuid);
 
-        HttpClient client = new HttpClientImpl(serverUrl);
+        HttpClient client = new HttpClientImpl(serverUrl, locale);
 
         try {
             Document response = (Document) client.doCollectionAction(
--- a/flys-client/src/main/java/de/intevation/flys/client/server/DistanceInfoServiceImpl.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/DistanceInfoServiceImpl.java	Thu Apr 14 07:53:01 2011 +0000
@@ -38,7 +38,10 @@
     public static final String XPATH_DISTANCES = "art:distances/art:distance";
 
 
-    public DistanceInfoObject[] getDistanceInfo(String url, String river)
+    public DistanceInfoObject[] getDistanceInfo(
+        String url,
+        String locale,
+        String river)
     throws ServerException
     {
         System.out.println("DistanceInfoServiceImpl.getDistanceInfo");
@@ -56,7 +59,7 @@
 
         doc.appendChild(riverEl);
 
-        HttpClient client = new HttpClientImpl(url);
+        HttpClient client = new HttpClientImpl(url, locale);
 
         try {
             Document result = client.callService(url, "distanceinfo", doc);
--- a/flys-client/src/main/java/de/intevation/flys/client/server/GetArtifactServiceImpl.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/GetArtifactServiceImpl.java	Thu Apr 14 07:53:01 2011 +0000
@@ -36,13 +36,19 @@
     public static final String OPERATION_FAILURE = "FAILED";
 
 
-    public Artifact getArtifact(String serverUrl, String uuid, String hash)
+    public Artifact getArtifact(
+        String url,
+        String locale,
+        String uuid,
+        String hash)
     throws ServerException
     {
+        System.out.println("GetArtifactServiceImpl.getArtifact");
+
         Document describe = ClientProtocolUtils.newDescribeDocument(
             uuid, hash, true);
 
-        HttpClient client = new HttpClientImpl(serverUrl);
+        HttpClient client = new HttpClientImpl(url, locale);
 
         try {
             Document description = (Document) client.describe(
--- a/flys-client/src/main/java/de/intevation/flys/client/server/RiverServiceImpl.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/RiverServiceImpl.java	Thu Apr 14 07:53:01 2011 +0000
@@ -42,7 +42,7 @@
     public static final String ERROR_NO_RIVERS_FOUND = "error_no_rivers_found";
 
 
-    public River[] list(String serverUrl)
+    public River[] list(String serverUrl, String locale)
     throws ServerException
     {
         Document doc      = XMLUtils.newDocument();
@@ -54,7 +54,7 @@
 
         doc.appendChild(ec.create("action"));
 
-        HttpClient client = new HttpClientImpl(serverUrl);
+        HttpClient client = new HttpClientImpl(serverUrl, locale);
 
         try {
             Document res = client.callService(serverUrl, "rivers", doc);
--- a/flys-client/src/main/java/de/intevation/flys/client/server/StepForwardServiceImpl.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/StepForwardServiceImpl.java	Thu Apr 14 07:53:01 2011 +0000
@@ -44,16 +44,19 @@
      * This method wraps the artifact operations FEED and ADVANCE. FEED is
      * always triggerd, ADVANCE only, if there is at least one reachable state.
      *
-     * @param serverUrl The url of the artifact server.
+     * @param url The url of the artifact server.
+     * @param locale The locale used for the request.
      * @param artifact The artifact that needs to be fed.
      * @param data An array of Data objects that contain the information that
      *
      * @return the modified artifact.
      */
-    public Artifact go(String serverUrl, Artifact artifact, Data[] data)
+    public Artifact go(String url, String locale, Artifact artifact, Data[] data)
     throws ServerException
     {
-        Artifact afterFeed = feed(serverUrl, artifact, data);
+        System.out.println("StepForwardServiceImpl.go");
+
+        Artifact afterFeed = feed(url, locale, artifact, data);
 
         if (afterFeed == null) {
             System.err.println("StepForwardService.feed() - FAILED");
@@ -70,29 +73,37 @@
 
         // We use the first reachable state as default target, maybe we need to
         // change this later.
-        return advance(serverUrl, afterFeed, reachable[0]);
+        return advance(url, locale, afterFeed, reachable[0]);
     }
 
 
     /**
      * This method triggers the FEED operation.
      *
-     * @param serverUrl The url of the artifact server.
+     * @param url The url of the artifact server.
      * @param artifact The artifact that needs to be fed.
      * @param data An array of Data objects that contain the information that
      * are used for the FEED operation.
      *
      * @return a new artifact parsed from the description of FEED.
      */
-    protected Artifact feed(String serverUrl, Artifact artifact, Data[] data)
+    protected Artifact feed(
+        String   url,
+        String   locale,
+        Artifact artifact,
+        Data[]   data)
     throws    ServerException
     {
+        System.out.println("StepForwardServiceImpl.feed");
+
         Document feed = ClientProtocolUtils.newFeedDocument(
             artifact.getUuid(),
             artifact.getHash(),
             createKVP(data));
 
-        HttpClient client = new HttpClientImpl(serverUrl);
+        XMLDebug.out(feed);
+
+        HttpClient client = new HttpClientImpl(url, locale);
 
         try {
             Document description = (Document) client.feed(
--- a/flys-client/src/main/java/de/intevation/flys/client/server/UserCollectionsServiceImpl.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/UserCollectionsServiceImpl.java	Thu Apr 14 07:53:01 2011 +0000
@@ -36,10 +36,14 @@
 extends      RemoteServiceServlet
 implements   UserCollectionsService
 {
-    public Collection[] getUserCollections(String serverUrl, String userid) {
+    public Collection[] getUserCollections(
+        String serverUrl,
+        String locale,
+        String userid)
+    {
         System.out.println("UserCollectionsServiceImpl.getUserCollections");
 
-        HttpClient client = new HttpClientImpl(serverUrl);
+        HttpClient client = new HttpClientImpl(serverUrl, locale);
 
         try {
             Document result = client.listUserCollections(userid);
--- a/flys-client/src/main/java/de/intevation/flys/client/server/UserServiceImpl.java	Tue Apr 12 13:48:11 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/UserServiceImpl.java	Thu Apr 14 07:53:01 2011 +0000
@@ -30,7 +30,7 @@
 {
     public static final String ERROR_NO_SUCH_USER = "error_no_such_user";
 
-    public User getCurrentUser(String serverUrl)
+    public User getCurrentUser(String serverUrl, String locale)
     throws AuthenticationException
     {
         HttpClient client = new HttpClientImpl(serverUrl);

http://dive4elements.wald.intevation.org