# HG changeset patch # User Sascha L. Teichmann # Date 1308059605 0 # Node ID bcd62609c936aeb05a5db50f298cde925b311bb6 # Parent 9a035ef7b595bbbe206bd9bbb93c1a200d57e1df Write top 'Oberkante' and bottom 'Unterkante' to out going XML if they exist. flys-artifacts/trunk@2109 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 9a035ef7b595 -r bcd62609c936 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Tue Jun 14 10:38:00 2011 +0000 +++ b/flys-artifacts/ChangeLog Tue Jun 14 13:53:25 2011 +0000 @@ -1,3 +1,9 @@ +2011-06-14 Sascha L. Teichmann + + * src/main/java/de/intevation/flys/artifacts/services/DistanceInfoService.java: + Write top 'Oberkante' and bottom 'Unterkante' to out going XML + if they exist. + 2011-06-14 Ingo Weinzierl * src/main/java/de/intevation/flys/artifacts/states/LocationSelect.java: diff -r 9a035ef7b595 -r bcd62609c936 flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/DistanceInfoService.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/DistanceInfoService.java Tue Jun 14 10:38:00 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/DistanceInfoService.java Tue Jun 14 13:53:25 2011 +0000 @@ -21,6 +21,7 @@ import de.intevation.flys.model.Attribute; import de.intevation.flys.model.Position; import de.intevation.flys.model.Range; +import de.intevation.flys.model.Edge; import de.intevation.flys.artifacts.model.AnnotationsFactory; @@ -140,16 +141,32 @@ Position pos = anno.getPosition(); Range range = anno.getRange(); Attribute attr = anno.getAttribute(); + Edge edge = anno.getEdge(); BigDecimal a = range.getA(); BigDecimal b = range.getB(); Element distance = ec.create("distance"); ec.addAttr(distance, "description", pos.getValue(), true); - ec.addAttr(distance, "from", a != null ? a.toString() : "", true); - ec.addAttr(distance, "to", b != null ? b.toString() : "", true); ec.addAttr(distance, "riverside", attr.getValue(), true); + if (a != null) { + ec.addAttr(distance, "from", a.toString(), true); + } + if (b != null) { + ec.addAttr(distance, "to", b.toString(), true); + } + if (edge != null) { + BigDecimal bottom = edge.getBottom(); + BigDecimal top = edge.getTop(); + if (bottom != null) { + ec.addAttr(distance, "bottom", bottom.toString(), true); + } + if (top != null) { + ec.addAttr(distance, "top", top.toString(), true); + } + } + return distance; } }