changeset 7755:4a85cc6add7f

Added list of rivers a module supports.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 27 Feb 2014 14:55:38 +0100 (2014-02-27)
parents 9aa0bd26ce7f
children cd04a7389389
files artifacts/src/main/java/org/dive4elements/river/artifacts/model/Module.java artifacts/src/main/java/org/dive4elements/river/artifacts/services/ModuleService.java
diffstat 2 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/Module.java	Thu Feb 27 14:51:35 2014 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/Module.java	Thu Feb 27 14:55:38 2014 +0100
@@ -8,16 +8,20 @@
 
 package org.dive4elements.river.artifacts.model;
 
+import java.util.List;
+
 /**
  * Represents a Module as is is loaded from the config
  */
 public class Module {
 
     private String name;
+    List<String> rivers;
     private boolean selected;
 
-    public Module(String name, boolean selected) {
+    public Module(String name, boolean selected, List<String> rivers) {
         this.name = name;
+        this.rivers = rivers;
         this.selected = selected;
     }
 
@@ -28,6 +32,10 @@
     public boolean isSelected() {
         return this.selected;
     }
+
+    public List<String> getRivers() {
+        return this.rivers;
+    }
 }
 
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 tw=80:
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/services/ModuleService.java	Thu Feb 27 14:51:35 2014 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/services/ModuleService.java	Thu Feb 27 14:55:38 2014 +0100
@@ -54,6 +54,11 @@
                     MODULE + "." + module.getName(), module.getName());
             ec.addAttr(m, "localname", localname, true);
 
+            for (String river : module.getRivers()) {
+                Element r = ec.create("river");
+                r.setAttribute("uuid", river);
+                m.appendChild(r);
+            }
             if (module.isSelected()) {
                 ec.addAttr(m, "selected", "true", true);
             }

http://dive4elements.wald.intevation.org