Mercurial > dive4elements > framework
annotate artifact-database/src/main/java/de/intevation/artifactdatabase/ProtocolUtils.java @ 330:3168af23aec5
Added a CallContext.isInBackground() method to determine if an Artifact or a Collection has started a background thread and is currently locked.
artifacts/trunk@2666 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 07 Sep 2011 13:51:02 +0000 |
parents | e5bc48dc3ec3 |
children | f367be55dd35 |
rev | line source |
---|---|
107
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 /* |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 * Copyright (c) 2011 by Intevation GmbH |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 * |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 * This program is free software under the LGPL (>=v2.1) |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 * Read the file LGPL.txt coming with the software for details |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 * or visit http://www.gnu.org/licenses/ if it does not exist. |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 */ |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 package de.intevation.artifactdatabase; |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 |
109
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
10 import java.util.List; |
107
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 |
295
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
290
diff
changeset
|
12 import org.w3c.dom.Document; |
107
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 import org.w3c.dom.Element; |
295
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
290
diff
changeset
|
14 import org.w3c.dom.Node; |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
290
diff
changeset
|
15 |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
290
diff
changeset
|
16 import de.intevation.artifacts.ArtifactNamespaceContext; |
107
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 import de.intevation.artifacts.common.utils.XMLUtils; |
295
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
290
diff
changeset
|
19 import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator; |
107
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 |
227
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
21 import de.intevation.artifactdatabase.state.Facet; |
211
435631e07da2
Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
109
diff
changeset
|
22 import de.intevation.artifactdatabase.state.Output; |
109
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
23 import de.intevation.artifactdatabase.state.State; |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
24 |
107
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 /** |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 * This class provides methods that help creating the artifact protocol |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 * documents describe, feed, advance and out. |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 * |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 */ |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 public class ProtocolUtils { |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 /** |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 * It should not be necessary to create instances of this class. |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 */ |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 private ProtocolUtils() {} |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 /** |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 * This method creates a node that might be used for the artifact protocol. |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 * |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 * @param creator The ElementCreator that is used to create the node. |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 * @param nodeName The node name. |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 * @param attrName The names of optional attributes. |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 * @param value The values for the optional attributes. |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 * |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 * @return the created node. |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 */ |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 public static Element createArtNode( |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 XMLUtils.ElementCreator creator, |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 String nodeName, String[] attrName, String[] value) |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 { |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 Element typeNode = creator.create(nodeName); |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 if (attrName != null && value != null) { |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 for (int i = 0; i < attrName.length; i++) { |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 if (i < value.length) { |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 creator.addAttr(typeNode, attrName[i], value[i], true); |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 } |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 else { |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 break; |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 } |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 } |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 } |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 return typeNode; |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 } |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 /** |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 * This method creates the root node for all artifact protocol documents. |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 * |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 * @param creator The ElementCreator used to create new elements. |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 * |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 * @return the root node for the artifact protocol document. |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 */ |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 public static Element createRootNode(XMLUtils.ElementCreator creator) { |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 return createArtNode(creator, "result", null, null); |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 } |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 /** |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 * This method appends the three necessary nodes <i>type</i>, <i>uuid</i> |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 * and <i>hash</i> of the describe document to <i>root</i> node. |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 * |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 * @param creator The ElementCreator that is used to create new nodes. |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 * @param root The root node of the describe document. |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 * @param uuid The UUID of the artifact. |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 * @param hash The hash if the artifact. |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 */ |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 public static void appendDescribeHeader( |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 XMLUtils.ElementCreator creator, Element root, String uuid, String hash) |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 { |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 root.appendChild(createArtNode( |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 creator, |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 "type", |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 new String[] {"name"}, |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 new String[] {"describe"})); |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 root.appendChild(createArtNode( |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
102 creator, |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 "uuid", |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 new String[] {"value"}, |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 new String[] {uuid})); |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 root.appendChild(createArtNode( |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
108 creator, |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 "hash", |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 new String[] {"value"}, |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 new String[] {hash})); |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
112 } |
109
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
113 |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
114 |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
115 /** |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
116 * This method appends a node that describes the current state to |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
117 * <i>root</i>. |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
118 * |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
119 * @param creator The ElementCreator used to create new elements. |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
120 * @param root The parent node for new elements. |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
121 * @param state The state to be appended. |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
122 */ |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
123 public static void appendState( |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
124 XMLUtils.ElementCreator creator, Element root, State state) |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
125 { |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
126 root.appendChild(createArtNode( |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
127 creator, "state", |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
128 new String[] { "description", "name" }, |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
129 new String[] { state.getDescription(), state.getID() })); |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
130 } |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
131 |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
132 |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
133 /** |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
134 * This method appends a node with reachable states to <i>root</i>. |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
135 * |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
136 * @param creator The ElementCreator used to create new elements. |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
137 * @param root The parent node for new elements. |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
138 * @param states The reachable states to be appended. |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
139 */ |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
140 public static void appendReachableStates( |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
141 XMLUtils.ElementCreator creator, |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
142 Element root, |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
143 List<State> states) |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
144 { |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
145 Element reachable = createArtNode( |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
146 creator, "reachable-states", null, null); |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
147 |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
148 for (State s: states) { |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
149 appendState(creator, reachable, s); |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
150 } |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
151 |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
152 root.appendChild(reachable); |
ab646e0f5569
Improved the ProtocolUtils - there are new functions to append a current state and the reachable states to a root node.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
107
diff
changeset
|
153 } |
211
435631e07da2
Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
109
diff
changeset
|
154 |
435631e07da2
Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
109
diff
changeset
|
155 |
227
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
156 /** |
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
157 * This method appends a node for each Output in the <i>outputs</i> list to |
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
158 * <i>out</i>. Note: an output node includes its provided facets! |
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
159 * |
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
160 * @param creator The ElementCreator used to create new elements. |
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
161 * @param out The parent node for new elements. |
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
162 * @param outputs The list of reachable outputs. |
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
163 */ |
211
435631e07da2
Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
109
diff
changeset
|
164 public static void appendOutputModes( |
295
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
290
diff
changeset
|
165 Document doc, |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
290
diff
changeset
|
166 Element out, |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
290
diff
changeset
|
167 List<Output> outputs) |
211
435631e07da2
Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
109
diff
changeset
|
168 { |
295
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
290
diff
changeset
|
169 ElementCreator creator = new ElementCreator( |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
290
diff
changeset
|
170 doc, |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
290
diff
changeset
|
171 ArtifactNamespaceContext.NAMESPACE_URI, |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
290
diff
changeset
|
172 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
290
diff
changeset
|
173 |
211
435631e07da2
Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
109
diff
changeset
|
174 for (Output o: outputs) { |
227
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
175 Element newOut = createArtNode( |
211
435631e07da2
Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
109
diff
changeset
|
176 creator, |
435631e07da2
Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
109
diff
changeset
|
177 "output", |
290
995fa6994480
Outputs can have a member variable 'type' that should make it easier to distinguish the type of an Output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
279
diff
changeset
|
178 new String[] {"name", "description", "mime-type", "type"}, |
995fa6994480
Outputs can have a member variable 'type' that should make it easier to distinguish the type of an Output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
279
diff
changeset
|
179 new String[] { |
995fa6994480
Outputs can have a member variable 'type' that should make it easier to distinguish the type of an Output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
279
diff
changeset
|
180 o.getName(), |
995fa6994480
Outputs can have a member variable 'type' that should make it easier to distinguish the type of an Output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
279
diff
changeset
|
181 o.getDescription(), |
995fa6994480
Outputs can have a member variable 'type' that should make it easier to distinguish the type of an Output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
279
diff
changeset
|
182 o.getMimeType(), |
995fa6994480
Outputs can have a member variable 'type' that should make it easier to distinguish the type of an Output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
279
diff
changeset
|
183 o.getType() }); |
227
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
184 |
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
185 Element facets = createArtNode(creator, "facets", null, null); |
295
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
290
diff
changeset
|
186 appendFacets(doc, facets, o.getFacets()); |
227
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
187 |
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
188 newOut.appendChild(facets); |
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
189 out.appendChild(newOut); |
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
190 } |
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
191 } |
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
192 |
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
193 |
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
194 /** |
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
195 * This method appends a node for each Facet in the <i>facets</i> list to |
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
196 * <i>facet</i>. |
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
197 * |
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
198 * @param creator The ElementCreator used to create new elements. |
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
199 * @param facet The root node for new elements. |
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
200 * @param facets The list of facets. |
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
201 */ |
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
202 public static void appendFacets( |
295
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
290
diff
changeset
|
203 Document doc, |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
290
diff
changeset
|
204 Element facet, |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
290
diff
changeset
|
205 List<Facet> facets) |
227
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
206 { |
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
207 if (facets == null || facets.size() == 0) { |
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
208 return; |
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
209 } |
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
210 |
295
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
290
diff
changeset
|
211 ElementCreator creator = new ElementCreator( |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
290
diff
changeset
|
212 doc, |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
290
diff
changeset
|
213 ArtifactNamespaceContext.NAMESPACE_URI, |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
290
diff
changeset
|
214 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
290
diff
changeset
|
215 |
227
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
216 for (Facet f: facets) { |
295
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
290
diff
changeset
|
217 Node node = f.toXML(doc); |
227
4bb6bfaca393
The output nodes written into the DESCRIBE document by ProtocolUtils have nodes for each facet supported by an output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
218 |
295
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
290
diff
changeset
|
219 if (node != null) { |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
290
diff
changeset
|
220 facet.appendChild(node); |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
290
diff
changeset
|
221 } |
211
435631e07da2
Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
109
diff
changeset
|
222 } |
435631e07da2
Enhanced the ProtocolUtils and ClientProtocolUtils to append and retrieve output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
109
diff
changeset
|
223 } |
107
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
224 } |
39d9391059bd
Added a ProtocolUtils class that provides functions that help creating the artifact protocol documents.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
225 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: |