Mercurial > dive4elements > framework
annotate artifacts-common/src/main/java/org/dive4elements/artifacts/common/utils/ClientProtocolUtils.java @ 489:665613c35cab 3.0.7
Add newCreateDocument call that accepts targetOut parameter
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Fri, 31 May 2013 15:00:08 +0200 |
parents | 415df0fc4fa1 |
children |
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 */ |
475
415df0fc4fa1
Fixed maven group ids
Sascha L. Teichmann <teichmann@intevation.de>
parents:
472
diff
changeset
|
8 package org.dive4elements.artifacts.common.utils; |
113
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 |
475
415df0fc4fa1
Fixed maven group ids
Sascha L. Teichmann <teichmann@intevation.de>
parents:
472
diff
changeset
|
17 import org.dive4elements.artifacts.common.ArtifactNamespaceContext; |
113
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 |
341
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
28 /** The XPath to the current state in the DESCRIBE document. */ |
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
|
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 |
341
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
31 /** The XPath to the static UI part in the DESCRIBE document. */ |
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
|
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 |
341
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
34 /** The XPath to the dynamic UI part in the DESCRIBE document. */ |
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
|
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 |
341
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
37 /** The XPath to the reachable states part in the DESCRIBE document. */ |
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
|
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 |
341
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
41 /** The XPath to the output modes in the DESCRIBE document. */ |
211
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 |
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
|
45 /** The XPath to the select node relative to the dynamic UI node in the |
341
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
46 * DESCRIBE document. */ |
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
|
47 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
|
48 |
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 /** The XPath to the choices nodes relative to the select node in the |
341
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
50 * DESCRIBE document. */ |
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
|
51 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
|
52 |
370
203bd78def81
Improved ClientProtocolUtils to extract min and max values for items with two new functions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
367
diff
changeset
|
53 /** The XPath that points to the min value of a range.*/ |
203bd78def81
Improved ClientProtocolUtils to extract min and max values for items with two new functions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
367
diff
changeset
|
54 public static final String XPATH_MIN_NODE = "art:min/@art:value"; |
203bd78def81
Improved ClientProtocolUtils to extract min and max values for items with two new functions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
367
diff
changeset
|
55 |
203bd78def81
Improved ClientProtocolUtils to extract min and max values for items with two new functions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
367
diff
changeset
|
56 /** The XPath that points to the max value of a range.*/ |
203bd78def81
Improved ClientProtocolUtils to extract min and max values for items with two new functions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
367
diff
changeset
|
57 public static final String XPATH_MAX_NODE = "art:max/@art:value"; |
203bd78def81
Improved ClientProtocolUtils to extract min and max values for items with two new functions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
367
diff
changeset
|
58 |
371
831d317547eb
Added methods to extract the default value for a min and max item.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
370
diff
changeset
|
59 /** The XPath that points to the default min value of a range.*/ |
831d317547eb
Added methods to extract the default value for a min and max item.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
370
diff
changeset
|
60 public static final String XPATH_DEF_MIN = "art:min/@art:default"; |
831d317547eb
Added methods to extract the default value for a min and max item.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
370
diff
changeset
|
61 |
831d317547eb
Added methods to extract the default value for a min and max item.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
370
diff
changeset
|
62 /** The XPath that points to the default max value of a range.*/ |
831d317547eb
Added methods to extract the default value for a min and max item.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
370
diff
changeset
|
63 public static final String XPATH_DEF_MAX = "art:max/@art:default"; |
831d317547eb
Added methods to extract the default value for a min and max item.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
370
diff
changeset
|
64 |
341
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
65 /** The XPath to a label in the artifact's DESCRIBE document. */ |
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
|
66 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
|
67 |
341
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
68 /** The XPath to a value in the artifact's DESCRIBE document. */ |
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
|
69 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
|
70 |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
71 |
113
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 * 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
|
74 */ |
0344a20f8a93
Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 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
|
76 } |
0344a20f8a93
Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 |
0344a20f8a93
Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 |
0344a20f8a93
Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 /** |
0344a20f8a93
Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 * 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
|
81 * |
0344a20f8a93
Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 * @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
|
83 */ |
0344a20f8a93
Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 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
|
85 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
|
86 } |
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
|
87 |
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
|
88 |
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
|
89 /** |
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
|
90 * 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
|
91 * |
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
|
92 * @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
|
93 */ |
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
|
94 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
|
95 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
|
96 } |
0035e2511342
CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
293
diff
changeset
|
97 |
325
4022ea69d1cb
Write filters to create document if they are given.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
324
diff
changeset
|
98 public static Document newCreateDocument( |
4022ea69d1cb
Write filters to create document if they are given.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
324
diff
changeset
|
99 String factory, |
4022ea69d1cb
Write filters to create document if they are given.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
324
diff
changeset
|
100 String uuid, |
4022ea69d1cb
Write filters to create document if they are given.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
324
diff
changeset
|
101 String ids |
4022ea69d1cb
Write filters to create document if they are given.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
324
diff
changeset
|
102 ) { |
4022ea69d1cb
Write filters to create document if they are given.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
324
diff
changeset
|
103 return newCreateDocument(factory, uuid, ids, null); |
4022ea69d1cb
Write filters to create document if they are given.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
324
diff
changeset
|
104 } |
300
0035e2511342
CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
293
diff
changeset
|
105 |
0035e2511342
CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
293
diff
changeset
|
106 /** |
0035e2511342
CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
293
diff
changeset
|
107 * 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
|
108 * |
0035e2511342
CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
293
diff
changeset
|
109 * @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
|
110 */ |
0035e2511342
CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
293
diff
changeset
|
111 public static Document newCreateDocument( |
325
4022ea69d1cb
Write filters to create document if they are given.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
324
diff
changeset
|
112 String factory, |
4022ea69d1cb
Write filters to create document if they are given.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
324
diff
changeset
|
113 String uuid, |
4022ea69d1cb
Write filters to create document if they are given.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
324
diff
changeset
|
114 String ids, |
4022ea69d1cb
Write filters to create document if they are given.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
324
diff
changeset
|
115 CreationFilter filter |
4022ea69d1cb
Write filters to create document if they are given.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
324
diff
changeset
|
116 ) { |
489
665613c35cab
Add newCreateDocument call that accepts targetOut parameter
Andre Heinecke <aheinecke@intevation.de>
parents:
475
diff
changeset
|
117 return newCreateDocument(factory, uuid, ids, filter, null); |
665613c35cab
Add newCreateDocument call that accepts targetOut parameter
Andre Heinecke <aheinecke@intevation.de>
parents:
475
diff
changeset
|
118 } |
665613c35cab
Add newCreateDocument call that accepts targetOut parameter
Andre Heinecke <aheinecke@intevation.de>
parents:
475
diff
changeset
|
119 |
665613c35cab
Add newCreateDocument call that accepts targetOut parameter
Andre Heinecke <aheinecke@intevation.de>
parents:
475
diff
changeset
|
120 public static Document newCreateDocument( |
665613c35cab
Add newCreateDocument call that accepts targetOut parameter
Andre Heinecke <aheinecke@intevation.de>
parents:
475
diff
changeset
|
121 String factory, |
665613c35cab
Add newCreateDocument call that accepts targetOut parameter
Andre Heinecke <aheinecke@intevation.de>
parents:
475
diff
changeset
|
122 String uuid, |
665613c35cab
Add newCreateDocument call that accepts targetOut parameter
Andre Heinecke <aheinecke@intevation.de>
parents:
475
diff
changeset
|
123 String ids, |
665613c35cab
Add newCreateDocument call that accepts targetOut parameter
Andre Heinecke <aheinecke@intevation.de>
parents:
475
diff
changeset
|
124 CreationFilter filter, |
665613c35cab
Add newCreateDocument call that accepts targetOut parameter
Andre Heinecke <aheinecke@intevation.de>
parents:
475
diff
changeset
|
125 String targetOut |
665613c35cab
Add newCreateDocument call that accepts targetOut parameter
Andre Heinecke <aheinecke@intevation.de>
parents:
475
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 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
|
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 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
|
130 doc, |
0344a20f8a93
Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
131 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
|
132 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
|
133 |
0344a20f8a93
Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
134 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
|
135 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
|
136 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
|
137 |
0344a20f8a93
Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
138 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
|
139 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
|
140 |
0344a20f8a93
Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
141 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
|
142 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
|
143 |
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
|
144 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
|
145 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
|
146 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
|
147 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
|
148 } |
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
|
149 |
300
0035e2511342
CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
293
diff
changeset
|
150 if (ids != null) { |
324
ee6e1b2f137a
Renamed an XML attribute in the code to create document for new Artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
300
diff
changeset
|
151 Element id = cr.create("ids"); |
300
0035e2511342
CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
293
diff
changeset
|
152 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
|
153 action.appendChild(id); |
0035e2511342
CREATE documents for Artifact creation might contain db-ids now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
293
diff
changeset
|
154 } |
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
|
155 |
325
4022ea69d1cb
Write filters to create document if they are given.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
324
diff
changeset
|
156 if (filter != null) { |
4022ea69d1cb
Write filters to create document if they are given.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
324
diff
changeset
|
157 action.appendChild(filter.toXML(cr)); |
4022ea69d1cb
Write filters to create document if they are given.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
324
diff
changeset
|
158 } |
4022ea69d1cb
Write filters to create document if they are given.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
324
diff
changeset
|
159 |
489
665613c35cab
Add newCreateDocument call that accepts targetOut parameter
Andre Heinecke <aheinecke@intevation.de>
parents:
475
diff
changeset
|
160 if (targetOut != null) { |
665613c35cab
Add newCreateDocument call that accepts targetOut parameter
Andre Heinecke <aheinecke@intevation.de>
parents:
475
diff
changeset
|
161 Element to = cr.create("target_out"); |
665613c35cab
Add newCreateDocument call that accepts targetOut parameter
Andre Heinecke <aheinecke@intevation.de>
parents:
475
diff
changeset
|
162 to.setAttribute("value", targetOut); |
665613c35cab
Add newCreateDocument call that accepts targetOut parameter
Andre Heinecke <aheinecke@intevation.de>
parents:
475
diff
changeset
|
163 action.appendChild(to); |
665613c35cab
Add newCreateDocument call that accepts targetOut parameter
Andre Heinecke <aheinecke@intevation.de>
parents:
475
diff
changeset
|
164 } |
665613c35cab
Add newCreateDocument call that accepts targetOut parameter
Andre Heinecke <aheinecke@intevation.de>
parents:
475
diff
changeset
|
165 |
113
0344a20f8a93
Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
166 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
|
167 |
0344a20f8a93
Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
168 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
|
169 } |
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
|
170 |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
171 |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
172 /** |
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
|
173 * 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
|
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 * @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
|
176 * @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
|
177 * @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
|
178 * 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
|
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 * @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
|
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 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
|
183 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
|
184 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
|
185 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
|
186 { |
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
|
187 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
|
188 |
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
|
189 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
|
190 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
|
191 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
|
192 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
|
193 |
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
|
194 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
|
195 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
|
196 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
|
197 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
|
198 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
|
199 |
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
|
200 // 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
|
201 // 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
|
202 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
|
203 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
|
204 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
|
205 |
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
|
206 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
|
207 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
|
208 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
|
209 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
|
210 |
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
|
211 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
|
212 } |
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
|
213 |
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
|
214 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
|
215 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
|
216 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
|
217 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
|
218 |
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
|
219 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
|
220 |
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
|
221 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
|
222 } |
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
|
223 |
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
|
224 |
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
|
225 /** |
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
|
226 * 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
|
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 * @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
|
229 * @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
|
230 * @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
|
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 * @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
|
233 */ |
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
|
234 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
|
235 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
|
236 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
|
237 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
|
238 { |
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
|
239 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
|
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
|
241 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
|
242 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
|
243 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
|
244 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
|
245 |
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
|
246 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
|
247 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
|
248 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
|
249 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
|
250 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
|
251 |
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
|
252 // 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
|
253 // 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
|
254 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
|
255 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
|
256 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
|
257 |
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
|
258 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
|
259 |
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
|
260 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
|
261 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
|
262 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
|
263 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
|
264 |
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
|
265 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
|
266 |
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
|
267 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
|
268 } |
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
|
269 |
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
|
270 |
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
|
271 /** |
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
|
272 * 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
|
273 * |
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 * @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
|
275 * @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
|
276 * @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
|
277 * |
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
|
278 * @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
|
279 */ |
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
|
280 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
|
281 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
|
282 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
|
283 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
|
284 { |
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
|
285 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
|
286 |
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
|
287 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
|
288 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
|
289 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
|
290 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
|
291 |
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
|
292 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
|
293 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
|
294 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
|
295 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
|
296 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
|
297 |
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
|
298 // 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
|
299 // 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
|
300 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
|
301 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
|
302 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
|
303 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
|
304 |
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
|
305 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
|
306 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
|
307 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
|
308 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
|
309 |
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
|
310 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
|
311 |
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
|
312 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
|
313 } |
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
|
314 |
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
|
315 |
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
|
316 /** |
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
|
317 * 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
|
318 * 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
|
319 * |
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
|
320 * @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
|
321 * |
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
|
322 * @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
|
323 */ |
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
|
324 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
|
325 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
|
326 |
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
|
327 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
|
328 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
|
329 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
|
330 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
|
331 |
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
|
332 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
|
333 Element type = cr.create("type"); |
212
d7042094f7b7
Bugfix: Repaired a broken XPath.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
334 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
|
335 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
|
336 |
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
|
337 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
|
338 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
|
339 |
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
|
340 action.appendChild(type); |
212
d7042094f7b7
Bugfix: Repaired a broken XPath.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
341 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
|
342 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
|
343 |
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
|
344 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
|
345 |
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
|
346 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
|
347 } |
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
|
348 |
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
|
349 |
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
|
350 /** |
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
|
351 * 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
|
352 * 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
|
353 * |
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
|
354 * @param artId The identifier of the artifact that should be added. |
341
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
355 * @param attr A document that contains attributes for the artifact's |
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
|
356 * 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
|
357 * |
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
|
358 * @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
|
359 */ |
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
|
360 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
|
361 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
|
362 |
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
|
363 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
|
364 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
|
365 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
|
366 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
|
367 |
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
|
368 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
|
369 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
|
370 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
|
371 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
|
372 |
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
|
373 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
|
374 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
|
375 |
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
|
376 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
|
377 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
|
378 } |
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
|
379 |
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
|
380 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
|
381 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
|
382 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
|
383 |
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
|
384 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
|
385 |
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
|
386 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
|
387 } |
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
|
388 |
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
|
389 |
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
|
390 /** |
341
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
391 * Create a new Document that is used to remove an artifact from a |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
392 * collection in the artifact server. |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
393 * |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
394 * @param artId The identifier of the artifact that should be added. |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
395 * |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
396 * @return the document to add an artifact into a collection. |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
397 */ |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
398 public static Document newRemoveArtifactDocument(String artId) { |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
399 Document doc = XMLUtils.newDocument(); |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
400 |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
401 XMLUtils.ElementCreator cr = new XMLUtils.ElementCreator( |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
402 doc, |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
403 ArtifactNamespaceContext.NAMESPACE_URI, |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
404 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
405 |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
406 Element action = cr.create("action"); |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
407 Element type = cr.create("type"); |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
408 Element artifact = cr.create("artifact"); |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
409 |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
410 cr.addAttr(artifact, "uuid", artId); |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
411 cr.addAttr(type, "name", "removeartifact"); |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
412 |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
413 action.appendChild(type); |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
414 type.appendChild(artifact); |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
415 |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
416 doc.appendChild(action); |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
417 |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
418 return doc; |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
419 } |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
420 |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
421 |
e0efa2c28d19
Helper function to create a document to remove an artifact from an collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
325
diff
changeset
|
422 /** |
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
|
423 * 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
|
424 * 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
|
425 * |
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
|
426 * @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
|
427 * |
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
|
428 * @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
|
429 */ |
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
|
430 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
|
431 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
|
432 |
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
|
433 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
|
434 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
|
435 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
|
436 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
|
437 |
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
|
438 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
|
439 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
|
440 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
|
441 |
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 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
|
443 |
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
|
444 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
|
445 |
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
|
446 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
|
447 } |
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
|
448 |
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
|
449 |
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
|
450 |
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
|
451 /** |
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
|
452 * 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
|
453 * 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
|
454 * |
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
|
455 * @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
|
456 * @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
|
457 * @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
|
458 * |
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
|
459 * @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
|
460 */ |
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
|
461 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
|
462 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
|
463 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
|
464 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
|
465 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
|
466 } |
c41b300b02c3
Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
255
diff
changeset
|
467 |
c41b300b02c3
Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
255
diff
changeset
|
468 |
c41b300b02c3
Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
255
diff
changeset
|
469 /** |
c41b300b02c3
Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
255
diff
changeset
|
470 * 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
|
471 * 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
|
472 * 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
|
473 * |
c41b300b02c3
Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
255
diff
changeset
|
474 * @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
|
475 * @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
|
476 * @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
|
477 * @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
|
478 * |
c41b300b02c3
Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
255
diff
changeset
|
479 * @return the request document. |
c41b300b02c3
Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
255
diff
changeset
|
480 */ |
c41b300b02c3
Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
255
diff
changeset
|
481 public static Document newOutCollectionDocument( |
c41b300b02c3
Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
255
diff
changeset
|
482 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
|
483 String mode, |
258
c41b300b02c3
Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
255
diff
changeset
|
484 String type, |
c41b300b02c3
Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
255
diff
changeset
|
485 Document attr) |
c41b300b02c3
Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
255
diff
changeset
|
486 { |
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
|
487 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
|
488 |
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
|
489 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
|
490 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
|
491 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
|
492 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
|
493 |
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
|
494 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
|
495 |
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
|
496 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
|
497 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
|
498 |
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
|
499 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
|
500 |
258
c41b300b02c3
Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
255
diff
changeset
|
501 if (attr != null) { |
c41b300b02c3
Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
255
diff
changeset
|
502 Node root = attr.getFirstChild(); |
c41b300b02c3
Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
255
diff
changeset
|
503 |
c41b300b02c3
Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
255
diff
changeset
|
504 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
|
505 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
|
506 } |
c41b300b02c3
Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
255
diff
changeset
|
507 } |
c41b300b02c3
Improved the ClientProtocolUtils: collections OUT document contains attributes now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
255
diff
changeset
|
508 |
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
|
509 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
|
510 } |
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
|
511 |
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
|
512 |
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
|
513 /** |
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
|
514 * 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
|
515 * 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
|
516 * |
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
|
517 * @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
|
518 * @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
|
519 * |
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
|
520 * @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
|
521 */ |
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
|
522 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
|
523 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
|
524 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
|
525 { |
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
|
526 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
|
527 |
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
|
528 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
|
529 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
|
530 } |
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
|
531 |
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
|
532 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
|
533 |
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
|
534 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
|
535 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
|
536 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
|
537 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
|
538 |
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
|
539 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
|
540 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
|
541 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
|
542 |
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
|
543 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
|
544 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
|
545 |
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
|
546 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
|
547 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
|
548 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
|
549 |
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
|
550 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
|
551 |
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
|
552 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
|
553 } |
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
|
554 |
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
|
555 /** |
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
|
556 * 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
|
557 * 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
|
558 * |
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
|
559 * @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
|
560 * @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
|
561 * |
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
|
562 * @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
|
563 */ |
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
|
564 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
|
565 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
|
566 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
|
567 { |
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
|
568 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
|
569 |
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
|
570 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
|
571 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
|
572 } |
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
|
573 |
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
|
574 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
|
575 |
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
|
576 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
|
577 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
|
578 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
|
579 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
|
580 |
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
|
581 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
|
582 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
|
583 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
|
584 |
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
|
585 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
|
586 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
|
587 |
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
|
588 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
|
589 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
|
590 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
|
591 |
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
|
592 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
|
593 |
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
|
594 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
|
595 } |
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
|
596 |
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
|
597 |
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
|
598 /** |
285
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
599 * 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
|
600 * 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
|
601 * |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
602 * @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
|
603 * |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
604 * @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
|
605 */ |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
606 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
|
607 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
|
608 |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
609 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
|
610 doc, |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
611 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
|
612 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
|
613 |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
614 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
|
615 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
|
616 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
|
617 |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
618 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
|
619 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
|
620 |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
621 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
|
622 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
|
623 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
|
624 |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
625 return doc; |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
626 } |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
627 |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
628 |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
629 /** |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
630 * 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
|
631 * collection. |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
632 * |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
633 * @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
|
634 * |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
635 * @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
|
636 */ |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
637 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
|
638 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
|
639 |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
640 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
|
641 doc, |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
642 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
|
643 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
|
644 |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
645 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
|
646 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
|
647 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
|
648 |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
649 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
|
650 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
|
651 |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
652 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
|
653 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
|
654 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
|
655 |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
656 return doc; |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
657 } |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
658 |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
659 |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
660 /** |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
661 * 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
|
662 * collection. |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
663 * |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
664 * @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
|
665 */ |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
666 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
|
667 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
|
668 |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
669 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
|
670 doc, |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
671 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
|
672 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
|
673 |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
674 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
|
675 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
|
676 |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
677 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
|
678 |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
679 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
|
680 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
|
681 |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
682 return doc; |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
683 } |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
684 |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
685 |
f5a0f90bcc6f
Improved the ClientProtocolUtils: new methods to create collection action specific documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
270
diff
changeset
|
686 /** |
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
|
687 * 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
|
688 * <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
|
689 * |
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 * @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
|
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 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
|
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 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
|
695 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
|
696 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
|
697 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
|
698 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
|
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 * 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
|
705 * <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
|
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 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
|
708 * |
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 * @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
|
710 */ |
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 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
|
712 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
|
713 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
|
714 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
|
715 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
|
716 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
|
717 } |
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 * 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
|
722 * 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
|
723 * |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
724 * @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
|
725 * 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
|
726 * |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
727 * @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
|
728 */ |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
729 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
|
730 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
|
731 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
|
732 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
|
733 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
|
734 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
|
735 } |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
736 |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
737 |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
738 /** |
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 * 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
|
740 * 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
|
741 * |
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 * @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
|
743 * 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
|
744 * |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
745 * @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
|
746 */ |
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 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
|
748 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
|
749 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
|
750 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
|
751 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
|
752 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
|
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 |
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 * 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
|
758 * 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
|
759 * |
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 * @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
|
761 * 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
|
762 * |
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 * @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
|
764 */ |
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 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
|
766 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
|
767 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
|
768 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
|
769 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
|
770 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
|
771 } |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
772 |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
773 |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
774 /** |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
775 * 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
|
776 * 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
|
777 * |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
778 * @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
|
779 * 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
|
780 * |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
781 * @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
|
782 */ |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
783 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
|
784 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
|
785 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
|
786 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
|
787 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
|
788 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
|
789 } |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
790 |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
791 |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
792 /** |
211
435631e07da2
Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
208
diff
changeset
|
793 * 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
|
794 * |
435631e07da2
Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
208
diff
changeset
|
795 * @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
|
796 * DESCRIBE operation. |
435631e07da2
Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
208
diff
changeset
|
797 * |
435631e07da2
Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
208
diff
changeset
|
798 * @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
|
799 */ |
435631e07da2
Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
208
diff
changeset
|
800 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
|
801 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
|
802 description, |
435631e07da2
Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
208
diff
changeset
|
803 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
|
804 XPathConstants.NODESET, |
435631e07da2
Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
208
diff
changeset
|
805 ArtifactNamespaceContext.INSTANCE); |
435631e07da2
Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
208
diff
changeset
|
806 } |
435631e07da2
Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
208
diff
changeset
|
807 |
435631e07da2
Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
208
diff
changeset
|
808 |
435631e07da2
Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
208
diff
changeset
|
809 /** |
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
|
810 * 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
|
811 * |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
812 * @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
|
813 * |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
814 * @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
|
815 */ |
208
8ea4d0824d8f
Changed a return type of a ClientProtocolUtils method.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
204
diff
changeset
|
816 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
|
817 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
|
818 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
|
819 XPATH_DATA_SELECT, |
208
8ea4d0824d8f
Changed a return type of a ClientProtocolUtils method.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
204
diff
changeset
|
820 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
|
821 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
|
822 } |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
823 |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
824 |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
825 /** |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
826 * 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
|
827 * |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
828 * @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
|
829 * |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
830 * @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
|
831 */ |
19b86e27d0c3
New XPath constants and methods that retrieve important nodes of the DESCRIBE document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
113
diff
changeset
|
832 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
|
833 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
|
834 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
|
835 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
|
836 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
|
837 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
|
838 } |
370
203bd78def81
Improved ClientProtocolUtils to extract min and max values for items with two new functions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
367
diff
changeset
|
839 |
203bd78def81
Improved ClientProtocolUtils to extract min and max values for items with two new functions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
367
diff
changeset
|
840 |
203bd78def81
Improved ClientProtocolUtils to extract min and max values for items with two new functions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
367
diff
changeset
|
841 public static String getMinNode(Node parent) { |
203bd78def81
Improved ClientProtocolUtils to extract min and max values for items with two new functions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
367
diff
changeset
|
842 return (String) XMLUtils.xpath( |
203bd78def81
Improved ClientProtocolUtils to extract min and max values for items with two new functions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
367
diff
changeset
|
843 parent, |
203bd78def81
Improved ClientProtocolUtils to extract min and max values for items with two new functions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
367
diff
changeset
|
844 XPATH_MIN_NODE, |
203bd78def81
Improved ClientProtocolUtils to extract min and max values for items with two new functions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
367
diff
changeset
|
845 XPathConstants.STRING, |
203bd78def81
Improved ClientProtocolUtils to extract min and max values for items with two new functions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
367
diff
changeset
|
846 ArtifactNamespaceContext.INSTANCE); |
203bd78def81
Improved ClientProtocolUtils to extract min and max values for items with two new functions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
367
diff
changeset
|
847 } |
203bd78def81
Improved ClientProtocolUtils to extract min and max values for items with two new functions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
367
diff
changeset
|
848 |
203bd78def81
Improved ClientProtocolUtils to extract min and max values for items with two new functions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
367
diff
changeset
|
849 |
203bd78def81
Improved ClientProtocolUtils to extract min and max values for items with two new functions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
367
diff
changeset
|
850 public static String getMaxNode(Node parent) { |
203bd78def81
Improved ClientProtocolUtils to extract min and max values for items with two new functions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
367
diff
changeset
|
851 return (String) XMLUtils.xpath( |
203bd78def81
Improved ClientProtocolUtils to extract min and max values for items with two new functions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
367
diff
changeset
|
852 parent, |
203bd78def81
Improved ClientProtocolUtils to extract min and max values for items with two new functions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
367
diff
changeset
|
853 XPATH_MAX_NODE, |
203bd78def81
Improved ClientProtocolUtils to extract min and max values for items with two new functions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
367
diff
changeset
|
854 XPathConstants.STRING, |
203bd78def81
Improved ClientProtocolUtils to extract min and max values for items with two new functions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
367
diff
changeset
|
855 ArtifactNamespaceContext.INSTANCE); |
203bd78def81
Improved ClientProtocolUtils to extract min and max values for items with two new functions.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
367
diff
changeset
|
856 } |
371
831d317547eb
Added methods to extract the default value for a min and max item.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
370
diff
changeset
|
857 |
831d317547eb
Added methods to extract the default value for a min and max item.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
370
diff
changeset
|
858 |
831d317547eb
Added methods to extract the default value for a min and max item.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
370
diff
changeset
|
859 public static String getDefMin(Node parent) { |
831d317547eb
Added methods to extract the default value for a min and max item.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
370
diff
changeset
|
860 return (String) XMLUtils.xpath( |
831d317547eb
Added methods to extract the default value for a min and max item.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
370
diff
changeset
|
861 parent, |
831d317547eb
Added methods to extract the default value for a min and max item.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
370
diff
changeset
|
862 XPATH_DEF_MIN, |
831d317547eb
Added methods to extract the default value for a min and max item.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
370
diff
changeset
|
863 XPathConstants.STRING, |
831d317547eb
Added methods to extract the default value for a min and max item.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
370
diff
changeset
|
864 ArtifactNamespaceContext.INSTANCE); |
831d317547eb
Added methods to extract the default value for a min and max item.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
370
diff
changeset
|
865 } |
831d317547eb
Added methods to extract the default value for a min and max item.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
370
diff
changeset
|
866 |
831d317547eb
Added methods to extract the default value for a min and max item.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
370
diff
changeset
|
867 |
831d317547eb
Added methods to extract the default value for a min and max item.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
370
diff
changeset
|
868 public static String getDefMax(Node parent) { |
831d317547eb
Added methods to extract the default value for a min and max item.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
370
diff
changeset
|
869 return (String) XMLUtils.xpath( |
831d317547eb
Added methods to extract the default value for a min and max item.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
370
diff
changeset
|
870 parent, |
831d317547eb
Added methods to extract the default value for a min and max item.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
370
diff
changeset
|
871 XPATH_DEF_MAX, |
831d317547eb
Added methods to extract the default value for a min and max item.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
370
diff
changeset
|
872 XPathConstants.STRING, |
831d317547eb
Added methods to extract the default value for a min and max item.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
370
diff
changeset
|
873 ArtifactNamespaceContext.INSTANCE); |
831d317547eb
Added methods to extract the default value for a min and max item.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
370
diff
changeset
|
874 } |
113
0344a20f8a93
Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
875 } |
0344a20f8a93
Added the ArtifactNamespaceContext and a ClientProtocolUtils that helps working with the artifact protocol.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
876 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |