[Dive4elements-commits] [PATCH 2 of 2] Add newCreateDocument call that accepts targetOut parameter

Wald Commits scm-commit at wald.intevation.org
Fri May 31 15:18:05 CEST 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1370005208 -7200
# Node ID 665613c35cabc8da6dffe5ed6846834f624ba7a8
# Parent  83ee2c6a53b6c7a13ff98565b7289ffaf05389ce
Add newCreateDocument call that accepts targetOut parameter

diff -r 83ee2c6a53b6 -r 665613c35cab artifacts-common/src/main/java/org/dive4elements/artifacts/common/utils/ClientProtocolUtils.java
--- a/artifacts-common/src/main/java/org/dive4elements/artifacts/common/utils/ClientProtocolUtils.java	Fri May 31 14:59:39 2013 +0200
+++ b/artifacts-common/src/main/java/org/dive4elements/artifacts/common/utils/ClientProtocolUtils.java	Fri May 31 15:00:08 2013 +0200
@@ -114,6 +114,16 @@
         String         ids,
         CreationFilter filter
     ) {
+        return newCreateDocument(factory, uuid, ids, filter, null);
+    }
+
+    public static Document newCreateDocument(
+        String         factory,
+        String         uuid,
+        String         ids,
+        CreationFilter filter,
+        String         targetOut
+    ) {
         Document doc = XMLUtils.newDocument();
 
         XMLUtils.ElementCreator cr = new XMLUtils.ElementCreator(
@@ -147,6 +157,12 @@
             action.appendChild(filter.toXML(cr));
         }
 
+        if (targetOut != null) {
+            Element to = cr.create("target_out");
+            to.setAttribute("value", targetOut);
+            action.appendChild(to);
+        }
+
         doc.appendChild(action);
 
         return doc;


More information about the Dive4elements-commits mailing list