[PATCH 06 of 17] Added list of rivers a module supports
Wald Commits
scm-commit at wald.intevation.org
Thu Feb 27 16:47:52 CET 2014
# HG changeset patch
# User Raimund Renkert <rrenkert at intevation.de>
# Date 1393509338 -3600
# Node ID 4a85cc6add7fe3e1218c68b30892f299434a01c3
# Parent 9aa0bd26ce7ff8d5a7865aa4cb171c0749770237
Added list of rivers a module supports.
diff -r 9aa0bd26ce7f -r 4a85cc6add7f artifacts/src/main/java/org/dive4elements/river/artifacts/model/Module.java
--- 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:
diff -r 9aa0bd26ce7f -r 4a85cc6add7f artifacts/src/main/java/org/dive4elements/river/artifacts/services/ModuleService.java
--- 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);
}
More information about the Dive4elements-commits
mailing list