Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/RiverSelect.java @ 624:929137ee8154
ISSUE-62 (part I/II) States are no longer filled with data - if a state needs user input, it needs to query the owner artifact.
flys-artifacts/trunk@1982 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 23 May 2011 15:11:55 +0000 |
parents | 82bd39f27569 |
children | 627be3ca1ab6 |
comparison
equal
deleted
inserted
replaced
623:aa64fe4df8ab | 624:929137ee8154 |
---|---|
1 package de.intevation.flys.artifacts.states; | 1 package de.intevation.flys.artifacts.states; |
2 | 2 |
3 import java.util.List; | 3 import java.util.List; |
4 import java.util.Map; | |
5 | 4 |
6 import org.apache.log4j.Logger; | 5 import org.apache.log4j.Logger; |
7 | 6 |
8 import org.w3c.dom.Element; | 7 import org.w3c.dom.Element; |
9 import org.w3c.dom.Node; | 8 import org.w3c.dom.Node; |
16 import de.intevation.artifactdatabase.ProtocolUtils; | 15 import de.intevation.artifactdatabase.ProtocolUtils; |
17 import de.intevation.artifactdatabase.data.StateData; | 16 import de.intevation.artifactdatabase.data.StateData; |
18 | 17 |
19 import de.intevation.flys.model.River; | 18 import de.intevation.flys.model.River; |
20 | 19 |
20 import de.intevation.flys.artifacts.FLYSArtifact; | |
21 import de.intevation.flys.artifacts.model.RiverFactory; | 21 import de.intevation.flys.artifacts.model.RiverFactory; |
22 import de.intevation.flys.artifacts.resources.Resources; | 22 import de.intevation.flys.artifacts.resources.Resources; |
23 | 23 |
24 | 24 |
25 /** | 25 /** |
134 public boolean validate(Artifact artifact, CallContext context) | 134 public boolean validate(Artifact artifact, CallContext context) |
135 throws IllegalArgumentException | 135 throws IllegalArgumentException |
136 { | 136 { |
137 logger.debug("RiverSelect.validate"); | 137 logger.debug("RiverSelect.validate"); |
138 | 138 |
139 Map<String, StateData> data = getData(); | 139 FLYSArtifact flys = (FLYSArtifact) artifact; |
140 | 140 |
141 StateData dRiver = data.get("river"); | 141 StateData dRiver = getData(flys, "river"); |
142 | 142 |
143 if (dRiver == null || dRiver.getValue() == null) { | 143 if (dRiver == null || dRiver.getValue() == null) { |
144 throw new IllegalArgumentException(ERROR_NO_RIVER_SELECTED); | 144 throw new IllegalArgumentException(ERROR_NO_RIVER_SELECTED); |
145 } | 145 } |
146 | 146 |