Mercurial > dive4elements > framework
annotate artifact-database/src/main/java/de/intevation/artifactdatabase/state/DefaultFacet.java @ 366:1f51f3c46efe
AbstractCallContext: Instance vars are now Maps instead of Hashmaps.
artifacts/trunk@3647 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 11 Jan 2012 10:58:34 +0000 |
parents | 1d11a0531242 |
children | 6431b7efe240 |
rev | line source |
---|---|
226
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.artifactdatabase.state; |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
351
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
3 import java.util.List; |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
4 |
295
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
5 import org.w3c.dom.Document; |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
6 import org.w3c.dom.Element; |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
7 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:
283
diff
changeset
|
8 |
280
7fbe674d758a
Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
277
diff
changeset
|
9 import de.intevation.artifacts.Artifact; |
295
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
10 import de.intevation.artifacts.ArtifactNamespaceContext; |
280
7fbe674d758a
Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
277
diff
changeset
|
11 import de.intevation.artifacts.CallContext; |
7fbe674d758a
Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
277
diff
changeset
|
12 |
295
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
13 import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator; |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
14 |
226
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 /** |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 * The default implementation of a Facet. |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 * |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 */ |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 public class DefaultFacet implements Facet { |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 |
351
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
23 /** The index of this facet. */ |
277
0a579b71496b
Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
24 protected int index; |
0a579b71496b
Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
25 |
351
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
26 /** The name of this facet. */ |
226
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 protected String name; |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 |
351
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
29 /** The description of this facet. */ |
226
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 protected String description; |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 |
351
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
32 |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
33 /** Trivial, empty constructor. */ |
322
93a774fe2bb4
Added deepCopy() method to facets and state data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
295
diff
changeset
|
34 public DefaultFacet() { |
93a774fe2bb4
Added deepCopy() method to facets and state data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
295
diff
changeset
|
35 } |
226
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 |
351
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
37 |
226
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 /** |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 * The default constructor to create new Facet objects. |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 * |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 * @param name The name of this new facet. |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 * @param description The description of this new facet. |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 */ |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 public DefaultFacet(String name, String description) { |
277
0a579b71496b
Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
45 this(0, name, description); |
0a579b71496b
Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
46 } |
0a579b71496b
Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
47 |
0a579b71496b
Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
48 |
0a579b71496b
Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
49 /** |
0a579b71496b
Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
50 * The default constructor to create new Facet objects. |
0a579b71496b
Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
51 * |
0a579b71496b
Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
52 * @param index The index of this new facet. |
0a579b71496b
Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
53 * @param name The name of this new facet. |
0a579b71496b
Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
54 * @param description The description of this new facet. |
0a579b71496b
Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
55 */ |
0a579b71496b
Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
56 public DefaultFacet(int index, String name, String description) { |
0a579b71496b
Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
57 this.index = index; |
226
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 this.name = name; |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 this.description = description; |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 } |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 |
351
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
62 |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
63 /** |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
64 * Copies name, index and description of other facet. |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
65 */ |
322
93a774fe2bb4
Added deepCopy() method to facets and state data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
295
diff
changeset
|
66 public void set(Facet other) { |
93a774fe2bb4
Added deepCopy() method to facets and state data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
295
diff
changeset
|
67 index = other.getIndex(); |
93a774fe2bb4
Added deepCopy() method to facets and state data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
295
diff
changeset
|
68 name = other.getName(); |
93a774fe2bb4
Added deepCopy() method to facets and state data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
295
diff
changeset
|
69 description = other.getDescription(); |
93a774fe2bb4
Added deepCopy() method to facets and state data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
295
diff
changeset
|
70 } |
93a774fe2bb4
Added deepCopy() method to facets and state data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
295
diff
changeset
|
71 |
351
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
72 |
322
93a774fe2bb4
Added deepCopy() method to facets and state data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
295
diff
changeset
|
73 public Facet deepCopy() { |
93a774fe2bb4
Added deepCopy() method to facets and state data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
295
diff
changeset
|
74 DefaultFacet copy = new DefaultFacet(); |
93a774fe2bb4
Added deepCopy() method to facets and state data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
295
diff
changeset
|
75 copy.set(this); |
93a774fe2bb4
Added deepCopy() method to facets and state data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
295
diff
changeset
|
76 return copy; |
93a774fe2bb4
Added deepCopy() method to facets and state data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
295
diff
changeset
|
77 } |
93a774fe2bb4
Added deepCopy() method to facets and state data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
295
diff
changeset
|
78 |
226
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 |
277
0a579b71496b
Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
80 public int getIndex() { |
0a579b71496b
Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
81 return index; |
0a579b71496b
Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
82 } |
0a579b71496b
Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
83 |
0a579b71496b
Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
84 |
226
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 public String getName() { |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 return name; |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 } |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 public String getDescription() { |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 return description; |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 } |
280
7fbe674d758a
Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
277
diff
changeset
|
93 |
7fbe674d758a
Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
277
diff
changeset
|
94 |
351
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
95 /** |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
96 * @return null |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
97 */ |
280
7fbe674d758a
Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
277
diff
changeset
|
98 public Object getData(Artifact artifact, CallContext context) { |
7fbe674d758a
Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
277
diff
changeset
|
99 return null; |
7fbe674d758a
Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
277
diff
changeset
|
100 } |
283
7c33cac15134
Added DefaultFacet.toString() method to help debugging.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
280
diff
changeset
|
101 |
351
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
102 |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
103 /** |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
104 * (Do not) provide data. |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
105 * Override to allow other facets to access your data. |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
106 * @return always null. |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
107 */ |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
108 public Object provideBlackboardData( |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
109 Artifact artifact, |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
110 Object key, |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
111 Object param, |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
112 CallContext context |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
113 ) { |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
114 return null; |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
115 } |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
116 |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
117 |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
118 /** |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
119 * Return list of keys (objects) for which this facet can provide data |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
120 * ("external parameterization"), for other facets, via blackboard. |
357
1d11a0531242
Added artifact parameter to facets getDataProviderKeys.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
351
diff
changeset
|
121 * @param artifact that this facet belongs to. |
351
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
122 */ |
357
1d11a0531242
Added artifact parameter to facets getDataProviderKeys.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
351
diff
changeset
|
123 public List getDataProviderKeys(Artifact artifact) { |
351
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
124 return null; |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
125 } |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
126 |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
127 |
283
7c33cac15134
Added DefaultFacet.toString() method to help debugging.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
280
diff
changeset
|
128 public String toString() { |
7c33cac15134
Added DefaultFacet.toString() method to help debugging.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
280
diff
changeset
|
129 return new StringBuilder("name = '") |
7c33cac15134
Added DefaultFacet.toString() method to help debugging.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
280
diff
changeset
|
130 .append(name).append("', index = ") |
7c33cac15134
Added DefaultFacet.toString() method to help debugging.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
280
diff
changeset
|
131 .append(index).append(", description = '") |
7c33cac15134
Added DefaultFacet.toString() method to help debugging.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
280
diff
changeset
|
132 .append(description).append("'") |
7c33cac15134
Added DefaultFacet.toString() method to help debugging.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
280
diff
changeset
|
133 .toString(); |
7c33cac15134
Added DefaultFacet.toString() method to help debugging.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
280
diff
changeset
|
134 } |
295
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
135 |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
136 |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
137 public Node toXML(Document doc) { |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
138 ElementCreator ec = new ElementCreator( |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
139 doc, |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
140 ArtifactNamespaceContext.NAMESPACE_URI, |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
141 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
142 |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
143 Element facet = ec.create("facet"); |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
144 ec.addAttr(facet, "description", description, true); |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
145 ec.addAttr(facet, "name", name, true); |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
146 ec.addAttr(facet, "index", String.valueOf(index), true); |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
147 |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
148 return facet; |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
283
diff
changeset
|
149 } |
226
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
150 } |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
151 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |