diff artifacts-common/src/main/java/de/intevation/artifacts/common/utils/ClientProtocolUtils.java @ 293:a367a0d011af

Set an interface for the global context; added a method to the artifact database to return an instance of an Artifact. artifacts/trunk@2331 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 14 Jul 2011 14:22:23 +0000
parents f5a0f90bcc6f
children 0035e2511342
line wrap: on
line diff
--- a/artifacts-common/src/main/java/de/intevation/artifacts/common/utils/ClientProtocolUtils.java	Wed Jul 13 13:12:08 2011 +0000
+++ b/artifacts-common/src/main/java/de/intevation/artifacts/common/utils/ClientProtocolUtils.java	Thu Jul 14 14:22:23 2011 +0000
@@ -71,6 +71,16 @@
      * @return the CREATE document.
      */
     public static Document newCreateDocument(String factory) {
+        return newCreateDocument(factory, null);
+    }
+
+
+    /**
+     * This method creates a new CREATE document.
+     *
+     * @return the CREATE document.
+     */
+    public static Document newCreateDocument(String factory, String uuid) {
         Document doc = XMLUtils.newDocument();
 
         XMLUtils.ElementCreator cr = new XMLUtils.ElementCreator(
@@ -88,6 +98,14 @@
         action.appendChild(type);
         action.appendChild(fac);
 
+        if (uuid != null) {
+            Element templ = cr.create("template");
+            templ.setAttribute("uuid", uuid);
+            action.appendChild(templ);
+        }
+
+
+
         doc.appendChild(action);
 
         return doc;

http://dive4elements.wald.intevation.org