diff artifacts-common/src/main/java/de/intevation/artifacts/common/utils/ClientProtocolUtils.java @ 223:91333a41b234

Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection. artifacts/trunk@1616 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 30 Mar 2011 07:50:01 +0000
parents ecfc33a4ba3d
children ab196a861796
line wrap: on
line diff
--- a/artifacts-common/src/main/java/de/intevation/artifacts/common/utils/ClientProtocolUtils.java	Fri Mar 25 08:27:07 2011 +0000
+++ b/artifacts-common/src/main/java/de/intevation/artifacts/common/utils/ClientProtocolUtils.java	Wed Mar 30 07:50:01 2011 +0000
@@ -267,6 +267,34 @@
 
 
     /**
+     * This method creates a new Document that is used to trigger the DESCRIBE
+     * operation of a collection in the artifact server.
+     *
+     * @param uuid The identifier of the collection that should be described.
+     *
+     * @return the document to describe a collection.
+     */
+    public static Document newDescribeCollectionDocument(String uuid) {
+        Document doc = XMLUtils.newDocument();
+
+        XMLUtils.ElementCreator cr = new XMLUtils.ElementCreator(
+            doc,
+            ArtifactNamespaceContext.NAMESPACE_URI,
+            ArtifactNamespaceContext.NAMESPACE_PREFIX);
+
+        Element action    = cr.create("action");
+        Element type      = cr.create("type");
+        cr.addAttr(type, "name", "describe");
+
+        action.appendChild(type);
+
+        doc.appendChild(action);
+
+        return doc;
+    }
+
+
+    /**
      * Returns string value found by {@link XPATH_LABEL} relative to
      * <i>node</i>.
      *

http://dive4elements.wald.intevation.org