annotate artifacts/src/main/java/org/dive4elements/river/artifacts/AnnotationArtifact.java @ 9801:1d7a72a50183 3.2.x tip

Assume Compose V2, consistently
author Tom Gottfried <tom@intevation.de>
date Thu, 23 Nov 2023 10:14:13 +0100
parents 0a5239a1e46e
children
rev   line source
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5867
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5867
diff changeset
6 * documentation coming with Dive4Elements River for details.
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
9 package org.dive4elements.river.artifacts;
1026
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 java.util.ArrayList;
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
12 import java.util.List;
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
13
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
14 import org.w3c.dom.Document;
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
15 import org.w3c.dom.Element;
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
16
9726
0a5239a1e46e Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 8856
diff changeset
17 import org.apache.logging.log4j.Logger;
0a5239a1e46e Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 8856
diff changeset
18 import org.apache.logging.log4j.LogManager;
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
19
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
20 import org.dive4elements.artifacts.Artifact;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
21 import org.dive4elements.artifacts.ArtifactFactory;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
22 import org.dive4elements.artifacts.ArtifactNamespaceContext;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
23 import org.dive4elements.artifacts.CallContext;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
24 import org.dive4elements.artifacts.CallMeta;
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
25
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
26 import org.dive4elements.artifactdatabase.ProtocolUtils;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
27 import org.dive4elements.artifactdatabase.state.Facet;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
28 import org.dive4elements.artifactdatabase.state.FacetActivity;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
29 import org.dive4elements.artifactdatabase.state.Output;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
30 import org.dive4elements.artifactdatabase.state.State;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
31 import org.dive4elements.artifactdatabase.state.StateEngine;
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
32
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
33 import org.dive4elements.river.artifacts.model.FacetTypes;
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
34
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
35 import org.dive4elements.artifacts.common.utils.XMLUtils;
1055
61c051e53f9b Moved WINFO specific stuff from FLYS into WINFO artifact.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1050
diff changeset
36
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
37 import org.dive4elements.river.artifacts.states.DefaultState;
5866
9a6741ccf6d4 FLYS artifacts: Renamed FLYSContext(Factory) to RiverContext(Factory).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5865
diff changeset
38 import org.dive4elements.river.artifacts.context.RiverContext;
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
39
5865
73da40528cf2 River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
40 import org.dive4elements.river.utils.RiverUtils;
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
41
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 * 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
44 */
4209
7d0fb0109c01 Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4049
diff changeset
45 public class AnnotationArtifact
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5866
diff changeset
46 extends StaticD4EArtifact
4209
7d0fb0109c01 Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4049
diff changeset
47 implements FacetTypes {
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
48
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
49 /** The log for this class. */
9726
0a5239a1e46e Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 8856
diff changeset
50 private static Logger log = LogManager.getLogger(AnnotationArtifact.class);
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
51
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
52 /** The name of the artifact. */
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
53 public static final String ARTIFACT_NAME = "annotation";
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
54
4209
7d0fb0109c01 Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4049
diff changeset
55 // 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
56 static {
7d0fb0109c01 Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4049
diff changeset
57 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
58 "annotation",
7d0fb0109c01 Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4049
diff changeset
59 new FacetActivity() {
7d0fb0109c01 Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4049
diff changeset
60 @Override
7d0fb0109c01 Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4049
diff changeset
61 public Boolean isInitialActive(
7d0fb0109c01 Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4049
diff changeset
62 Artifact artifact,
7d0fb0109c01 Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4049
diff changeset
63 Facet facet,
7d0fb0109c01 Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4049
diff changeset
64 String output
7d0fb0109c01 Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4049
diff changeset
65 ) {
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8333
diff changeset
66 if (output.contains(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8333
diff changeset
67 FacetTypes.ChartType.FLSC.toString())
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8333
diff changeset
68 ) {
4209
7d0fb0109c01 Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4049
diff changeset
69 // Longitudinal section chart
7d0fb0109c01 Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4049
diff changeset
70 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
71
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8333
diff changeset
72 if (name.contains(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8333
diff changeset
73 FacetTypes.LONGITUDINAL_ANNOTATION)
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8333
diff changeset
74 ) {
4209
7d0fb0109c01 Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4049
diff changeset
75 return Boolean.FALSE;
7d0fb0109c01 Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4049
diff changeset
76 }
7d0fb0109c01 Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4049
diff changeset
77 }
7d0fb0109c01 Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4049
diff changeset
78
7d0fb0109c01 Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4049
diff changeset
79 return Boolean.TRUE;
7d0fb0109c01 Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4049
diff changeset
80 }
7d0fb0109c01 Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4049
diff changeset
81 });
7d0fb0109c01 Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4049
diff changeset
82 }
7d0fb0109c01 Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4049
diff changeset
83
7d0fb0109c01 Let AnnotationFacets come to life inactively in FixAnalysis LS settings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4049
diff changeset
84
4015
7f8d92873d58 Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4010
diff changeset
85 @Override
7f8d92873d58 Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4010
diff changeset
86 public void setup(
7f8d92873d58 Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4010
diff changeset
87 String identifier,
7f8d92873d58 Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4010
diff changeset
88 ArtifactFactory factory,
7f8d92873d58 Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4010
diff changeset
89 Object context,
7f8d92873d58 Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4010
diff changeset
90 CallMeta callMeta,
7842
8d5ca5175038 Updated signature of artifacts setup method; Removed unnecessary setup overrides.
Raimund Renkert <rrenkert@intevation.de>
parents: 5994
diff changeset
91 Document data,
8d5ca5175038 Updated signature of artifacts setup method; Removed unnecessary setup overrides.
Raimund Renkert <rrenkert@intevation.de>
parents: 5994
diff changeset
92 List<Class> loadFacets)
4015
7f8d92873d58 Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4010
diff changeset
93 {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
94 log.debug("AnnotationArtifact.setup");
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5866
diff changeset
95 String filter = StaticD4EArtifact.getDatacageIDValue(data);
4015
7f8d92873d58 Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4010
diff changeset
96 String[] splits = filter.split(":");
7f8d92873d58 Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4010
diff changeset
97 if (splits.length > 1) {
7f8d92873d58 Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4010
diff changeset
98 addStringData("nameFilter", splits[1]);
7f8d92873d58 Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4010
diff changeset
99 }
7842
8d5ca5175038 Updated signature of artifacts setup method; Removed unnecessary setup overrides.
Raimund Renkert <rrenkert@intevation.de>
parents: 5994
diff changeset
100 super.setup(identifier, factory, context, callMeta, data, loadFacets);
4015
7f8d92873d58 Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4010
diff changeset
101 }
7f8d92873d58 Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4010
diff changeset
102
4210
e47559908acc Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4209
diff changeset
103
2112
2d0b22602fc2 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1777
diff changeset
104 /** Get river, setup Facets. */
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
105 @Override
1077
3067e700fc13 Minor cosmetics and docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1070
diff changeset
106 protected void initialize(Artifact artifact, Object context,
3067e700fc13 Minor cosmetics and docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1070
diff changeset
107 CallMeta meta) {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
108 log.debug("AnnotationArtifact.initialize, id: "
2112
2d0b22602fc2 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1777
diff changeset
109 + artifact.identifier());
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
110
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5866
diff changeset
111 D4EArtifact flys = (D4EArtifact) artifact;
2112
2d0b22602fc2 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1777
diff changeset
112 importData(flys, "river");
1026
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 List<Facet> fs = new ArrayList<Facet>();
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
115
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
116 DefaultState state = (DefaultState) getCurrentState(context);
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
117 state.computeInit(this, hash(), context, meta, fs);
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
118
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
119 if (!fs.isEmpty()) {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
120 log.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
121 addFacets(getCurrentStateId(), fs);
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 else {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
124 log.debug("No facets to add in AnnotationsArtifact.initialize .");
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
125 }
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
126 }
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
127
4210
e47559908acc Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4209
diff changeset
128
e47559908acc Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4209
diff changeset
129 /** 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
130 public String getFilterName() {
7f8d92873d58 Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4010
diff changeset
131 return getDataAsString("nameFilter");
7f8d92873d58 Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4010
diff changeset
132 }
7f8d92873d58 Handle annotationtypes in AnnotationArtifact and -Facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4010
diff changeset
133
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
134
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
135 public double[] getDistance() {
1032
abd2ab6dff4f Let AnnotationArtifact fetch "more correct" data.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1026
diff changeset
136 /** 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
137 * AnnotationFactory) instead of overriding getDistance,
1032
abd2ab6dff4f Let AnnotationArtifact fetch "more correct" data.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1026
diff changeset
138 * important for diagram generation. */
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
139 return new double[] {0f, 1000f};
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
140 }
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
141
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 /**
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
144 * Create the description of this AnnotationArtifact-instance.
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 * @param data Some data.
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
147 * @param context The CallContext.
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
148 *
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
149 * @return the description of this artifact.
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
150 */
1070
b1ed0ec0236f Smaller Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1055
diff changeset
151 @Override
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
152 public Document describe(Document data, CallContext context) {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
153 log.debug("Describe: the current state is: " + getCurrentStateId());
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
154
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
155 if (log.isDebugEnabled()) {
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
156 dumpArtifact();
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
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
159 Document description = XMLUtils.newDocument();
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
160 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator(
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
161 description,
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
162 ArtifactNamespaceContext.NAMESPACE_URI,
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
163 ArtifactNamespaceContext.NAMESPACE_PREFIX);
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
164
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
165 Element root = ProtocolUtils.createRootNode(creator);
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
166 description.appendChild(root);
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
167
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
168 State current = getCurrentState(context);
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
169
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8333
diff changeset
170 ProtocolUtils.appendDescribeHeader(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8333
diff changeset
171 creator, root, identifier(), hash());
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
172 ProtocolUtils.appendState(creator, root, current);
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
173
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
174 Element name = ProtocolUtils.createArtNode(
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
175 creator, "name",
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
176 new String[] { "value" },
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
177 new String[] { getName() });
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
178
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
179 Element outs = ProtocolUtils.createArtNode(
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
180 creator, "outputmodes", null, null);
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
181 appendOutputModes(description, outs, context);
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
182
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
183 root.appendChild(name);
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
184 root.appendChild(outs);
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 return description;
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
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 /**
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
191 * Returns the name of the concrete artifact.
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
192 *
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
193 * @return the name of the concrete artifact.
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
194 */
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
195 public String getName() {
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
196 return ARTIFACT_NAME;
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
197 }
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
198
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 /**
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
201 * Append outputmode elements to given document.
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
202 *
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
203 * @param doc Document to add outputmodes to.
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
204 * @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
205 * @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
206 */
1070
b1ed0ec0236f Smaller Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1055
diff changeset
207 //@Override
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
208 protected void appendOutputModes(
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
209 Document doc,
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
210 Element outs,
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
211 CallContext context)
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
212 {
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
213 List<String> stateIds = getPreviousStateIds();
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
214
5866
9a6741ccf6d4 FLYS artifacts: Renamed FLYSContext(Factory) to RiverContext(Factory).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5865
diff changeset
215 RiverContext flysContext = RiverUtils.getFlysContext(context);
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
216 StateEngine engine = (StateEngine) flysContext.get(
5866
9a6741ccf6d4 FLYS artifacts: Renamed FLYSContext(Factory) to RiverContext(Factory).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5865
diff changeset
217 RiverContext.STATE_ENGINE_KEY);
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
218
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
219 for (String stateId: stateIds) {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
220 log.debug("Append output modes for state: " + stateId);
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
221 DefaultState state = (DefaultState) engine.getState(stateId);
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
222
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
223 List<Output> list = state.getOutputs();
3555
b1912514e0f5 s/container.size() == 0/container.isEmpty()/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3076
diff changeset
224 if (list == null || list.isEmpty()) {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
225 log.debug("-> No output modes for this state.");
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
226 continue;
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
4497
a2735a4bf75e Change facets member variable to private
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4210
diff changeset
229 List<Facet> fs = getFacets(stateId);
3555
b1912514e0f5 s/container.size() == 0/container.isEmpty()/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3076
diff changeset
230 if (fs == null || fs.isEmpty()) {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
231 log.debug("No facets found.");
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
232 continue;
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
233 }
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
234
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
235 log.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
236
1771
c62ff9e72cea Restore mapping of state id to facets (revert, rev 3083 and 3088).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1765
diff changeset
237 List<Output> generated = generateOutputs(list, fs);
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
238
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
239 ProtocolUtils.appendOutputModes(doc, outs, generated);
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
240 }
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
241
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
242 try {
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
243 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
244 if (cur.validate(this)) {
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
245 List<Output> list = cur.getOutputs();
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
246 if (list != null && list.size() > 0) {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
247 log.debug(
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
248 "Append output modes for state: " + cur.getID());
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
249
4497
a2735a4bf75e Change facets member variable to private
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4210
diff changeset
250 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
251 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
252 List<Output> generated = generateOutputs(list, fs);
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
253
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
254 log.debug("Found " + fs.size() + " current facets.");
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
255 if (!generated.isEmpty()) {
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
256 ProtocolUtils.appendOutputModes(
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
257 doc, outs, generated);
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
258 }
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
259 else{
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8333
diff changeset
260 log.debug(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8333
diff changeset
261 "Cannot append output to generated document.");
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
262 }
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
263 }
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
264 else {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
265 log.debug("No facets found for the current state.");
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
266 }
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
267 }
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
268 }
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
269 }
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
270 catch (IllegalArgumentException iae) {
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
271 // 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
272 }
3076
5642a83420f2 FLYS artifacts: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2144
diff changeset
273 }
1026
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
274 }
a39511688679 Added initial version of AnnotationArtifact and friends.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
275 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org