comparison artifacts-common/src/main/java/de/intevation/artifacts/common/utils/ClientProtocolUtils.java @ 300:0035e2511342

CREATE documents for Artifact creation might contain db-ids now. artifacts/trunk@2388 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 21 Jul 2011 15:05:49 +0000
parents a367a0d011af
children ee6e1b2f137a
comparison
equal deleted inserted replaced
299:a8d62eb93cd4 300:0035e2511342
79 * This method creates a new CREATE document. 79 * This method creates a new CREATE document.
80 * 80 *
81 * @return the CREATE document. 81 * @return the CREATE document.
82 */ 82 */
83 public static Document newCreateDocument(String factory, String uuid) { 83 public static Document newCreateDocument(String factory, String uuid) {
84 return newCreateDocument(factory, uuid, null);
85 }
86
87
88 /**
89 * This method creates a new CREATE document.
90 *
91 * @return the CREATE document.
92 */
93 public static Document newCreateDocument(
94 String factory,
95 String uuid,
96 String ids)
97 {
84 Document doc = XMLUtils.newDocument(); 98 Document doc = XMLUtils.newDocument();
85 99
86 XMLUtils.ElementCreator cr = new XMLUtils.ElementCreator( 100 XMLUtils.ElementCreator cr = new XMLUtils.ElementCreator(
87 doc, 101 doc,
88 ArtifactNamespaceContext.NAMESPACE_URI, 102 ArtifactNamespaceContext.NAMESPACE_URI,
102 Element templ = cr.create("template"); 116 Element templ = cr.create("template");
103 templ.setAttribute("uuid", uuid); 117 templ.setAttribute("uuid", uuid);
104 action.appendChild(templ); 118 action.appendChild(templ);
105 } 119 }
106 120
107 121 if (ids != null) {
122 Element id = cr.create("db-ids");
123 id.setAttribute("value", ids);
124 action.appendChild(id);
125 }
108 126
109 doc.appendChild(action); 127 doc.appendChild(action);
110 128
111 return doc; 129 return doc;
112 } 130 }

http://dive4elements.wald.intevation.org