Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/BunduWstWQFixing.java @ 9277:2323d005f9a5
compile error fix
author | gernotbelger |
---|---|
date | Fri, 20 Jul 2018 10:39:02 +0200 |
parents | 3141f0e7314e |
children | 82c67b859aa7 |
comparison
equal
deleted
inserted
replaced
9276:3141f0e7314e | 9277:2323d005f9a5 |
---|---|
7 */ | 7 */ |
8 package org.dive4elements.river.artifacts.bundu.bezugswst; | 8 package org.dive4elements.river.artifacts.bundu.bezugswst; |
9 | 9 |
10 import org.apache.log4j.Logger; | 10 import org.apache.log4j.Logger; |
11 import org.dive4elements.artifacts.Artifact; | 11 import org.dive4elements.artifacts.Artifact; |
12 import org.dive4elements.artifacts.CallContext; | |
13 import org.dive4elements.artifacts.common.utils.XMLUtils; | |
12 import org.dive4elements.river.artifacts.D4EArtifact; | 14 import org.dive4elements.river.artifacts.D4EArtifact; |
13 import org.dive4elements.river.artifacts.model.RangeWithValues; | 15 import org.dive4elements.river.artifacts.model.RangeWithValues; |
14 import org.dive4elements.river.artifacts.states.WQAdapted; | 16 import org.dive4elements.river.artifacts.states.WQAdapted; |
17 import org.w3c.dom.Element; | |
15 | 18 |
16 /** | 19 /** |
17 * State to input W/Q data for fixings | 20 * State to input W/Q data for fixings |
18 * | 21 * |
19 * @author <a href="mailto:aheinecke@intevation.de">Andre Heinecke</a> | 22 * @author <a href="mailto:aheinecke@intevation.de">Andre Heinecke</a> |
20 */ | 23 */ |
21 public class BunduWstWQFixing extends WQAdapted { | 24 public class BunduWstWQFixing extends WQAdapted { |
22 | 25 |
23 /** The log used in this state. */ | 26 /** The log used in this state. */ |
24 private static Logger log = Logger.getLogger(BunduWstWQFixing.class); | 27 private static Logger log = Logger.getLogger(BunduWstWQFixing.class); |
28 | |
29 @Override | |
30 protected String getUIProvider() { | |
31 return "bundu_wst_wq_panel"; | |
32 } | |
25 | 33 |
26 /** Simple sanity check if values are positive numbers **/ | 34 /** Simple sanity check if values are positive numbers **/ |
27 @Override | 35 @Override |
28 public boolean validate(final Artifact artifact) throws IllegalArgumentException { | 36 public boolean validate(final Artifact artifact) throws IllegalArgumentException { |
29 log.debug("BunduWstWQFixing.validate"); | 37 log.debug("BunduWstWQFixing.validate"); |
44 } | 52 } |
45 | 53 |
46 return true; | 54 return true; |
47 } | 55 } |
48 | 56 |
57 // adding bezugsjahr and dauer to client | |
58 | |
49 @Override | 59 @Override |
50 protected String getUIProvider() { | 60 protected Element[] createItems(final XMLUtils.ElementCreator ec, final Artifact artifact, final String name, final CallContext context) { |
51 return "bundu_wst_wq_panel"; | 61 |
62 final Element[] defaultElements = super.createItems(ec, artifact, name, context); | |
63 | |
64 final BunduAccess access = new BunduAccess((D4EArtifact) artifact); | |
65 | |
66 final int bezugsjahr = access.getBezugsJahr(); | |
67 final int qSeriesLength = access.getQSeriesLength(); | |
68 final String[] keys = new String[] { "ignore_q_series_length", "ignore_bezugsjahr" }; | |
69 final String[] values = new String[] { String.valueOf(qSeriesLength), String.valueOf(bezugsjahr) }; | |
70 | |
71 return FixationChoice.appendElements(ec, defaultElements, keys, values); | |
72 | |
52 } | 73 } |
74 | |
53 } | 75 } |