# HG changeset patch # User Ingo Weinzierl # Date 1301471401 0 # Node ID 91333a41b23442ddfc173a03e5007d5c59f2d91e # Parent 98695dc6d94dbd36f5edf7796d64d4c6c780f069 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 diff -r 98695dc6d94d -r 91333a41b234 ChangeLog --- a/ChangeLog Fri Mar 25 08:27:07 2011 +0000 +++ b/ChangeLog Wed Mar 30 07:50:01 2011 +0000 @@ -1,3 +1,10 @@ +2011-03-30 Ingo Weinzierl + + * artifacts-common/src/main/java/de/intevation/artifacts/common/utils/ClientProtocolUtils.java: + There is a new method that creates the document that is used to trigger + the DESCRIBE operation of a collection. + + 2011-03-25 Ingo Weinzierl * artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java: diff -r 98695dc6d94d -r 91333a41b234 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 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 * node. *