Mercurial > dive4elements > framework
diff artifacts-common/src/main/java/de/intevation/artifacts/common/utils/ClientProtocolUtils.java @ 211:435631e07da2
Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
artifacts/trunk@1543 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 23 Mar 2011 10:47:48 +0000 |
parents | 8ea4d0824d8f |
children | d7042094f7b7 |
line wrap: on
line diff
--- a/artifacts-common/src/main/java/de/intevation/artifacts/common/utils/ClientProtocolUtils.java Wed Mar 23 10:45:36 2011 +0000 +++ b/artifacts-common/src/main/java/de/intevation/artifacts/common/utils/ClientProtocolUtils.java Wed Mar 23 10:47:48 2011 +0000 @@ -38,6 +38,11 @@ public static final String XPATH_STATES = "/art:result/art:reachable-states"; + /** The XPath to the output modes in the DESCRIBE document.*/ + public static final String XPATH_OUTPUT_MODES = + "/art:result/art:outputmodes/art:output"; + + /** The XPath to the select node relative to the dynamic UI node in the * DESCRIBE document.*/ public static final String XPATH_DATA_SELECT = "art:select"; @@ -326,6 +331,23 @@ /** + * This method returns the output mode nodes of the DESCRIBE document. + * + * @param description The document returned by the artifact server's + * DESCRIBE operation. + * + * @return the node that contains the output modes. + */ + public static NodeList getOutputModes(Document description) { + return (NodeList) XMLUtils.xpath( + description, + XPATH_OUTPUT_MODES, + XPathConstants.NODESET, + ArtifactNamespaceContext.INSTANCE); + } + + + /** * Returns the node found by {@link XPATH_DATA_SELECT}. * * @param dynamicNode The dynamic UI node of the DESCRIBE document.