Mercurial > dive4elements > framework
comparison artifacts-common/src/main/java/de/intevation/artifacts/common/utils/ClientProtocolUtils.java @ 239:ab196a861796
Enhanced the ClientProtocolUtils with a method that creates an XML document used for the Collection's out() operation.
artifacts/trunk@1653 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 07 Apr 2011 11:25:00 +0000 |
parents | 91333a41b234 |
children | c0bc172ec7b2 |
comparison
equal
deleted
inserted
replaced
238:61b7041204a7 | 239:ab196a861796 |
---|---|
292 | 292 |
293 return doc; | 293 return doc; |
294 } | 294 } |
295 | 295 |
296 | 296 |
297 | |
298 /** | |
299 * This function builds a document that is used as request document of the | |
300 * out() operation of Collections. | |
301 * | |
302 * @param uuid The identifier of the collection. | |
303 * @param type The name of the desired output type. | |
304 * | |
305 * @return the request document. | |
306 */ | |
307 public static Document newOutCollectionDocument(String uuid, String type) { | |
308 Document doc = XMLUtils.newDocument(); | |
309 | |
310 XMLUtils.ElementCreator cr = new XMLUtils.ElementCreator( | |
311 doc, | |
312 ArtifactNamespaceContext.NAMESPACE_URI, | |
313 ArtifactNamespaceContext.NAMESPACE_PREFIX); | |
314 | |
315 Element action = cr.create("action"); | |
316 | |
317 cr.addAttr(action, "name", type, true); | |
318 cr.addAttr(action, "type", type, true); | |
319 | |
320 doc.appendChild(action); | |
321 | |
322 return doc; | |
323 } | |
324 | |
325 | |
297 /** | 326 /** |
298 * Returns string value found by {@link XPATH_LABEL} relative to | 327 * Returns string value found by {@link XPATH_LABEL} relative to |
299 * <i>node</i>. | 328 * <i>node</i>. |
300 * | 329 * |
301 * @param node A node. | 330 * @param node A node. |