changeset 37:b6b89ff1adee

Read i18n strings from DESCRIBE document and display those values in the UI. flys-client/trunk@1469 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 14 Mar 2011 16:35:32 +0000
parents 3cacc9d2dd01
children 7142386e86c2
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java flys-client/src/main/java/de/intevation/flys/client/client/ui/SelectProvider.java flys-client/src/main/java/de/intevation/flys/client/server/ArtifactDescriptionFactory.java
diffstat 4 files changed, 16 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Thu Mar 10 13:49:48 2011 +0000
+++ b/flys-client/ChangeLog	Mon Mar 14 16:35:32 2011 +0000
@@ -1,3 +1,10 @@
+2011-03-14  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/server/ArtifactDescriptionFactory.java,
+	  src/main/java/de/intevation/flys/client/client/ui/CollectionView.java,
+	  src/main/java/de/intevation/flys/client/client/ui/SelectProvider.java:
+	  Read i18n strings from DESCRIBE document and display them in the UI.
+
 2011-03-10  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/ui/CollectionView.java	Thu Mar 10 13:49:48 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Mon Mar 14 16:35:32 2011 +0000
@@ -257,7 +257,11 @@
         }
 
         Data data = new DefaultData(
-            "RIVER", "RIVER SELECTION", null, items, null);
+            messages.river_selection(),
+            messages.river_selection(),
+            null,
+            items,
+            null);
 
         ModuleSelection widget         = new ModuleSelection();
         HasStepForwardHandlers handler = (HasStepForwardHandlers) widget;
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/SelectProvider.java	Thu Mar 10 13:49:48 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/SelectProvider.java	Mon Mar 14 16:35:32 2011 +0000
@@ -114,14 +114,13 @@
         GWT.log("SelectProvider - create()");
 
         HLayout layout   = new HLayout();
-        Label label      = new Label(messages.river_selection());
+        Label label      = new Label(data.getLabel());
         DynamicForm form = new DynamicForm();
         combobox         = new ComboBoxItem(data.getLabel());
 
         LinkedHashMap<String, String> it = new LinkedHashMap<String, String>();
 
         for (DataItem item: data.getItems()) {
-            GWT.log("Add item: " + item.getLabel());
             it.put(item.getStringValue(), item.getLabel());
         }
 
--- a/flys-client/src/main/java/de/intevation/flys/client/server/ArtifactDescriptionFactory.java	Thu Mar 10 13:49:48 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/ArtifactDescriptionFactory.java	Mon Mar 14 16:35:32 2011 +0000
@@ -88,11 +88,13 @@
         Node     data    = ClientProtocolUtils.getSelectNode(dynamicNode);
         NodeList choices = ClientProtocolUtils.getItemNodes(data);
         String   label   = ClientProtocolUtils.getLabel(data);
+        String   name    = XMLUtils.xpathString(
+            data, "@art:name", ArtifactNamespaceContext.INSTANCE);
 
         DataItem[] dataItems = extractCurrentDataItems(choices);
         String uiProvider    = extractUIProvider(data);
 
-        return new DefaultData(label, null, null, dataItems, uiProvider);
+        return new DefaultData(name, label, null, dataItems, uiProvider);
     }
 
 

http://dive4elements.wald.intevation.org