annotate 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
rev   line source
113
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 /*
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2 * Copyright (c) 2011 by Intevation GmbH
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
3 *
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
4 * This program is free software under the LGPL (>=v2.1)
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
5 * Read the file LGPL.txt coming with the software for details
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6 * or visit http://www.gnu.org/licenses/ if it does not exist.
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7 */
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
8 package de.intevation.artifacts.common.utils;
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
9
114
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
10 import javax.xml.xpath.XPathConstants;
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
11
113
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12 import org.w3c.dom.Document;
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 import org.w3c.dom.Element;
114
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
14 import org.w3c.dom.Node;
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
15 import org.w3c.dom.NodeList;
113
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17 import de.intevation.artifacts.common.ArtifactNamespaceContext;
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20 /**
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21 * This class provides methods that help creating the artifact protocol
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22 * documents DESCRIBE, FEED, ADVANCE and OUT.
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23 *
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25 */
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26 public class ClientProtocolUtils {
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27
114
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
28 /** The XPath to the current state in the DESCRIBE document.*/
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
29 public static final String XPATH_CURRENT_STATE = "/art:result/art:state";
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
30
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
31 /** The XPath to the static UI part in the DESCRIBE document.*/
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
32 public static final String XPATH_STATIC = "/art:result/art:ui/art:static";
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
33
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
34 /** The XPath to the dynamic UI part in the DESCRIBE document.*/
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
35 public static final String XPATH_DYNAMIC = "/art:result/art:ui/art:dynamic";
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
36
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
37 /** The XPath to the reachable states part in the DESCRIBE document.*/
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
38 public static final String XPATH_STATES =
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
39 "/art:result/art:reachable-states";
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
40
211
435631e07da2 Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 208
diff changeset
41 /** The XPath to the output modes in the DESCRIBE document.*/
435631e07da2 Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 208
diff changeset
42 public static final String XPATH_OUTPUT_MODES =
435631e07da2 Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 208
diff changeset
43 "/art:result/art:outputmodes/art:output";
435631e07da2 Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 208
diff changeset
44
435631e07da2 Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 208
diff changeset
45
114
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
46 /** The XPath to the select node relative to the dynamic UI node in the
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
47 * DESCRIBE document.*/
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
48 public static final String XPATH_DATA_SELECT = "art:select";
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
49
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
50 /** The XPath to the choices nodes relative to the select node in the
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
51 * DESCRIBE document.*/
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
52 public static final String XPATH_DATA_ITEMS = "art:choices/art:item";
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
53
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
54 /** The XPath to a label in the artifact's DESCRIBE document.*/
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
55 public static final String XPATH_LABEL = "art:label/text()";
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
56
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
57 /** The XPath to a value in the artifact's DESCRIBE document.*/
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
58 public static final String XPATH_VALUE = "art:value/text()";
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
59
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
60
113
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
61 /**
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
62 * It should not be necessary to create instances of this class.
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
63 */
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
64 private ClientProtocolUtils() {
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
65 }
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
66
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
67
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
68 /**
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69 * This method creates a new CREATE document.
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
70 *
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
71 * @return the CREATE document.
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
72 */
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
73 public static Document newCreateDocument(String factory) {
293
a367a0d011af Set an interface for the global context; added a method to the artifact database to return an instance of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 285
diff changeset
74 return newCreateDocument(factory, null);
a367a0d011af Set an interface for the global context; added a method to the artifact database to return an instance of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 285
diff changeset
75 }
a367a0d011af Set an interface for the global context; added a method to the artifact database to return an instance of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 285
diff changeset
76
a367a0d011af Set an interface for the global context; added a method to the artifact database to return an instance of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 285
diff changeset
77
a367a0d011af Set an interface for the global context; added a method to the artifact database to return an instance of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 285
diff changeset
78 /**
a367a0d011af Set an interface for the global context; added a method to the artifact database to return an instance of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 285
diff changeset
79 * This method creates a new CREATE document.
a367a0d011af Set an interface for the global context; added a method to the artifact database to return an instance of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 285
diff changeset
80 *
a367a0d011af Set an interface for the global context; added a method to the artifact database to return an instance of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 285
diff changeset
81 * @return the CREATE document.
a367a0d011af Set an interface for the global context; added a method to the artifact database to return an instance of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 285
diff changeset
82 */
a367a0d011af Set an interface for the global context; added a method to the artifact database to return an instance of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 285
diff changeset
83 public static Document newCreateDocument(String factory, String uuid) {
300
0035e2511342 CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 293
diff changeset
84 return newCreateDocument(factory, uuid, null);
0035e2511342 CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 293
diff changeset
85 }
0035e2511342 CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 293
diff changeset
86
0035e2511342 CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 293
diff changeset
87
0035e2511342 CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 293
diff changeset
88 /**
0035e2511342 CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 293
diff changeset
89 * This method creates a new CREATE document.
0035e2511342 CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 293
diff changeset
90 *
0035e2511342 CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 293
diff changeset
91 * @return the CREATE document.
0035e2511342 CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 293
diff changeset
92 */
0035e2511342 CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 293
diff changeset
93 public static Document newCreateDocument(
0035e2511342 CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 293
diff changeset
94 String factory,
0035e2511342 CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 293
diff changeset
95 String uuid,
0035e2511342 CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 293
diff changeset
96 String ids)
0035e2511342 CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 293
diff changeset
97 {
113
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
98 Document doc = XMLUtils.newDocument();
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
99
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
100 XMLUtils.ElementCreator cr = new XMLUtils.ElementCreator(
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
101 doc,
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
102 ArtifactNamespaceContext.NAMESPACE_URI,
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
103 ArtifactNamespaceContext.NAMESPACE_PREFIX);
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
104
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
105 Element action = cr.create("action");
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
106 Element type = cr.create("type");
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
107 Element fac = cr.create("factory");
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
108
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
109 type.setAttribute("name", "create");
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
110 fac.setAttribute("name", factory);
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
111
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
112 action.appendChild(type);
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
113 action.appendChild(fac);
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
114
293
a367a0d011af Set an interface for the global context; added a method to the artifact database to return an instance of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 285
diff changeset
115 if (uuid != null) {
a367a0d011af Set an interface for the global context; added a method to the artifact database to return an instance of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 285
diff changeset
116 Element templ = cr.create("template");
a367a0d011af Set an interface for the global context; added a method to the artifact database to return an instance of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 285
diff changeset
117 templ.setAttribute("uuid", uuid);
a367a0d011af Set an interface for the global context; added a method to the artifact database to return an instance of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 285
diff changeset
118 action.appendChild(templ);
a367a0d011af Set an interface for the global context; added a method to the artifact database to return an instance of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 285
diff changeset
119 }
a367a0d011af Set an interface for the global context; added a method to the artifact database to return an instance of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 285
diff changeset
120
300
0035e2511342 CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 293
diff changeset
121 if (ids != null) {
0035e2511342 CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 293
diff changeset
122 Element id = cr.create("db-ids");
0035e2511342 CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 293
diff changeset
123 id.setAttribute("value", ids);
0035e2511342 CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 293
diff changeset
124 action.appendChild(id);
0035e2511342 CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 293
diff changeset
125 }
293
a367a0d011af Set an interface for the global context; added a method to the artifact database to return an instance of an Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 285
diff changeset
126
113
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
127 doc.appendChild(action);
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
128
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
129 return doc;
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
130 }
114
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
131
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
132
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
133 /**
203
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
134 * This method creates a new FEED document.
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
135 *
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
136 * @param theUuid The identifier of the artifact.
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
137 * @param theHash The hash of the artifact.
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
138 * @param theData An array that contains key/value pairs that represent the
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
139 * data that should be included in the FEED document.
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
140 *
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
141 * @return the FEED document.
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
142 */
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
143 public static Document newFeedDocument(
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
144 String theUuid,
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
145 String theHash,
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
146 String[][] theData)
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
147 {
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
148 Document doc = XMLUtils.newDocument();
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
149
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
150 XMLUtils.ElementCreator cr = new XMLUtils.ElementCreator(
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
151 doc,
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
152 ArtifactNamespaceContext.NAMESPACE_URI,
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
153 ArtifactNamespaceContext.NAMESPACE_PREFIX);
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
154
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
155 Element action = cr.create("action");
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
156 Element type = cr.create("type");
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
157 Element uuid = cr.create("uuid");
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
158 Element hash = cr.create("hash");
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
159 Element data = cr.create("data");
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
160
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
161 // XXX It is not nice that the type has no attribute namespace, but to
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
162 // be backward compatible, we don't change this now.
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
163 cr.addAttr(type, "name", "feed", false);
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
164 cr.addAttr(uuid, "value", theUuid, true);
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
165 cr.addAttr(hash, "value", theHash, true);
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
166
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
167 for (String[] kvp: theData) {
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
168 Element input = cr.create("input");
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
169 cr.addAttr(input, "name", kvp[0], true);
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
170 cr.addAttr(input, "value", kvp[1], true);
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
171
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
172 data.appendChild(input);
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
173 }
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
174
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
175 action.appendChild(type);
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
176 action.appendChild(uuid);
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
177 action.appendChild(hash);
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
178 action.appendChild(data);
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
179
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
180 doc.appendChild(action);
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
181
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
182 return doc;
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
183 }
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
184
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
185
b5e1949bc255 Implemented a new method in the ClientProtocolUtils that creates the document for a FEED operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 172
diff changeset
186 /**
240
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
187 * This method creates a new DESCRIBE document.
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
188 *
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
189 * @param theUuid The identifier of the artifact.
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
190 * @param theHash The hash of the artifact.
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
191 * @param ui If true, the UI part is included.
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
192 *
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
193 * @return the DESCRIBE document.
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
194 */
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
195 public static Document newDescribeDocument(
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
196 String theUuid,
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
197 String theHash,
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
198 boolean incUI)
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
199 {
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
200 Document doc = XMLUtils.newDocument();
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
201
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
202 XMLUtils.ElementCreator cr = new XMLUtils.ElementCreator(
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
203 doc,
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
204 ArtifactNamespaceContext.NAMESPACE_URI,
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
205 ArtifactNamespaceContext.NAMESPACE_PREFIX);
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
206
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
207 Element action = cr.create("action");
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
208 Element type = cr.create("type");
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
209 Element uuid = cr.create("uuid");
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
210 Element hash = cr.create("hash");
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
211 Element ui = cr.create("include-ui");
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
212
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
213 // XXX It is not nice that the type has no attribute namespace, but to
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
214 // be backward compatible, we don't change this now.
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
215 cr.addAttr(type, "name", "describe", false);
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
216 cr.addAttr(uuid, "value", theUuid, true);
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
217 cr.addAttr(hash, "value", theHash, true);
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
218
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
219 ui.setTextContent(incUI ? "true" : "false");
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
220
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
221 action.appendChild(type);
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
222 action.appendChild(uuid);
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
223 action.appendChild(hash);
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
224 action.appendChild(ui);
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
225
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
226 doc.appendChild(action);
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
227
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
228 return doc;
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
229 }
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
230
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
231
c0bc172ec7b2 Improved the ClientProtocolUtils with a method that returns a document that is used to trigger the DESCRIBE operation of artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 239
diff changeset
232 /**
204
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
233 * This method creates a new ADVANCE document.
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
234 *
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
235 * @param theUuid The identifier of the artifact.
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
236 * @param theHash The hash of the artifact.
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
237 * @param theTarget The target state identifier.
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
238 *
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
239 * @return the ADVANCE document.
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
240 */
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
241 public static Document newAdvanceDocument(
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
242 String theUuid,
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
243 String theHash,
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
244 String theTarget)
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
245 {
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
246 Document doc = XMLUtils.newDocument();
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
247
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
248 XMLUtils.ElementCreator cr = new XMLUtils.ElementCreator(
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
249 doc,
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
250 ArtifactNamespaceContext.NAMESPACE_URI,
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
251 ArtifactNamespaceContext.NAMESPACE_PREFIX);
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
252
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
253 Element action = cr.create("action");
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
254 Element type = cr.create("type");
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
255 Element uuid = cr.create("uuid");
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
256 Element hash = cr.create("hash");
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
257 Element target = cr.create("target");
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
258
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
259 // XXX It is not nice that the type has no attribute namespace, but to
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
260 // be backward compatible, we don't change this now.
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
261 cr.addAttr(type, "name", "advance", false);
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
262 cr.addAttr(uuid, "value", theUuid, true);
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
263 cr.addAttr(hash, "value", theHash, true);
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
264 cr.addAttr(target, "name", theTarget, true);
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
265
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
266 action.appendChild(type);
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
267 action.appendChild(uuid);
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
268 action.appendChild(hash);
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
269 action.appendChild(target);
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
270
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
271 doc.appendChild(action);
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
272
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
273 return doc;
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
274 }
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
275
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
276
5c93fb142970 Implemented a new method in the ClientProtocolUtils that creates the document for a ADVANCE operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 203
diff changeset
277 /**
172
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
278 * This method creates a new document that is used to create new artifact
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
279 * collections in the artifact server.
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
280 *
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
281 * @param name <b>Optional</b> name of the collection.
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
282 *
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
283 * @return the document to create new collections.
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
284 */
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
285 public static Document newCreateCollectionDocument(String name) {
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
286 Document doc = XMLUtils.newDocument();
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
287
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
288 XMLUtils.ElementCreator cr = new XMLUtils.ElementCreator(
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
289 doc,
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
290 ArtifactNamespaceContext.NAMESPACE_URI,
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
291 ArtifactNamespaceContext.NAMESPACE_PREFIX);
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
292
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
293 Element action = cr.create("action");
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
294 Element type = cr.create("type");
212
d7042094f7b7 Bugfix: Repaired a broken XPath.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 211
diff changeset
295 Element collection = cr.create("collection");
220
ecfc33a4ba3d Bugfix: Creating new ArtifactCollection will create artifact collections with empty - but not null - attributes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 214
diff changeset
296 Element attribute = cr.create("attribute");
172
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
297
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
298 cr.addAttr(type, "name", "create");
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
299 cr.addAttr(collection, "name", name != null ? name : "");
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
300
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
301 action.appendChild(type);
212
d7042094f7b7 Bugfix: Repaired a broken XPath.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 211
diff changeset
302 type.appendChild(collection);
220
ecfc33a4ba3d Bugfix: Creating new ArtifactCollection will create artifact collections with empty - but not null - attributes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 214
diff changeset
303 collection.appendChild(attribute);
172
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
304
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
305 doc.appendChild(action);
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
306
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
307 return doc;
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
308 }
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
309
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
310
8ce06db80857 Added a new method to the ProtocolUtils that creates the necessary CREATE document for creating new artifact collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 114
diff changeset
311 /**
214
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
312 * This method creates a new Document that is used to add an artifact to a
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
313 * collection in the artifact server.
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
314 *
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
315 * @param artId The identifier of the artifact that should be added.
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
316 * @param attr A document that contains attributes for the attribute's
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
317 * life in the collection.
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
318 *
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
319 * @return the document to add an artifact into a collection.
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
320 */
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
321 public static Document newAddArtifactDocument(String artId, Document attr) {
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
322 Document doc = XMLUtils.newDocument();
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
323
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
324 XMLUtils.ElementCreator cr = new XMLUtils.ElementCreator(
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
325 doc,
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
326 ArtifactNamespaceContext.NAMESPACE_URI,
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
327 ArtifactNamespaceContext.NAMESPACE_PREFIX);
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
328
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
329 Element action = cr.create("action");
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
330 Element type = cr.create("type");
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
331 Element artifact = cr.create("artifact");
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
332 Element attribute = cr.create("attribute");
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
333
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
334 cr.addAttr(artifact, "uuid", artId);
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
335 cr.addAttr(type, "name", "addartifact");
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
336
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
337 if (attr != null) {
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
338 attr.appendChild(attr);
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
339 }
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
340
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
341 action.appendChild(type);
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
342 type.appendChild(artifact);
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
343 artifact.appendChild(attribute);
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
344
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
345 doc.appendChild(action);
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
346
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
347 return doc;
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
348 }
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
349
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
350
fc435da7f471 Enhanced the ClientProtocolUtils with a method that creates a document that is used to add an artifact to a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 212
diff changeset
351 /**
223
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
352 * This method creates a new Document that is used to trigger the DESCRIBE
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
353 * operation of a collection in the artifact server.
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
354 *
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
355 * @param uuid The identifier of the collection that should be described.
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
356 *
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
357 * @return the document to describe a collection.
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
358 */
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
359 public static Document newDescribeCollectionDocument(String uuid) {
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
360 Document doc = XMLUtils.newDocument();
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
361
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
362 XMLUtils.ElementCreator cr = new XMLUtils.ElementCreator(
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
363 doc,
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
364 ArtifactNamespaceContext.NAMESPACE_URI,
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
365 ArtifactNamespaceContext.NAMESPACE_PREFIX);
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
366
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
367 Element action = cr.create("action");
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
368 Element type = cr.create("type");
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
369 cr.addAttr(type, "name", "describe");
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
370
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
371 action.appendChild(type);
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
372
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
373 doc.appendChild(action);
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
374
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
375 return doc;
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
376 }
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
377
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
378
239
ab196a861796 Enhanced the ClientProtocolUtils with a method that creates an XML document used for the Collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 223
diff changeset
379
ab196a861796 Enhanced the ClientProtocolUtils with a method that creates an XML document used for the Collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 223
diff changeset
380 /**
ab196a861796 Enhanced the ClientProtocolUtils with a method that creates an XML document used for the Collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 223
diff changeset
381 * This function builds a document that is used as request document of the
ab196a861796 Enhanced the ClientProtocolUtils with a method that creates an XML document used for the Collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 223
diff changeset
382 * out() operation of Collections.
ab196a861796 Enhanced the ClientProtocolUtils with a method that creates an XML document used for the Collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 223
diff changeset
383 *
ab196a861796 Enhanced the ClientProtocolUtils with a method that creates an XML document used for the Collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 223
diff changeset
384 * @param uuid The identifier of the collection.
261
f3d970a832ff Bugfix: the document that is used to trigger the OUT operation of a collection will now contain the name of the output mode and its concrete subtype.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 258
diff changeset
385 * @param mode The name of the desired output mode.
239
ab196a861796 Enhanced the ClientProtocolUtils with a method that creates an XML document used for the Collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 223
diff changeset
386 * @param type The name of the desired output type.
ab196a861796 Enhanced the ClientProtocolUtils with a method that creates an XML document used for the Collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 223
diff changeset
387 *
ab196a861796 Enhanced the ClientProtocolUtils with a method that creates an XML document used for the Collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 223
diff changeset
388 * @return the request document.
ab196a861796 Enhanced the ClientProtocolUtils with a method that creates an XML document used for the Collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 223
diff changeset
389 */
261
f3d970a832ff Bugfix: the document that is used to trigger the OUT operation of a collection will now contain the name of the output mode and its concrete subtype.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 258
diff changeset
390 public static Document newOutCollectionDocument(
f3d970a832ff Bugfix: the document that is used to trigger the OUT operation of a collection will now contain the name of the output mode and its concrete subtype.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 258
diff changeset
391 String uuid,
f3d970a832ff Bugfix: the document that is used to trigger the OUT operation of a collection will now contain the name of the output mode and its concrete subtype.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 258
diff changeset
392 String mode,
f3d970a832ff Bugfix: the document that is used to trigger the OUT operation of a collection will now contain the name of the output mode and its concrete subtype.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 258
diff changeset
393 String type) {
f3d970a832ff Bugfix: the document that is used to trigger the OUT operation of a collection will now contain the name of the output mode and its concrete subtype.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 258
diff changeset
394 return newOutCollectionDocument(uuid, mode, type, null);
258
c41b300b02c3 Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 255
diff changeset
395 }
c41b300b02c3 Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 255
diff changeset
396
c41b300b02c3 Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 255
diff changeset
397
c41b300b02c3 Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 255
diff changeset
398 /**
c41b300b02c3 Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 255
diff changeset
399 * This function builds a document that is used as request document of the
c41b300b02c3 Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 255
diff changeset
400 * out() operation of Collections. The document <i>attr</i> might be used to
c41b300b02c3 Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 255
diff changeset
401 * adjust some settings specific to the output.
c41b300b02c3 Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 255
diff changeset
402 *
c41b300b02c3 Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 255
diff changeset
403 * @param uuid The identifier of the collection.
261
f3d970a832ff Bugfix: the document that is used to trigger the OUT operation of a collection will now contain the name of the output mode and its concrete subtype.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 258
diff changeset
404 * @param mode The name of the desired output mode.
258
c41b300b02c3 Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 255
diff changeset
405 * @param type The name of the desired output type.
c41b300b02c3 Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 255
diff changeset
406 * @param attr A document that contains settings specific to the output.
c41b300b02c3 Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 255
diff changeset
407 *
c41b300b02c3 Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 255
diff changeset
408 * @return the request document.
c41b300b02c3 Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 255
diff changeset
409 */
c41b300b02c3 Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 255
diff changeset
410 public static Document newOutCollectionDocument(
c41b300b02c3 Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 255
diff changeset
411 String uuid,
261
f3d970a832ff Bugfix: the document that is used to trigger the OUT operation of a collection will now contain the name of the output mode and its concrete subtype.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 258
diff changeset
412 String mode,
258
c41b300b02c3 Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 255
diff changeset
413 String type,
c41b300b02c3 Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 255
diff changeset
414 Document attr)
c41b300b02c3 Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 255
diff changeset
415 {
239
ab196a861796 Enhanced the ClientProtocolUtils with a method that creates an XML document used for the Collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 223
diff changeset
416 Document doc = XMLUtils.newDocument();
ab196a861796 Enhanced the ClientProtocolUtils with a method that creates an XML document used for the Collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 223
diff changeset
417
ab196a861796 Enhanced the ClientProtocolUtils with a method that creates an XML document used for the Collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 223
diff changeset
418 XMLUtils.ElementCreator cr = new XMLUtils.ElementCreator(
ab196a861796 Enhanced the ClientProtocolUtils with a method that creates an XML document used for the Collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 223
diff changeset
419 doc,
ab196a861796 Enhanced the ClientProtocolUtils with a method that creates an XML document used for the Collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 223
diff changeset
420 ArtifactNamespaceContext.NAMESPACE_URI,
ab196a861796 Enhanced the ClientProtocolUtils with a method that creates an XML document used for the Collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 223
diff changeset
421 ArtifactNamespaceContext.NAMESPACE_PREFIX);
ab196a861796 Enhanced the ClientProtocolUtils with a method that creates an XML document used for the Collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 223
diff changeset
422
270
89f6de49803d Modified the method to create the document to trigger the out() operation of a collection in ClientProtocolUtils.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 267
diff changeset
423 Element action = cr.create("action");
239
ab196a861796 Enhanced the ClientProtocolUtils with a method that creates an XML document used for the Collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 223
diff changeset
424
261
f3d970a832ff Bugfix: the document that is used to trigger the OUT operation of a collection will now contain the name of the output mode and its concrete subtype.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 258
diff changeset
425 cr.addAttr(action, "name", mode, true);
239
ab196a861796 Enhanced the ClientProtocolUtils with a method that creates an XML document used for the Collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 223
diff changeset
426 cr.addAttr(action, "type", type, true);
ab196a861796 Enhanced the ClientProtocolUtils with a method that creates an XML document used for the Collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 223
diff changeset
427
ab196a861796 Enhanced the ClientProtocolUtils with a method that creates an XML document used for the Collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 223
diff changeset
428 doc.appendChild(action);
ab196a861796 Enhanced the ClientProtocolUtils with a method that creates an XML document used for the Collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 223
diff changeset
429
258
c41b300b02c3 Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 255
diff changeset
430 if (attr != null) {
c41b300b02c3 Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 255
diff changeset
431 Node root = attr.getFirstChild();
c41b300b02c3 Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 255
diff changeset
432
c41b300b02c3 Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 255
diff changeset
433 if (root != null) {
270
89f6de49803d Modified the method to create the document to trigger the out() operation of a collection in ClientProtocolUtils.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 267
diff changeset
434 action.appendChild(doc.importNode(root, true));
258
c41b300b02c3 Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 255
diff changeset
435 }
c41b300b02c3 Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 255
diff changeset
436 }
c41b300b02c3 Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 255
diff changeset
437
239
ab196a861796 Enhanced the ClientProtocolUtils with a method that creates an XML document used for the Collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 223
diff changeset
438 return doc;
ab196a861796 Enhanced the ClientProtocolUtils with a method that creates an XML document used for the Collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 223
diff changeset
439 }
ab196a861796 Enhanced the ClientProtocolUtils with a method that creates an XML document used for the Collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 223
diff changeset
440
ab196a861796 Enhanced the ClientProtocolUtils with a method that creates an XML document used for the Collection's out() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 223
diff changeset
441
223
91333a41b234 Enhanced the ClientProtocolUtils with a method to create a document to trigger the DESCRIBE operation of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
442 /**
255
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
443 * This function creates a document that is used to set the attribute of a
267
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
444 * Collection.
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
445 *
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
446 * @param uuid The identifier of the Collection.
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
447 * @param attr The new attribute value for the Collection.
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
448 *
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
449 * @return the document that is used to set the attribute.
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
450 */
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
451 public static Document newSetAttributeDocument(
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
452 String uuid,
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
453 Document attr)
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
454 {
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
455 Node root = attr != null ? attr.getFirstChild() : null;
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
456
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
457 if (root == null) {
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
458 return null;
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
459 }
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
460
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
461 Document doc = XMLUtils.newDocument();
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
462
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
463 XMLUtils.ElementCreator ec = new XMLUtils.ElementCreator(
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
464 doc,
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
465 ArtifactNamespaceContext.NAMESPACE_URI,
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
466 ArtifactNamespaceContext.NAMESPACE_PREFIX);
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
467
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
468 Element action = ec.create("action");
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
469 Element type = ec.create("type");
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
470 Element collection = ec.create("collection");
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
471
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
472 ec.addAttr(type, "name", "setattribute", false);
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
473 ec.addAttr(collection, "uuid", uuid, false);
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
474
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
475 doc.appendChild(action);
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
476 action.appendChild(type);
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
477 type.appendChild(collection);
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
478
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
479 collection.appendChild(doc.importNode(root, true));
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
480
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
481 return doc;
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
482 }
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
483
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
484 /**
72de5c373c9b Enhanced the ClientProtocolUtils with a method to create a document that sets the attribute of a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 261
diff changeset
485 * This function creates a document that is used to set the attribute of a
255
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
486 * CollectionItem.
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
487 *
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
488 * @param uuid The identifier of the CollectionItem.
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
489 * @param attr The new attribute value for the CollectionItem.
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
490 *
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
491 * @return the document that is used to set the attribute.
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
492 */
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
493 public static Document newSetItemAttributeDocument(
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
494 String uuid,
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
495 Document attr)
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
496 {
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
497 Node root = attr.getFirstChild();
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
498
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
499 if (root == null) {
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
500 return null;
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
501 }
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
502
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
503 Document doc = XMLUtils.newDocument();
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
504
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
505 XMLUtils.ElementCreator ec = new XMLUtils.ElementCreator(
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
506 doc,
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
507 ArtifactNamespaceContext.NAMESPACE_URI,
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
508 ArtifactNamespaceContext.NAMESPACE_PREFIX);
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
509
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
510 Element action = ec.create("action");
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
511 Element type = ec.create("type");
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
512 Element artifact = ec.create("artifact");
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
513
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
514 ec.addAttr(type, "name", "setitemattribute");
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
515 ec.addAttr(artifact, "uuid", uuid);
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
516
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
517 doc.appendChild(action);
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
518 action.appendChild(type);
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
519 type.appendChild(artifact);
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
520
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
521 artifact.appendChild(doc.importNode(root, true));
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
522
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
523 return doc;
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
524 }
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
525
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
526
efbad8c5c0e5 Improved the ClientProtocolUtils - new function to create a document that is used to set the attribute of a CollectionItem.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 240
diff changeset
527 /**
285
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
528 * This function creates a document that is used to set the time-to-live
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
529 * of a collection.
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
530 *
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
531 * @param ttl The ttl for the Collection.
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
532 *
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
533 * @return the document that is used to set the time-to-live.
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
534 */
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
535 public static Document newSetCollectionTTLDocument(String ttl) {
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
536 Document doc = XMLUtils.newDocument();
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
537
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
538 XMLUtils.ElementCreator ec = new XMLUtils.ElementCreator(
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
539 doc,
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
540 ArtifactNamespaceContext.NAMESPACE_URI,
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
541 ArtifactNamespaceContext.NAMESPACE_PREFIX);
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
542
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
543 Element action = ec.create("action");
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
544 Element type = ec.create("type");
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
545 Element ttlEl = ec.create("ttl");
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
546
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
547 ec.addAttr(type, "name", "settimetolive");
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
548 ec.addAttr(ttlEl, "value", ttl);
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
549
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
550 doc.appendChild(action);
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
551 action.appendChild(type);
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
552 type.appendChild(ttlEl);
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
553
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
554 return doc;
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
555 }
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
556
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
557
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
558 /**
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
559 * This function creates a document that is used to set the name of a
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
560 * collection.
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
561 *
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
562 * @param name The name for the Collection.
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
563 *
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
564 * @return the document that is used to set the name of a collection.
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
565 */
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
566 public static Document newSetCollectionNameDocument(String name) {
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
567 Document doc = XMLUtils.newDocument();
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
568
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
569 XMLUtils.ElementCreator ec = new XMLUtils.ElementCreator(
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
570 doc,
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
571 ArtifactNamespaceContext.NAMESPACE_URI,
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
572 ArtifactNamespaceContext.NAMESPACE_PREFIX);
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
573
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
574 Element action = ec.create("action");
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
575 Element type = ec.create("type");
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
576 Element coll = ec.create("collection");
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
577
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
578 ec.addAttr(type, "name", "setname");
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
579 ec.addAttr(coll, "name", name);
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
580
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
581 doc.appendChild(action);
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
582 action.appendChild(type);
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
583 type.appendChild(coll);
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
584
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
585 return doc;
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
586 }
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
587
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
588
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
589 /**
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
590 * This function creates a document that is used to delete an existing
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
591 * collection.
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
592 *
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
593 * @return the document that is used to delete an existing collection.
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
594 */
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
595 public static Document newDeleteCollectionDocument() {
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
596 Document doc = XMLUtils.newDocument();
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
597
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
598 XMLUtils.ElementCreator ec = new XMLUtils.ElementCreator(
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
599 doc,
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
600 ArtifactNamespaceContext.NAMESPACE_URI,
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
601 ArtifactNamespaceContext.NAMESPACE_PREFIX);
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
602
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
603 Element action = ec.create("action");
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
604 Element type = ec.create("type");
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
605
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
606 ec.addAttr(type, "name", "delete");
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
607
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
608 doc.appendChild(action);
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
609 action.appendChild(type);
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
610
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
611 return doc;
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
612 }
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
613
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
614
f5a0f90bcc6f Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 270
diff changeset
615 /**
114
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
616 * Returns string value found by {@link XPATH_LABEL} relative to
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
617 * <i>node</i>.
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
618 *
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
619 * @param node A node.
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
620 *
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
621 * @return the string value found by {@link XPATH_LABEL}.
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
622 */
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
623 public static String getLabel(Node node) {
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
624 return (String) XMLUtils.xpath(
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
625 node,
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
626 XPATH_LABEL,
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
627 XPathConstants.STRING,
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
628 ArtifactNamespaceContext.INSTANCE);
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
629 }
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
630
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
631
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
632 /**
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
633 * Returns string value found by {@link XPATH_VALUE} relative to
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
634 * <i>node</i>.
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
635 *
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
636 * @param node A node.
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
637 *
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
638 * @return the string value found by {@link XPATH_VALUE}.
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
639 */
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
640 public static String getValue(Node node) {
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
641 return (String) XMLUtils.xpath(
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
642 node,
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
643 XPATH_VALUE,
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
644 XPathConstants.STRING,
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
645 ArtifactNamespaceContext.INSTANCE);
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
646 }
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
647
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
648
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
649 /**
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
650 * This method returns the static UI part of the artifact's DESCRIBE
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
651 * document.
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
652 *
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
653 * @param description The document returned by the artifact server's
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
654 * DESCRIBE operation.
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
655 *
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
656 * @return the static UI node.
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
657 */
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
658 public static Node getStaticUI(Document description) {
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
659 return (Node) XMLUtils.xpath(
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
660 description,
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
661 XPATH_STATIC,
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
662 XPathConstants.NODE,
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
663 ArtifactNamespaceContext.INSTANCE);
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
664 }
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
665
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
666
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
667 /**
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
668 * This method returns the dynamic UI part of the artifact's DESCRIBE
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
669 * document.
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
670 *
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
671 * @param description The document returned by the artifact server's
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
672 * DESCRIBE operation.
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
673 *
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
674 * @return the dynamic UI node.
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
675 */
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
676 public static Node getDynamicUI(Document description) {
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
677 return (Node) XMLUtils.xpath(
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
678 description,
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
679 XPATH_DYNAMIC,
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
680 XPathConstants.NODE,
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
681 ArtifactNamespaceContext.INSTANCE);
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
682 }
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
683
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
684
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
685 /**
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
686 * This method returns the current state node contained in the DESCRIBE
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
687 * document.
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
688 *
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
689 * @param description The document returned by the artifact server's
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
690 * DESCRIBE operation.
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
691 *
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
692 * @return the node containing information about the current state.
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
693 */
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
694 public static Node getCurrentState(Document description) {
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
695 return (Node) XMLUtils.xpath(
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
696 description,
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
697 XPATH_CURRENT_STATE,
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
698 XPathConstants.NODE,
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
699 ArtifactNamespaceContext.INSTANCE);
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
700 }
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
701
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
702
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
703 /**
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
704 * This method returns the node that contains information about the
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
705 * reachable states of the artifact in the artifact's DESCRIBE document.
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
706 *
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
707 * @param description The document returned by the artifact server's
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
708 * DESCRIBE operation.
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
709 *
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
710 * @return the node that contains the reachable states.
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
711 */
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
712 public static Node getReachableStates(Document description) {
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
713 return (Node) XMLUtils.xpath(
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
714 description,
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
715 XPATH_STATES,
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
716 XPathConstants.NODE,
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
717 ArtifactNamespaceContext.INSTANCE);
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
718 }
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
719
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
720
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
721 /**
211
435631e07da2 Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 208
diff changeset
722 * This method returns the output mode nodes of the DESCRIBE document.
435631e07da2 Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 208
diff changeset
723 *
435631e07da2 Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 208
diff changeset
724 * @param description The document returned by the artifact server's
435631e07da2 Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 208
diff changeset
725 * DESCRIBE operation.
435631e07da2 Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 208
diff changeset
726 *
435631e07da2 Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 208
diff changeset
727 * @return the node that contains the output modes.
435631e07da2 Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 208
diff changeset
728 */
435631e07da2 Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 208
diff changeset
729 public static NodeList getOutputModes(Document description) {
435631e07da2 Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 208
diff changeset
730 return (NodeList) XMLUtils.xpath(
435631e07da2 Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 208
diff changeset
731 description,
435631e07da2 Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 208
diff changeset
732 XPATH_OUTPUT_MODES,
435631e07da2 Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 208
diff changeset
733 XPathConstants.NODESET,
435631e07da2 Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 208
diff changeset
734 ArtifactNamespaceContext.INSTANCE);
435631e07da2 Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 208
diff changeset
735 }
435631e07da2 Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 208
diff changeset
736
435631e07da2 Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 208
diff changeset
737
435631e07da2 Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 208
diff changeset
738 /**
114
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
739 * Returns the node found by {@link XPATH_DATA_SELECT}.
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
740 *
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
741 * @param dynamicNode The dynamic UI node of the DESCRIBE document.
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
742 *
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
743 * @return the select node found in the dynamic UI node.
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
744 */
208
8ea4d0824d8f Changed a return type of a ClientProtocolUtils method.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 204
diff changeset
745 public static NodeList getSelectNode(Node dynamicNode) {
8ea4d0824d8f Changed a return type of a ClientProtocolUtils method.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 204
diff changeset
746 return (NodeList) XMLUtils.xpath(
114
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
747 dynamicNode,
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
748 XPATH_DATA_SELECT,
208
8ea4d0824d8f Changed a return type of a ClientProtocolUtils method.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 204
diff changeset
749 XPathConstants.NODESET,
114
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
750 ArtifactNamespaceContext.INSTANCE);
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
751 }
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
752
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
753
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
754 /**
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
755 * Returns the items that could be found in the <i>node</i>.
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
756 *
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
757 * @param node A select node.
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
758 *
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
759 * @return the choices nodes as node list.
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
760 */
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
761 public static NodeList getItemNodes(Node node) {
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
762 return (NodeList) XMLUtils.xpath(
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
763 node,
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
764 XPATH_DATA_ITEMS,
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
765 XPathConstants.NODESET,
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
766 ArtifactNamespaceContext.INSTANCE);
19b86e27d0c3 New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 113
diff changeset
767 }
113
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
768 }
0344a20f8a93 Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
769 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org