Mercurial > dive4elements > framework
comparison artifacts-common/src/main/java/de/intevation/artifacts/common/utils/ClientProtocolUtils.java @ 370:203bd78def81
Improved ClientProtocolUtils to extract min and max values for items with two new functions.
artifacts/trunk@3701 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 18 Jan 2012 09:23:43 +0000 |
parents | 6431b7efe240 |
children | 831d317547eb |
comparison
equal
deleted
inserted
replaced
369:c489256a188b | 370:203bd78def81 |
---|---|
48 | 48 |
49 /** The XPath to the choices nodes relative to the select node in the | 49 /** The XPath to the choices nodes relative to the select node in the |
50 * DESCRIBE document. */ | 50 * DESCRIBE document. */ |
51 public static final String XPATH_DATA_ITEMS = "art:choices/art:item"; | 51 public static final String XPATH_DATA_ITEMS = "art:choices/art:item"; |
52 | 52 |
53 /** The XPath that points to the min value of a range.*/ | |
54 public static final String XPATH_MIN_NODE = "art:min/@art:value"; | |
55 | |
56 /** The XPath that points to the max value of a range.*/ | |
57 public static final String XPATH_MAX_NODE = "art:max/@art:value"; | |
58 | |
53 /** The XPath to a label in the artifact's DESCRIBE document. */ | 59 /** The XPath to a label in the artifact's DESCRIBE document. */ |
54 public static final String XPATH_LABEL = "art:label/text()"; | 60 public static final String XPATH_LABEL = "art:label/text()"; |
55 | 61 |
56 /** The XPath to a value in the artifact's DESCRIBE document. */ | 62 /** The XPath to a value in the artifact's DESCRIBE document. */ |
57 public static final String XPATH_VALUE = "art:value/text()"; | 63 public static final String XPATH_VALUE = "art:value/text()"; |
806 node, | 812 node, |
807 XPATH_DATA_ITEMS, | 813 XPATH_DATA_ITEMS, |
808 XPathConstants.NODESET, | 814 XPathConstants.NODESET, |
809 ArtifactNamespaceContext.INSTANCE); | 815 ArtifactNamespaceContext.INSTANCE); |
810 } | 816 } |
817 | |
818 | |
819 public static String getMinNode(Node parent) { | |
820 return (String) XMLUtils.xpath( | |
821 parent, | |
822 XPATH_MIN_NODE, | |
823 XPathConstants.STRING, | |
824 ArtifactNamespaceContext.INSTANCE); | |
825 } | |
826 | |
827 | |
828 public static String getMaxNode(Node parent) { | |
829 return (String) XMLUtils.xpath( | |
830 parent, | |
831 XPATH_MAX_NODE, | |
832 XPathConstants.STRING, | |
833 ArtifactNamespaceContext.INSTANCE); | |
834 } | |
811 } | 835 } |
812 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 836 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |