changeset 371:831d317547eb

Added methods to extract the default value for a min and max item. artifacts/trunk@3820 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 30 Jan 2012 10:05:40 +0000
parents 203bd78def81
children 72e4f03bf4a0
files ChangeLog artifacts-common/src/main/java/de/intevation/artifacts/common/utils/ClientProtocolUtils.java
diffstat 2 files changed, 29 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 <ingo@intevation.de>
+
+	* 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 <ingo@intevation.de>
 
 	* 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 :

http://dive4elements.wald.intevation.org