# HG changeset patch # User Ingo Weinzierl # Date 1327917940 0 # Node ID 831d317547eb829c1018777c6834096c8df586cb # Parent 203bd78def81a2c1eee054aba34334a13ab91bbd Added methods to extract the default value for a min and max item. artifacts/trunk@3820 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 203bd78def81 -r 831d317547eb ChangeLog --- a/ChangeLog Wed Jan 18 09:23:43 2012 +0000 +++ b/ChangeLog Mon Jan 30 10:05:40 2012 +0000 @@ -1,3 +1,8 @@ +2012-01-30 Ingo Weinzierl + + * artifacts-common/src/main/java/de/intevation/artifacts/common/utils/ClientProtocolUtils.java: + Added methods to extract the default value for a min and max item. + 2012-01-18 Ingo Weinzierl * artifacts-common/src/main/java/de/intevation/artifacts/common/utils/ClientProtocolUtils.java: diff -r 203bd78def81 -r 831d317547eb artifacts-common/src/main/java/de/intevation/artifacts/common/utils/ClientProtocolUtils.java --- a/artifacts-common/src/main/java/de/intevation/artifacts/common/utils/ClientProtocolUtils.java Wed Jan 18 09:23:43 2012 +0000 +++ b/artifacts-common/src/main/java/de/intevation/artifacts/common/utils/ClientProtocolUtils.java Mon Jan 30 10:05:40 2012 +0000 @@ -56,6 +56,12 @@ /** The XPath that points to the max value of a range.*/ public static final String XPATH_MAX_NODE = "art:max/@art:value"; + /** The XPath that points to the default min value of a range.*/ + public static final String XPATH_DEF_MIN = "art:min/@art:default"; + + /** The XPath that points to the default max value of a range.*/ + public static final String XPATH_DEF_MAX = "art:max/@art:default"; + /** The XPath to a label in the artifact's DESCRIBE document. */ public static final String XPATH_LABEL = "art:label/text()"; @@ -832,5 +838,23 @@ XPathConstants.STRING, ArtifactNamespaceContext.INSTANCE); } + + + public static String getDefMin(Node parent) { + return (String) XMLUtils.xpath( + parent, + XPATH_DEF_MIN, + XPathConstants.STRING, + ArtifactNamespaceContext.INSTANCE); + } + + + public static String getDefMax(Node parent) { + return (String) XMLUtils.xpath( + parent, + XPATH_DEF_MAX, + XPathConstants.STRING, + ArtifactNamespaceContext.INSTANCE); + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :