Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/StaticWKmsArtifact.java @ 2743:10e6400d4166
Added (dummy-) implementation of relative point facet in staticwkms case.
flys-artifacts/trunk@4478 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 23 May 2012 13:48:20 +0000 |
parents | 0143b44631cc |
children | b63017afbca8 |
comparison
equal
deleted
inserted
replaced
2742:faf73245ec73 | 2743:10e6400d4166 |
---|---|
18 import de.intevation.artifacts.ArtifactNamespaceContext; | 18 import de.intevation.artifacts.ArtifactNamespaceContext; |
19 import de.intevation.artifacts.CallMeta; | 19 import de.intevation.artifacts.CallMeta; |
20 | 20 |
21 import de.intevation.flys.artifacts.model.CrossSectionWaterLineFacet; | 21 import de.intevation.flys.artifacts.model.CrossSectionWaterLineFacet; |
22 import de.intevation.flys.artifacts.model.FacetTypes; | 22 import de.intevation.flys.artifacts.model.FacetTypes; |
23 import de.intevation.flys.artifacts.model.RelativePointFacet; | |
23 import de.intevation.flys.artifacts.model.WKms; | 24 import de.intevation.flys.artifacts.model.WKms; |
24 import de.intevation.flys.artifacts.model.WKmsFacet; | 25 import de.intevation.flys.artifacts.model.WKmsFacet; |
25 import de.intevation.flys.artifacts.model.WKmsFactory; | 26 import de.intevation.flys.artifacts.model.WKmsFactory; |
26 | 27 |
27 import de.intevation.flys.artifacts.states.StaticState; | 28 import de.intevation.flys.artifacts.states.StaticState; |
46 { | 47 { |
47 /** The logger for this class. */ | 48 /** The logger for this class. */ |
48 private static Logger logger = | 49 private static Logger logger = |
49 Logger.getLogger(StaticWKmsArtifact.class); | 50 Logger.getLogger(StaticWKmsArtifact.class); |
50 | 51 |
51 /** XPath to access initial parameter. */ | |
52 public static final String XPATH_DATA = | |
53 "/art:action/art:ids/@value"; | |
54 | |
55 public static final String STATIC_STATE_NAME = | 52 public static final String STATIC_STATE_NAME = |
56 "state.additional_wkms.static"; | 53 "state.additional_wkms.static"; |
57 | 54 |
58 /** One and only state to be in. */ | 55 /** One and only state to be in. */ |
59 protected transient State state = null; | 56 protected transient State state = null; |
82 | 79 |
83 state = new StaticState(STATIC_STATE_NAME); | 80 state = new StaticState(STATIC_STATE_NAME); |
84 | 81 |
85 List<Facet> fs = new ArrayList<Facet>(); | 82 List<Facet> fs = new ArrayList<Facet>(); |
86 logger.debug(XMLUtils.toString(data)); | 83 logger.debug(XMLUtils.toString(data)); |
87 String code = XMLUtils.xpathString( | 84 String code = getDatacageIDValue(data); |
88 data, XPATH_DATA, ArtifactNamespaceContext.INSTANCE); | |
89 | 85 |
90 // TODO Go for JSON, one day. | 86 // TODO Go for JSON, one day. |
91 //ex.: flood_protection-wstv-114-12 | 87 //ex.: flood_protection-wstv-114-12 |
92 if (code != null) { | 88 if (code != null) { |
93 String [] parts = code.split("-"); | 89 String [] parts = code.split("-"); |
124 Facet wKmsFacet = new WKmsFacet( | 120 Facet wKmsFacet = new WKmsFacet( |
125 name, | 121 name, |
126 facetDescription); | 122 facetDescription); |
127 Facet csFacet = new CrossSectionWaterLineFacet(0, | 123 Facet csFacet = new CrossSectionWaterLineFacet(0, |
128 facetDescription); | 124 facetDescription); |
125 Facet rpFacet = new RelativePointFacet(facetDescription); | |
126 | |
129 fs.add(wKmsFacet); | 127 fs.add(wKmsFacet); |
130 fs.add(csFacet); | 128 fs.add(csFacet); |
129 fs.add(rpFacet); | |
131 facets.put(state.getID(), fs); | 130 facets.put(state.getID(), fs); |
132 } | 131 } |
133 } | 132 } |
134 | 133 |
135 spawnState(); | 134 spawnState(); |