Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/AnnotationArtifact.java @ 5828:dfb26b03b179
Moved directories to org.dive4elements.river
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 25 Apr 2013 11:53:11 +0200 |
parents | a2735a4bf75e |
children |
rev | line source |
---|---|
1026
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts; |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
2 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
3 import java.util.ArrayList; |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
4 import java.util.List; |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
5 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
6 import org.w3c.dom.Document; |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
7 import org.w3c.dom.Element; |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
8 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
9 import org.apache.log4j.Logger; |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
10 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
11 import de.intevation.artifacts.Artifact; |
4015
7f8d92873d58
Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4010
diff
changeset
|
12 import de.intevation.artifacts.ArtifactFactory; |
1026
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
13 import de.intevation.artifacts.ArtifactNamespaceContext; |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
14 import de.intevation.artifacts.CallContext; |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
15 import de.intevation.artifacts.CallMeta; |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
16 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
17 import de.intevation.artifactdatabase.ProtocolUtils; |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
18 import de.intevation.artifactdatabase.state.Facet; |
4209
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
19 import de.intevation.artifactdatabase.state.FacetActivity; |
1026
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
20 import de.intevation.artifactdatabase.state.Output; |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
21 import de.intevation.artifactdatabase.state.State; |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
22 import de.intevation.artifactdatabase.state.StateEngine; |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
23 |
4209
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
24 import de.intevation.flys.artifacts.model.FacetTypes; |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
25 |
1026
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
26 import de.intevation.artifacts.common.utils.XMLUtils; |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
27 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
28 import de.intevation.flys.artifacts.states.DefaultState; |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
29 import de.intevation.flys.artifacts.context.FLYSContext; |
1055
61c051e53f9b
Moved WINFO specific stuff from FLYS into WINFO artifact.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1050
diff
changeset
|
30 |
1099
af73f196eccc
Refactored to use new FLYSUtils, moved getRiver-functionality inside.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1077
diff
changeset
|
31 import de.intevation.flys.utils.FLYSUtils; |
1026
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
32 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
33 /** |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
34 * Artifact to access names of Points Of Interest along a segment of a river. |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
35 */ |
4209
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
36 public class AnnotationArtifact |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
37 extends StaticFLYSArtifact |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
38 implements FacetTypes { |
1026
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
39 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
40 /** The logger for this class. */ |
1675
19d0eb41e923
AnnotationArtifact: Bugfixes and enabled cache support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1631
diff
changeset
|
41 private static Logger logger = Logger.getLogger(AnnotationArtifact.class); |
1026
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
42 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
43 /** The name of the artifact. */ |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
44 public static final String ARTIFACT_NAME = "annotation"; |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
45 |
4209
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
46 // Let Annotations enter life inactively if in Fix Analysis LS setting. |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
47 static { |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
48 FacetActivity.Registry.getInstance().register( |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
49 "annotation", |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
50 new FacetActivity() { |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
51 @Override |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
52 public Boolean isInitialActive( |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
53 Artifact artifact, |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
54 Facet facet, |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
55 String output |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
56 ) { |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
57 if (output.contains(FacetTypes.ChartType.FLSC.toString())) { |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
58 // Longitudinal section chart |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
59 String name = facet.getName(); |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
60 |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
61 if (name.contains(FacetTypes.LONGITUDINAL_ANNOTATION)) { |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
62 return Boolean.FALSE; |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
63 } |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
64 } |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
65 |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
66 return Boolean.TRUE; |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
67 } |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
68 }); |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
69 } |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
70 |
7d0fb0109c01
Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4049
diff
changeset
|
71 |
4015
7f8d92873d58
Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4010
diff
changeset
|
72 @Override |
7f8d92873d58
Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4010
diff
changeset
|
73 public void setup( |
7f8d92873d58
Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4010
diff
changeset
|
74 String identifier, |
7f8d92873d58
Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4010
diff
changeset
|
75 ArtifactFactory factory, |
7f8d92873d58
Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4010
diff
changeset
|
76 Object context, |
7f8d92873d58
Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4010
diff
changeset
|
77 CallMeta callMeta, |
7f8d92873d58
Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4010
diff
changeset
|
78 Document data) |
7f8d92873d58
Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4010
diff
changeset
|
79 { |
7f8d92873d58
Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4010
diff
changeset
|
80 logger.debug("AnnotationArtifact.setup"); |
7f8d92873d58
Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4010
diff
changeset
|
81 String filter = StaticFLYSArtifact.getDatacageIDValue(data); |
7f8d92873d58
Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4010
diff
changeset
|
82 String[] splits = filter.split(":"); |
7f8d92873d58
Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4010
diff
changeset
|
83 if (splits.length > 1) { |
7f8d92873d58
Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4010
diff
changeset
|
84 addStringData("nameFilter", splits[1]); |
7f8d92873d58
Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4010
diff
changeset
|
85 } |
7f8d92873d58
Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4010
diff
changeset
|
86 super.setup(identifier, factory, context, callMeta, data); |
7f8d92873d58
Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4010
diff
changeset
|
87 } |
7f8d92873d58
Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4010
diff
changeset
|
88 |
4210
e47559908acc
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4209
diff
changeset
|
89 |
2112
2d0b22602fc2
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1777
diff
changeset
|
90 /** Get river, setup Facets. */ |
1026
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
91 @Override |
1077
3067e700fc13
Minor cosmetics and docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1070
diff
changeset
|
92 protected void initialize(Artifact artifact, Object context, |
3067e700fc13
Minor cosmetics and docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1070
diff
changeset
|
93 CallMeta meta) { |
3067e700fc13
Minor cosmetics and docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1070
diff
changeset
|
94 logger.debug("AnnotationArtifact.initialize, id: " |
2112
2d0b22602fc2
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1777
diff
changeset
|
95 + artifact.identifier()); |
1026
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
96 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
97 FLYSArtifact flys = (FLYSArtifact) artifact; |
4010
efb067ab2ca4
Added TODOs for issue880.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3555
diff
changeset
|
98 // TODO issue880: make annotations available _per type_ |
2112
2d0b22602fc2
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1777
diff
changeset
|
99 importData(flys, "river"); |
1026
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
100 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
101 List<Facet> fs = new ArrayList<Facet>(); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
102 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
103 // TODO Add CallMeta (duplicate TODO in RiverAxisArtifact.java). |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
104 DefaultState state = (DefaultState) getCurrentState(context); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
105 state.computeInit(this, hash(), context, meta, fs); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
106 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
107 if (!fs.isEmpty()) { |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
108 logger.debug("Facets to add in AnnotationsArtifact.initialize ."); |
4497
a2735a4bf75e
Change facets member variable to private
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4210
diff
changeset
|
109 addFacets(getCurrentStateId(), fs); |
1026
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
110 } |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
111 else { |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
112 logger.debug("No facets to add in AnnotationsArtifact.initialize ."); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
113 } |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
114 } |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
115 |
4210
e47559908acc
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4209
diff
changeset
|
116 |
e47559908acc
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4209
diff
changeset
|
117 /** Shortcut to nameFilter-data (TODO: move to respective Access). */ |
4015
7f8d92873d58
Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4010
diff
changeset
|
118 public String getFilterName() { |
7f8d92873d58
Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4010
diff
changeset
|
119 return getDataAsString("nameFilter"); |
7f8d92873d58
Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4010
diff
changeset
|
120 } |
7f8d92873d58
Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4010
diff
changeset
|
121 |
1026
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
122 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
123 public double[] getDistance() { |
1032
abd2ab6dff4f
Let AnnotationArtifact fetch "more correct" data.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1026
diff
changeset
|
124 /** TODO In initialize(), access maximal range of river (via |
3076
5642a83420f2
FLYS artifacts: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2144
diff
changeset
|
125 * AnnotationFactory) instead of overriding getDistance, |
1032
abd2ab6dff4f
Let AnnotationArtifact fetch "more correct" data.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1026
diff
changeset
|
126 * important for diagram generation. */ |
1026
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
127 return new double[] {0f, 1000f}; |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
128 } |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
129 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
130 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
131 /** |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
132 * Create the description of this AnnotationArtifact-instance. |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
133 * |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
134 * @param data Some data. |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
135 * @param context The CallContext. |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
136 * |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
137 * @return the description of this artifact. |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
138 */ |
1070
b1ed0ec0236f
Smaller Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1055
diff
changeset
|
139 @Override |
1026
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
140 public Document describe(Document data, CallContext context) { |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
141 logger.debug("Describe: the current state is: " + getCurrentStateId()); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
142 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
143 if (logger.isDebugEnabled()) { |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
144 dumpArtifact(); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
145 } |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
146 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
147 Document description = XMLUtils.newDocument(); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
148 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
149 description, |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
150 ArtifactNamespaceContext.NAMESPACE_URI, |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
151 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
152 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
153 Element root = ProtocolUtils.createRootNode(creator); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
154 description.appendChild(root); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
155 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
156 State current = getCurrentState(context); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
157 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
158 ProtocolUtils.appendDescribeHeader(creator, root, identifier(), hash()); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
159 ProtocolUtils.appendState(creator, root, current); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
160 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
161 Element name = ProtocolUtils.createArtNode( |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
162 creator, "name", |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
163 new String[] { "value" }, |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
164 new String[] { getName() }); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
165 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
166 Element outs = ProtocolUtils.createArtNode( |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
167 creator, "outputmodes", null, null); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
168 appendOutputModes(description, outs, context); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
169 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
170 root.appendChild(name); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
171 root.appendChild(outs); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
172 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
173 return description; |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
174 } |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
175 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
176 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
177 /** |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
178 * Returns the name of the concrete artifact. |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
179 * |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
180 * @return the name of the concrete artifact. |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
181 */ |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
182 public String getName() { |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
183 return ARTIFACT_NAME; |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
184 } |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
185 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
186 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
187 /** |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
188 * Append outputmode elements to given document. |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
189 * |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
190 * @param doc Document to add outputmodes to. |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
191 * @param outs Element to add outputmode elements to. |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
192 * @param context The given CallContext (mostly for internationalization). |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
193 */ |
1070
b1ed0ec0236f
Smaller Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1055
diff
changeset
|
194 //@Override |
1026
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
195 protected void appendOutputModes( |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
196 Document doc, |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
197 Element outs, |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
198 CallContext context) |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
199 { |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
200 List<String> stateIds = getPreviousStateIds(); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
201 |
1777
a8aa343799a2
Extracet getFlysContext from FLYSArtifact to FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1771
diff
changeset
|
202 FLYSContext flysContext = FLYSUtils.getFlysContext(context); |
1026
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
203 StateEngine engine = (StateEngine) flysContext.get( |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
204 FLYSContext.STATE_ENGINE_KEY); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
205 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
206 for (String stateId: stateIds) { |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
207 logger.debug("Append output modes for state: " + stateId); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
208 DefaultState state = (DefaultState) engine.getState(stateId); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
209 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
210 List<Output> list = state.getOutputs(); |
3555
b1912514e0f5
s/container.size() == 0/container.isEmpty()/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
211 if (list == null || list.isEmpty()) { |
1026
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
212 logger.debug("-> No output modes for this state."); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
213 continue; |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
214 } |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
215 |
4497
a2735a4bf75e
Change facets member variable to private
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4210
diff
changeset
|
216 List<Facet> fs = getFacets(stateId); |
3555
b1912514e0f5
s/container.size() == 0/container.isEmpty()/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
217 if (fs == null || fs.isEmpty()) { |
1026
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
218 logger.debug("No facets found."); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
219 continue; |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
220 } |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
221 |
1771
c62ff9e72cea
Restore mapping of state id to facets (revert, rev 3083 and 3088).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1765
diff
changeset
|
222 logger.debug("Found " + fs.size() + " facets in previous states."); |
1026
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
223 |
1771
c62ff9e72cea
Restore mapping of state id to facets (revert, rev 3083 and 3088).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1765
diff
changeset
|
224 List<Output> generated = generateOutputs(list, fs); |
1026
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
225 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
226 ProtocolUtils.appendOutputModes(doc, outs, generated); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
227 } |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
228 |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
229 try { |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
230 DefaultState cur = (DefaultState) getCurrentState(context); |
1050
eccf966fb677
State engine: Removed CallContext from state validation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1033
diff
changeset
|
231 if (cur.validate(this)) { |
1026
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
232 List<Output> list = cur.getOutputs(); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
233 if (list != null && list.size() > 0) { |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
234 logger.debug( |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
235 "Append output modes for state: " + cur.getID()); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
236 |
4497
a2735a4bf75e
Change facets member variable to private
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4210
diff
changeset
|
237 List<Facet> fs = getFacets(cur.getID()); |
1771
c62ff9e72cea
Restore mapping of state id to facets (revert, rev 3083 and 3088).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1765
diff
changeset
|
238 if (fs != null && fs.size() > 0) { |
c62ff9e72cea
Restore mapping of state id to facets (revert, rev 3083 and 3088).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1765
diff
changeset
|
239 List<Output> generated = generateOutputs(list, fs); |
1026
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
240 |
1771
c62ff9e72cea
Restore mapping of state id to facets (revert, rev 3083 and 3088).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1765
diff
changeset
|
241 logger.debug("Found " + fs.size() + " current facets."); |
1026
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
242 if (!generated.isEmpty()) { |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
243 ProtocolUtils.appendOutputModes( |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
244 doc, outs, generated); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
245 } |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
246 else{ |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
247 logger.debug("Cannot append output to generated document."); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
248 } |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
249 } |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
250 else { |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
251 logger.debug("No facets found for the current state."); |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
252 } |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
253 } |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
254 } |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
255 } |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
256 catch (IllegalArgumentException iae) { |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
257 // state is not valid, so we do not append its outputs. |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
258 } |
3076
5642a83420f2
FLYS artifacts: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2144
diff
changeset
|
259 } |
1026
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
260 } |
a39511688679
Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
261 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |