Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/services/MainValuesService.java @ 9753:7227621f8496 3.2.x
Get rid of duplicate MapServer URL configurations
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Tue, 11 Oct 2022 14:02:20 +0200 |
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:
5868
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:
5868
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:
3734
diff
changeset
|
9 package org.dive4elements.river.artifacts.services; |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import java.util.List; |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 |
9726 | 13 import org.apache.logging.log4j.Logger; |
14 import org.apache.logging.log4j.LogManager; | |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 import org.w3c.dom.Document; |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 import org.w3c.dom.Element; |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3734
diff
changeset
|
19 import org.dive4elements.artifacts.CallMeta; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3734
diff
changeset
|
20 import org.dive4elements.artifacts.GlobalContext; |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3734
diff
changeset
|
22 import org.dive4elements.artifacts.common.ArtifactNamespaceContext; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3734
diff
changeset
|
23 import org.dive4elements.artifacts.common.utils.XMLUtils; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3734
diff
changeset
|
24 import org.dive4elements.artifacts.common.utils.XMLUtils.ElementCreator; |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3734
diff
changeset
|
26 import org.dive4elements.river.model.Gauge; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3734
diff
changeset
|
27 import org.dive4elements.river.model.MainValue; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3734
diff
changeset
|
28 import org.dive4elements.river.model.MainValueType; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3734
diff
changeset
|
29 import org.dive4elements.river.model.NamedMainValue; |
6356
4c791a458305
Artifacts: Scan the official lines associated with a main value if it applies for the current river.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6107
diff
changeset
|
30 import org.dive4elements.river.model.OfficialLine; |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3734
diff
changeset
|
31 import org.dive4elements.river.model.Range; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3734
diff
changeset
|
32 import org.dive4elements.river.model.River; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3734
diff
changeset
|
33 |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3734
diff
changeset
|
34 import org.dive4elements.river.artifacts.model.RiverFactory; |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 |
8755
30b1ddadf275
(issue1801) Unify reference gauge finding code
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8202
diff
changeset
|
36 import static org.dive4elements.river.backend.utils.EpsilonComparator.CMP; |
30b1ddadf275
(issue1801) Unify reference gauge finding code
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8202
diff
changeset
|
37 |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 /** |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 * This service returns the main values of a river's gauge based on the start |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 * and end point of the river. |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 * |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 */ |
5868
35b2d86c3fb5
River artifacts: Renamed FLYSService to D4EService.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
45 public class MainValuesService extends D4EService { |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7639
diff
changeset
|
47 /** The log that is used by this service.*/ |
9726 | 48 private static Logger log = LogManager.getLogger(MainValuesService.class); |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 |
8856 | 50 /** XPath that points to the river definition of the incoming request.*/ |
51 public static final String XPATH_RIVER = | |
52 "/art:mainvalues/art:river/text()"; | |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 |
8856 | 54 /** XPath that points to the start definition of the incoming request.*/ |
55 public static final String XPATH_START = | |
56 "/art:mainvalues/art:start/text()"; | |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 /** The XPath that points to the end definition of the incoming request.*/ |
444
932a5e3c7fa1
ISSUE-72 Repaired broken XPath expression in MainValuesService to extract start and end kilometer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
331
diff
changeset
|
59 public static final String XPATH_END = "/art:mainvalues/art:end/text()"; |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 |
7555
74e9768098a0
issue1542: Let MainValues have localized dates.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7553
diff
changeset
|
61 protected CallMeta callMeta; |
74e9768098a0
issue1542: Let MainValues have localized dates.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7553
diff
changeset
|
62 |
74e9768098a0
issue1542: Let MainValues have localized dates.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7553
diff
changeset
|
63 |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 /** |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 * The default constructor. |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 */ |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 public MainValuesService() { |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 } |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 |
3728
d03e65378b9f
Removed obsolete code. Removed NPE as regular flow control.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1659
diff
changeset
|
70 private static final Document error(String msg) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7639
diff
changeset
|
71 log.debug(msg); |
3728
d03e65378b9f
Removed obsolete code. Removed NPE as regular flow control.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1659
diff
changeset
|
72 return XMLUtils.newDocument(); |
d03e65378b9f
Removed obsolete code. Removed NPE as regular flow control.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1659
diff
changeset
|
73 } |
d03e65378b9f
Removed obsolete code. Removed NPE as regular flow control.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1659
diff
changeset
|
74 |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 |
966
a63d79107289
Adjusted services to implement changed signature.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
76 @Override |
1631
26e19cdaed5e
Improved database session handling in services and artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
966
diff
changeset
|
77 public Document doProcess( |
966
a63d79107289
Adjusted services to implement changed signature.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
78 Document data, |
a63d79107289
Adjusted services to implement changed signature.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
79 GlobalContext context, |
a63d79107289
Adjusted services to implement changed signature.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
80 CallMeta callMeta |
a63d79107289
Adjusted services to implement changed signature.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
444
diff
changeset
|
81 ) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7639
diff
changeset
|
82 log.debug("MainValuesService.process"); |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 |
7555
74e9768098a0
issue1542: Let MainValues have localized dates.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7553
diff
changeset
|
84 this.callMeta = callMeta; |
74e9768098a0
issue1542: Let MainValues have localized dates.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7553
diff
changeset
|
85 |
3728
d03e65378b9f
Removed obsolete code. Removed NPE as regular flow control.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1659
diff
changeset
|
86 River river = getRequestedRiver(data); |
d03e65378b9f
Removed obsolete code. Removed NPE as regular flow control.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1659
diff
changeset
|
87 if (river == null) { |
d03e65378b9f
Removed obsolete code. Removed NPE as regular flow control.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1659
diff
changeset
|
88 return error("no river found."); |
d03e65378b9f
Removed obsolete code. Removed NPE as regular flow control.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1659
diff
changeset
|
89 } |
1659
ad54896ec369
Write gauge determined in MainValuesService to log.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1631
diff
changeset
|
90 |
3728
d03e65378b9f
Removed obsolete code. Removed NPE as regular flow control.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1659
diff
changeset
|
91 double[] minmax = getRequestedStartEnd(data, river); |
8755
30b1ddadf275
(issue1801) Unify reference gauge finding code
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8202
diff
changeset
|
92 Gauge gauge = river.determineRefGauge(minmax, |
30b1ddadf275
(issue1801) Unify reference gauge finding code
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8202
diff
changeset
|
93 CMP.compare(minmax[0], minmax[1]) != 0); |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 |
3728
d03e65378b9f
Removed obsolete code. Removed NPE as regular flow control.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1659
diff
changeset
|
95 if (gauge == null) { |
d03e65378b9f
Removed obsolete code. Removed NPE as regular flow control.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1659
diff
changeset
|
96 return error("no gauge found."); |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 } |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 |
3728
d03e65378b9f
Removed obsolete code. Removed NPE as regular flow control.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1659
diff
changeset
|
99 List<MainValue> mainValues = getMainValues(river, gauge); |
d03e65378b9f
Removed obsolete code. Removed NPE as regular flow control.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1659
diff
changeset
|
100 |
d03e65378b9f
Removed obsolete code. Removed NPE as regular flow control.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1659
diff
changeset
|
101 return buildDocument(river, gauge, mainValues, context); |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
102 } |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 /** |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 * This method extracts the river from the incoming request. If no river |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 * string was found or no river is found in the database based on this |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
108 * string a NullPointerException is thrown. |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 * |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 * @param data The incoming request data. |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 * |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
112 * @return the River object. |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
113 */ |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
114 protected River getRequestedRiver(Document data) |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
115 throws NullPointerException |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
116 { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7639
diff
changeset
|
117 log.debug("MainValuesService.getRequestedRiver"); |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
119 String riverStr = XMLUtils.xpathString( |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
120 data, XPATH_RIVER, ArtifactNamespaceContext.INSTANCE); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 |
3728
d03e65378b9f
Removed obsolete code. Removed NPE as regular flow control.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1659
diff
changeset
|
122 return riverStr != null && (riverStr = riverStr.trim()).length() > 0 |
d03e65378b9f
Removed obsolete code. Removed NPE as regular flow control.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1659
diff
changeset
|
123 ? RiverFactory.getRiver(riverStr) |
d03e65378b9f
Removed obsolete code. Removed NPE as regular flow control.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1659
diff
changeset
|
124 : null; |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
125 } |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
126 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
127 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
128 /** |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
129 * This method extracts the start and end point from incoming request |
8856 | 130 * document and returns both values in an array. |
131 * If no start and end strings | |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
132 * are found in the document, the min/max values of the <i>river</i> are |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
133 * returned. |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
134 * |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
135 * @param data The incoming request data. |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
136 * @param river The river of the request. |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
137 * |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
138 * @return the start and end point. |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
139 */ |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
140 protected double[] getRequestedStartEnd(Document data, River river) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7639
diff
changeset
|
141 log.debug("MainValuesService.getStartEnd"); |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
142 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
143 String startStr = XMLUtils.xpathString( |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
144 data, XPATH_START, ArtifactNamespaceContext.INSTANCE); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
145 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
146 String endStr = XMLUtils.xpathString( |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
147 data, XPATH_END, ArtifactNamespaceContext.INSTANCE); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
148 |
3728
d03e65378b9f
Removed obsolete code. Removed NPE as regular flow control.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1659
diff
changeset
|
149 if (startStr == null || endStr == null) { |
d03e65378b9f
Removed obsolete code. Removed NPE as regular flow control.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1659
diff
changeset
|
150 return river.determineMinMaxDistance(); |
d03e65378b9f
Removed obsolete code. Removed NPE as regular flow control.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1659
diff
changeset
|
151 } |
d03e65378b9f
Removed obsolete code. Removed NPE as regular flow control.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1659
diff
changeset
|
152 |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
153 try { |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
154 double start = Double.parseDouble(startStr); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
155 double end = Double.parseDouble(endStr); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
156 |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7639
diff
changeset
|
157 if (log.isDebugEnabled()) { |
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7639
diff
changeset
|
158 log.debug("Found start: " + start); |
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7639
diff
changeset
|
159 log.debug("Found end: " + end); |
3728
d03e65378b9f
Removed obsolete code. Removed NPE as regular flow control.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1659
diff
changeset
|
160 } |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
161 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
162 return new double[] { start, end }; |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
163 } |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
164 catch (NumberFormatException nfe) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7639
diff
changeset
|
165 log.warn(nfe, nfe); |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
166 return river.determineMinMaxDistance(); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
167 } |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
168 } |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
169 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
170 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
171 /** |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
172 * This method creates the result document that includes the main values of |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
173 * the specified <i>gauge</i>. |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
174 * |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
175 * @param river The river. |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
176 * @param gauge The gauge. |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
177 * |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
178 * @return a document that includes the main values of the specified river |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
179 * at the specified gauge. |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
180 */ |
3728
d03e65378b9f
Removed obsolete code. Removed NPE as regular flow control.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1659
diff
changeset
|
181 protected List<MainValue> getMainValues(River river, Gauge gauge) { |
d03e65378b9f
Removed obsolete code. Removed NPE as regular flow control.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1659
diff
changeset
|
182 |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7639
diff
changeset
|
183 if (log.isDebugEnabled()) { |
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7639
diff
changeset
|
184 log.debug("MainValuesService.buildMainValues"); |
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7639
diff
changeset
|
185 log.debug("River: " + river.getName()); |
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7639
diff
changeset
|
186 log.debug("Gauge: " + gauge.getName()); |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
187 } |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
188 |
3734
0c217de0d84b
Modify every second theme to differ from default theme (#835)
Christian Lins <christian.lins@intevation.de>
parents:
3728
diff
changeset
|
189 List<MainValue> mainValues = gauge.getMainValues(); |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
190 |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7639
diff
changeset
|
191 if (log.isDebugEnabled()) { |
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7639
diff
changeset
|
192 log.debug(mainValues.size() + " main values found."); |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
193 } |
1631
26e19cdaed5e
Improved database session handling in services and artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
966
diff
changeset
|
194 |
26e19cdaed5e
Improved database session handling in services and artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
966
diff
changeset
|
195 return mainValues; |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
196 } |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
197 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
198 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
199 protected Document buildDocument( |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
200 River river, |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
201 Gauge gauge, |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
202 List<MainValue> mainValues, |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
203 Object context) |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
204 { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7639
diff
changeset
|
205 log.debug("MainValuesService.buildDocument"); |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
206 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
207 Document doc = XMLUtils.newDocument(); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
208 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
209 ElementCreator cr = new ElementCreator( |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
210 doc, |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
211 ArtifactNamespaceContext.NAMESPACE_URI, |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
212 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
213 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
214 Element rootEl = cr.create("service"); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
215 cr.addAttr(rootEl, "name", "mainvalues"); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
216 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
217 doc.appendChild(rootEl); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
218 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
219 appendMetaInformation(doc, rootEl, river, gauge, context); |
6482
b07cfc319781
Official lines: Use river id instead of river name to be more precise when finding out which main values has a official line.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6356
diff
changeset
|
220 appendMainValues(doc, rootEl, mainValues, river.getId(), context); |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
221 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
222 return doc; |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
223 } |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
224 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
225 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
226 /** |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
227 * This method appends some meta information to the result document. |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
228 * Currently, the river's and gauge's names and the gauge's range are |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
229 * appended. |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
230 * |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
231 * @param root The root element of the result document. |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
232 * @param river The river. |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
233 * @param gauge The gauge. |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
234 * @param context The context object. |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
235 */ |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
236 protected void appendMetaInformation( |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
237 Document doc, |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
238 Element root, |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
239 River river, |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
240 Gauge gauge, |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
241 Object context) |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
242 { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7639
diff
changeset
|
243 log.debug("MainValuesService.appendMetaInformation"); |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
244 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
245 ElementCreator cr = new ElementCreator( |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
246 doc, |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
247 ArtifactNamespaceContext.NAMESPACE_URI, |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
248 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
249 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
250 Range range = gauge.getRange(); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
251 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
252 Element riverEl = cr.create("river"); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
253 cr.addAttr(riverEl, "name", river.getName()); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
254 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
255 Element gaugeEl = cr.create("gauge"); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
256 cr.addAttr(gaugeEl, "name", gauge.getName()); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
257 cr.addAttr(gaugeEl, "from", range.getA().toString()); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
258 cr.addAttr(gaugeEl, "to", range.getB().toString()); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
259 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
260 root.appendChild(riverEl); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
261 root.appendChild(gaugeEl); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
262 } |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
263 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
264 |
6356
4c791a458305
Artifacts: Scan the official lines associated with a main value if it applies for the current river.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6107
diff
changeset
|
265 /** Checks i a main value has an official associated, */ |
8856 | 266 protected static boolean hasOfficialLine( |
267 NamedMainValue nmv, | |
268 Integer riverId | |
269 ) { | |
6356
4c791a458305
Artifacts: Scan the official lines associated with a main value if it applies for the current river.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6107
diff
changeset
|
270 for (OfficialLine ol: nmv.getOfficialLines()) { |
8856 | 271 if ( |
272 ol.getWstColumn().getWst().getRiver().getId().equals(riverId) | |
273 ) { | |
6356
4c791a458305
Artifacts: Scan the official lines associated with a main value if it applies for the current river.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6107
diff
changeset
|
274 return true; |
4c791a458305
Artifacts: Scan the official lines associated with a main value if it applies for the current river.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6107
diff
changeset
|
275 } |
4c791a458305
Artifacts: Scan the official lines associated with a main value if it applies for the current river.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6107
diff
changeset
|
276 } |
4c791a458305
Artifacts: Scan the official lines associated with a main value if it applies for the current river.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6107
diff
changeset
|
277 return false; |
4c791a458305
Artifacts: Scan the official lines associated with a main value if it applies for the current river.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6107
diff
changeset
|
278 } |
4c791a458305
Artifacts: Scan the official lines associated with a main value if it applies for the current river.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6107
diff
changeset
|
279 |
4c791a458305
Artifacts: Scan the official lines associated with a main value if it applies for the current river.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6107
diff
changeset
|
280 |
7552
81d5939ec064
Doc, cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6482
diff
changeset
|
281 /** Append xml representation of main values to document. */ |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
282 protected void appendMainValues( |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
283 Document doc, |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
284 Element root, |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
285 List<MainValue> mainValues, |
6482
b07cfc319781
Official lines: Use river id instead of river name to be more precise when finding out which main values has a official line.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6356
diff
changeset
|
286 Integer riverId, |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
287 Object context) |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
288 { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7639
diff
changeset
|
289 log.debug("MainValuesService.appendMainValues"); |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
290 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
291 ElementCreator cr = new ElementCreator( |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
292 doc, |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
293 ArtifactNamespaceContext.NAMESPACE_URI, |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
294 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
295 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
296 Element list = cr.create("mainvalues"); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
297 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
298 for (MainValue mainValue: mainValues) { |
8856 | 299 Element newEl = buildMainValueElement( |
300 doc, mainValue, riverId, context); | |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
301 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
302 if (newEl != null) { |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
303 list.appendChild(newEl); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
304 } |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
305 } |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
306 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
307 root.appendChild(list); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
308 } |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
309 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
310 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
311 /** |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
312 * This method builds a concrete mainvalue element. This element consists of |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
313 * three attributes: the value, its name and its type. |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
314 * |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
315 * @param doc The owner document. |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
316 * @param mainValue The mainvalue. |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
317 * @param context The context object. |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
318 * |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
319 * @return a mainvalue element. |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
320 */ |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
321 protected Element buildMainValueElement( |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
322 Document doc, |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
323 MainValue mainValue, |
6482
b07cfc319781
Official lines: Use river id instead of river name to be more precise when finding out which main values has a official line.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6356
diff
changeset
|
324 Integer riverId, |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
325 Object context) |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
326 { |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
327 ElementCreator cr = new ElementCreator( |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
328 doc, |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
329 ArtifactNamespaceContext.NAMESPACE_URI, |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
330 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
331 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
332 NamedMainValue namedMainValue = mainValue.getMainValue(); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
333 MainValueType mainValueType = namedMainValue.getType(); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
334 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
335 Element el = cr.create("mainvalue"); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
336 |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
337 cr.addAttr(el, "value", mainValue.getValue().toString()); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
338 cr.addAttr(el, "name", namedMainValue.getName()); |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
339 cr.addAttr(el, "type", mainValueType.getName()); |
7553
4e999b1d7acd
issue1542: Add timeinterval-data to mainvalues made available via service.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7552
diff
changeset
|
340 if (mainValue.getTimeInterval() != null) { |
4e999b1d7acd
issue1542: Add timeinterval-data to mainvalues made available via service.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7552
diff
changeset
|
341 if (mainValue.getTimeInterval().getStartTime() != null) { |
7555
74e9768098a0
issue1542: Let MainValues have localized dates.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7553
diff
changeset
|
342 cr.addAttr(el, "starttime", |
8856 | 343 Long.toString( |
344 mainValue.getTimeInterval().getStartTime().getTime())); | |
7553
4e999b1d7acd
issue1542: Add timeinterval-data to mainvalues made available via service.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7552
diff
changeset
|
345 } |
4e999b1d7acd
issue1542: Add timeinterval-data to mainvalues made available via service.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7552
diff
changeset
|
346 if (mainValue.getTimeInterval().getStopTime() != null) { |
7555
74e9768098a0
issue1542: Let MainValues have localized dates.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7553
diff
changeset
|
347 cr.addAttr(el, "stoptime", |
8856 | 348 Long.toString( |
349 mainValue.getTimeInterval().getStopTime().getTime())); | |
7553
4e999b1d7acd
issue1542: Add timeinterval-data to mainvalues made available via service.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7552
diff
changeset
|
350 } |
4e999b1d7acd
issue1542: Add timeinterval-data to mainvalues made available via service.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7552
diff
changeset
|
351 } |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
352 |
6482
b07cfc319781
Official lines: Use river id instead of river name to be more precise when finding out which main values has a official line.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6356
diff
changeset
|
353 if (hasOfficialLine(namedMainValue, riverId)) { |
6356
4c791a458305
Artifacts: Scan the official lines associated with a main value if it applies for the current river.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6107
diff
changeset
|
354 cr.addAttr(el, "official", "true"); |
4c791a458305
Artifacts: Scan the official lines associated with a main value if it applies for the current river.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6107
diff
changeset
|
355 } |
4c791a458305
Artifacts: Scan the official lines associated with a main value if it applies for the current river.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6107
diff
changeset
|
356 |
331
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
357 return el; |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
358 } |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
359 } |
5a2df8677b3e
Added a service that returns the MainValues of a Gauge based on a river name and a stationing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
360 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |