Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/StaticWKmsArtifact.java @ 1843:a7e030efd50e
Fix flys/issue405 (Datacage: Recommendations get loaded twice).
flys-artifacts/trunk@3180 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Tue, 08 Nov 2011 12:02:10 +0000 |
parents | da286eb91c9b |
children | bf62cc7052d4 |
comparison
equal
deleted
inserted
replaced
1842:da286eb91c9b | 1843:a7e030efd50e |
---|---|
84 //ex.: flood_protection-wstv-114-12 | 84 //ex.: flood_protection-wstv-114-12 |
85 if (code != null) { | 85 if (code != null) { |
86 String [] parts = code.split("-"); | 86 String [] parts = code.split("-"); |
87 | 87 |
88 if (parts.length >= 4) { | 88 if (parts.length >= 4) { |
89 try { | 89 int col = Integer.valueOf(parts[2]); |
90 int col = Integer.valueOf(parts[2]); | 90 int wst = Integer.valueOf(parts[3]); |
91 int wst = Integer.valueOf(parts[3]); | 91 |
92 | 92 addStringData("col_pos", parts[2]); |
93 addStringData("col_pos", parts[2]); | 93 addStringData("wst_id", parts[3]); |
94 addStringData("wst_id", parts[3]); | 94 |
95 | 95 String wkmsName = WKmsFactory.getWKmsName(col, wst); |
96 String wkmsName = WKmsFactory.getWKmsName(col, wst); | 96 |
97 | 97 String name; |
98 String name; | 98 if (parts[0].equals(HEIGHTMARKS_POINTS)) { |
99 if (parts[0].equals(HEIGHTMARKS_POINTS)) { | 99 name = HEIGHTMARKS_POINTS; |
100 name = HEIGHTMARKS_POINTS; | |
101 } | |
102 else { | |
103 name = STATIC_WKMS; | |
104 } | |
105 | |
106 Facet facet = new WKmsFacet( | |
107 name, | |
108 Resources.getMsg( | |
109 callMeta, | |
110 wkmsName, | |
111 wkmsName)); | |
112 fs.add(facet); | |
113 facets.put(state.getID(), fs); | |
114 } | 100 } |
115 catch (Exception e) { | 101 else { |
116 logger.warn(e, e); | 102 name = STATIC_WKMS; |
117 } | 103 } |
104 | |
105 Facet facet = new WKmsFacet( | |
106 name, | |
107 Resources.getMsg( | |
108 callMeta, | |
109 wkmsName, | |
110 wkmsName)); | |
111 fs.add(facet); | |
112 facets.put(state.getID(), fs); | |
118 } | 113 } |
119 } | 114 } |
120 | 115 |
121 spawnState(); | 116 spawnState(); |
122 super.setup(identifier, factory, context, callMeta, data); | 117 super.setup(identifier, factory, context, callMeta, data); |
128 * @return static state | 123 * @return static state |
129 */ | 124 */ |
130 protected State spawnState() { | 125 protected State spawnState() { |
131 state = new StaticState(STATIC_STATE_NAME); | 126 state = new StaticState(STATIC_STATE_NAME); |
132 List<Facet> fs = facets.get(STATIC_STATE_NAME); | 127 List<Facet> fs = facets.get(STATIC_STATE_NAME); |
133 DefaultOutput output1 = new DefaultOutput( | 128 DefaultOutput output = new DefaultOutput( |
134 "w_differences", | 129 "general", |
135 "w_differences.longitudinal_section", "image/png", | 130 "general", "image/png", |
136 fs, | 131 fs, |
137 "chart"); | 132 "chart"); |
138 DefaultOutput output2 = new DefaultOutput( | 133 |
139 "longitudinal_section", | 134 state.getOutputs().add(output); |
140 "longitudinal_section.longitudinal_section", "image/png", | |
141 fs, | |
142 "chart"); | |
143 | |
144 state.getOutputs().add(output1); | |
145 state.getOutputs().add(output2); | |
146 return state; | 135 return state; |
147 } | 136 } |
148 | 137 |
149 | 138 |
150 /** | 139 /** |