Mercurial > dive4elements > framework
annotate artifact-database/src/main/java/org/dive4elements/artifactdatabase/state/Facet.java @ 514:0416d9fb3668
Added interface for static facet.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Wed, 30 Apr 2014 15:06:19 +0200 |
parents | 83ee2c6a53b6 |
children | 97dc9b8ae68a |
rev | line source |
---|---|
475
415df0fc4fa1
Fixed maven group ids
Sascha L. Teichmann <teichmann@intevation.de>
parents:
473
diff
changeset
|
1 package org.dive4elements.artifactdatabase.state; |
226
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 |
278
9ad188df72f2
Facets are serializable now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
277
diff
changeset
|
5 import java.io.Serializable; |
9ad188df72f2
Facets are serializable now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
277
diff
changeset
|
6 |
295
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
280
diff
changeset
|
7 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:
280
diff
changeset
|
8 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:
280
diff
changeset
|
9 |
475
415df0fc4fa1
Fixed maven group ids
Sascha L. Teichmann <teichmann@intevation.de>
parents:
473
diff
changeset
|
10 import org.dive4elements.artifacts.Artifact; |
415df0fc4fa1
Fixed maven group ids
Sascha L. Teichmann <teichmann@intevation.de>
parents:
473
diff
changeset
|
11 import org.dive4elements.artifacts.CallContext; |
280
7fbe674d758a
Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
278
diff
changeset
|
12 |
226
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 /** |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 * @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
|
16 */ |
278
9ad188df72f2
Facets are serializable now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
277
diff
changeset
|
17 public interface Facet extends Serializable { |
226
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 /** |
277
0a579b71496b
Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
20 * Returns the index of this facet. |
0a579b71496b
Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
21 * |
0a579b71496b
Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
22 * @return the index of this facet. |
0a579b71496b
Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
23 */ |
0a579b71496b
Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
24 int getIndex(); |
0a579b71496b
Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
25 |
0a579b71496b
Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
26 /** |
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 * Returns the name of this facet. |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 * |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 * @return the name of this facet. |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 */ |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 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
|
32 |
488
83ee2c6a53b6
Add boundToOut property to facet and default facet
Andre Heinecke <aheinecke@intevation.de>
parents:
475
diff
changeset
|
33 /** |
83ee2c6a53b6
Add boundToOut property to facet and default facet
Andre Heinecke <aheinecke@intevation.de>
parents:
475
diff
changeset
|
34 * Returns the name of the out this facet is bound to. |
83ee2c6a53b6
Add boundToOut property to facet and default facet
Andre Heinecke <aheinecke@intevation.de>
parents:
475
diff
changeset
|
35 * |
83ee2c6a53b6
Add boundToOut property to facet and default facet
Andre Heinecke <aheinecke@intevation.de>
parents:
475
diff
changeset
|
36 * @return the name of the out this facet is bound to. |
83ee2c6a53b6
Add boundToOut property to facet and default facet
Andre Heinecke <aheinecke@intevation.de>
parents:
475
diff
changeset
|
37 */ |
83ee2c6a53b6
Add boundToOut property to facet and default facet
Andre Heinecke <aheinecke@intevation.de>
parents:
475
diff
changeset
|
38 String getBoundToOut(); |
83ee2c6a53b6
Add boundToOut property to facet and default facet
Andre Heinecke <aheinecke@intevation.de>
parents:
475
diff
changeset
|
39 |
83ee2c6a53b6
Add boundToOut property to facet and default facet
Andre Heinecke <aheinecke@intevation.de>
parents:
475
diff
changeset
|
40 /** |
83ee2c6a53b6
Add boundToOut property to facet and default facet
Andre Heinecke <aheinecke@intevation.de>
parents:
475
diff
changeset
|
41 * Binds this facet to an out. |
83ee2c6a53b6
Add boundToOut property to facet and default facet
Andre Heinecke <aheinecke@intevation.de>
parents:
475
diff
changeset
|
42 */ |
83ee2c6a53b6
Add boundToOut property to facet and default facet
Andre Heinecke <aheinecke@intevation.de>
parents:
475
diff
changeset
|
43 void setBoundToOut(String value); |
226
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 /** |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 * Returns the description of this facet. |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 * |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 * @return the description of this facet. |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 */ |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 String getDescription(); |
280
7fbe674d758a
Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
278
diff
changeset
|
51 |
7fbe674d758a
Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
278
diff
changeset
|
52 |
7fbe674d758a
Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
278
diff
changeset
|
53 /** |
7fbe674d758a
Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
278
diff
changeset
|
54 * Returns the data this facet requires. |
7fbe674d758a
Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
278
diff
changeset
|
55 * |
7fbe674d758a
Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
278
diff
changeset
|
56 * @param artifact The owner artifact. |
7fbe674d758a
Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
278
diff
changeset
|
57 * @param context The CallContext. |
7fbe674d758a
Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
278
diff
changeset
|
58 * |
7fbe674d758a
Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
278
diff
changeset
|
59 * @return the data. |
7fbe674d758a
Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
278
diff
changeset
|
60 */ |
7fbe674d758a
Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
278
diff
changeset
|
61 Object getData(Artifact artifact, CallContext context); |
295
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
280
diff
changeset
|
62 |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
280
diff
changeset
|
63 |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
280
diff
changeset
|
64 /** |
351
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
65 * Get keys for which this Facet can provide data (for other facets, not |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
66 * for plot). |
357
1d11a0531242
Added artifact parameter to facets getDataProviderKeys.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
351
diff
changeset
|
67 * @param artifact 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
|
68 * @return list of keys |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
69 */ |
378
71ff234713a6
Pass context when asking facets for keys to write on blackboard.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
357
diff
changeset
|
70 List getDataProviderKeys(Artifact artifact, CallContext context); |
351
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
71 |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
72 |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
73 /** |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
74 * Provide data to other facet. |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
75 * |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
76 * @param art The artifact that this facet belongs to. |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
77 * @param key the key of the requested service. |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
78 * @param prm optional parameters. |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
79 * @param ctxt the callcontext. |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
80 * |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
81 * @return the data |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
82 */ |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
83 Object provideBlackboardData( |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
84 Artifact art, |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
85 Object key, |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
86 Object prm, |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
87 CallContext ctxt); |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
88 |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
89 |
eb1136134d09
Prepare inter-facet pre-rendering communication ('blackboard') phase.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
322
diff
changeset
|
90 /** |
295
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
280
diff
changeset
|
91 * Write the internal representation of a facet to a node. |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
280
diff
changeset
|
92 * |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
280
diff
changeset
|
93 * @param doc A Document. |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
280
diff
changeset
|
94 * |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
280
diff
changeset
|
95 * @return the representation as Node. |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
280
diff
changeset
|
96 */ |
e5bc48dc3ec3
Facets can write its internal representation to XML using a toXML() method now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
280
diff
changeset
|
97 Node toXML(Document doc); |
322
93a774fe2bb4
Added deepCopy() method to facets and state data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
295
diff
changeset
|
98 |
93a774fe2bb4
Added deepCopy() method to facets and state data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
295
diff
changeset
|
99 Facet deepCopy(); |
226
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 } |
41404961c804
Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |