changeset 7761:350a7cf09fbc

Load modules with supported rivers and rivers with model_uuid.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 27 Feb 2014 16:38:45 +0100
parents 5811dfe22897
children 2a97d9c3413a
files gwt-client/src/main/java/org/dive4elements/river/client/server/ModuleServiceImpl.java gwt-client/src/main/java/org/dive4elements/river/client/server/RiverInfoServiceImpl.java gwt-client/src/main/java/org/dive4elements/river/client/server/RiverServiceImpl.java
diffstat 3 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/ModuleServiceImpl.java	Thu Feb 27 15:11:59 2014 +0100
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/ModuleServiceImpl.java	Thu Feb 27 16:38:45 2014 +0100
@@ -89,9 +89,15 @@
                         ArtifactNamespaceContext.NAMESPACE_URI, "selected");
                 boolean selected = strselected == null ? false :
                         strselected.equalsIgnoreCase("true");
+                NodeList rivers = em.getChildNodes();
+                List<String> riverUuids = new ArrayList<String>();
+                for (int j = 0; j < rivers.getLength(); j++) {
+                    Element re = (Element)rivers.item(j);
+                    riverUuids.add(re.getAttribute("uuid"));
+                }
                 logger.debug("Found module " + name + " " + localname);
                 if (user == null || user.canUseFeature("module:" + name)) {
-                    modules.add(new DefaultModule(name, localname, selected));
+                    modules.add(new DefaultModule(name, localname, selected, riverUuids));
                 }
             }
             return modules.toArray(new Module[modules.size()]);
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/RiverInfoServiceImpl.java	Thu Feb 27 15:11:59 2014 +0100
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/RiverInfoServiceImpl.java	Thu Feb 27 16:38:45 2014 +0100
@@ -368,6 +368,8 @@
                 ArtifactNamespaceContext.NAMESPACE_URI, "maxq");
         String rofficial = riverresp.getAttributeNS(
                 ArtifactNamespaceContext.NAMESPACE_URI, "official");
+        String rmuuid = riverresp.getAttributeNS(
+                ArtifactNamespaceContext.NAMESPACE_URI, "model-uuid");
 
         logger.debug("River is " + rname);
 
@@ -380,7 +382,8 @@
                 rwstunit,
                 parseDouble(rminq),
                 parseDouble(rmaxq),
-                parseLong(rofficial)
+                parseLong(rofficial),
+                rmuuid
                 );
 
         return riverinfo;
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/RiverServiceImpl.java	Thu Feb 27 15:11:59 2014 +0100
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/RiverServiceImpl.java	Thu Feb 27 16:38:45 2014 +0100
@@ -93,10 +93,12 @@
 
                 String name = tmp.getAttributeNS(
                     ArtifactNamespaceContext.NAMESPACE_URI, "name");
+                String mUuid = tmp.getAttributeNS(
+                    ArtifactNamespaceContext.NAMESPACE_URI, "modeluuid");
 
                 if (name.length() > 0
                 && (user == null || user.canUseFeature("river:" + name))) {
-                    theRivers.add(new DefaultRiver(name));
+                    theRivers.add(new DefaultRiver(name, mUuid));
                 }
             }
 

http://dive4elements.wald.intevation.org