Mercurial > dive4elements > framework
changeset 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 | 98695dc6d94d |
children | da92e7f8040b 574b1781baa6 |
files | ChangeLog artifacts-common/src/main/java/de/intevation/artifacts/common/utils/ClientProtocolUtils.java |
diffstat | 2 files changed, 35 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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 <ingo@intevation.de> + + * 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 <ingo@intevation.de> * artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.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 * <i>node</i>. *