# HG changeset patch # User Sascha L. Teichmann # Date 1308061185 0 # Node ID d9fc58e30a5309a3cd7252159ec64834459865ae # Parent 3ce558193526d751bdde31b0a5de2df369895923 Loop through 'Unterkante' 'Oberkante' from service. flys-client/trunk@2114 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 3ce558193526 -r d9fc58e30a53 flys-client/ChangeLog --- a/flys-client/ChangeLog Tue Jun 14 14:01:08 2011 +0000 +++ b/flys-client/ChangeLog Tue Jun 14 14:19:45 2011 +0000 @@ -1,3 +1,10 @@ +2011-06-14 Sascha L. Teichmann + + * src/main/java/de/intevation/flys/client/server/DistanceInfoServiceImpl.java, + src/main/java/de/intevation/flys/client/shared/model/DistanceInfoObjectImpl.java, + src/main/java/de/intevation/flys/client/shared/model/DistanceInfoObject.java: + Loop through 'Unterkante' 'Oberkante' from service. + 2011-06-14 Ingo Weinzierl * src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties: diff -r 3ce558193526 -r d9fc58e30a53 flys-client/src/main/java/de/intevation/flys/client/server/DistanceInfoServiceImpl.java --- a/flys-client/src/main/java/de/intevation/flys/client/server/DistanceInfoServiceImpl.java Tue Jun 14 14:01:08 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/server/DistanceInfoServiceImpl.java Tue Jun 14 14:19:45 2011 +0000 @@ -131,6 +131,9 @@ * @return a valid DistanceInfoObject. */ protected DistanceInfoObject buildDistanceInfoObject(Node node) { + + // XXX: Using XPath here is much too expensive. DOM will do! + String desc = XMLUtils.xpathString( node, "@art:description", ArtifactNamespaceContext.INSTANCE); @@ -143,13 +146,29 @@ String riverside = XMLUtils.xpathString( node, "@art:riverside", ArtifactNamespaceContext.INSTANCE); + String bottom = XMLUtils.xpathString( + node, "@art:bottom", ArtifactNamespaceContext.INSTANCE); + + String top = XMLUtils.xpathString( + node, "@art:top", ArtifactNamespaceContext.INSTANCE); + if (desc != null && from != null) { try { - return new DistanceInfoObjectImpl( - desc, - new Double(from), - to != null && to.trim().length() > 0 ? new Double(to) : null, - riverside); + Double f = new Double(from); + + Double t = to != null && (to=to.trim()).length() > 0 + ? new Double(to) + : null; + + Double tp = top != null && (top=top.trim()).length() > 0 + ? new Double(top) + : null; + + Double b = bottom != null && (bottom=bottom.trim()).length() > 0 + ? new Double(bottom) + : null; + + return new DistanceInfoObjectImpl(desc, f, t, riverside, b, tp); } catch (NumberFormatException nfe) { System.err.println(nfe.getLocalizedMessage()); diff -r 3ce558193526 -r d9fc58e30a53 flys-client/src/main/java/de/intevation/flys/client/shared/model/DistanceInfoObject.java --- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/DistanceInfoObject.java Tue Jun 14 14:01:08 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/DistanceInfoObject.java Tue Jun 14 14:19:45 2011 +0000 @@ -15,5 +15,9 @@ Double getTo(); String getRiverside(); + + Double getBottom(); + + Double getTop(); } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r 3ce558193526 -r d9fc58e30a53 flys-client/src/main/java/de/intevation/flys/client/shared/model/DistanceInfoObjectImpl.java --- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/DistanceInfoObjectImpl.java Tue Jun 14 14:01:08 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/DistanceInfoObjectImpl.java Tue Jun 14 14:19:45 2011 +0000 @@ -14,6 +14,10 @@ protected String riverside; + protected Double bottom; + + protected Double top; + public DistanceInfoObjectImpl() { } @@ -23,15 +27,18 @@ String description, Double from, Double to, - String riverside) - { + String riverside, + Double bottom, + Double top + ) { this.description = description; this.from = from; this.to = to; this.riverside = riverside; + this.bottom = bottom; + this.top = top; } - public String getDescription() { return description; } @@ -50,5 +57,13 @@ public String getRiverside() { return riverside; } + + public Double getBottom() { + return bottom; + } + + public Double getTop() { + return top; + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :