Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java @ 1638:f45bbc80bd3d
Bugfix: #296 Set i18n titles for WSPLGEN and barriers WMS layers.
flys-artifacts/trunk@2823 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 26 Sep 2011 13:10:40 +0000 |
parents | be8b5c06a1f8 |
children | eb3ab28d1c21 |
comparison
equal
deleted
inserted
replaced
1637:866c1f37f2bd | 1638:f45bbc80bd3d |
---|---|
76 public static final String WSPLGEN_QPS = "qps.shp"; | 76 public static final String WSPLGEN_QPS = "qps.shp"; |
77 public static final String WSPLGEN_FLOODPLAIN = "talaue.shp"; | 77 public static final String WSPLGEN_FLOODPLAIN = "talaue.shp"; |
78 public static final String WSPLGEN_WSP_FILE = "waterlevel.wst"; | 78 public static final String WSPLGEN_WSP_FILE = "waterlevel.wst"; |
79 public static final String WSPLGEN_OUTPUT_FILE = "wsplgen.shp"; | 79 public static final String WSPLGEN_OUTPUT_FILE = "wsplgen.shp"; |
80 | 80 |
81 public static final String I18N_WSPLGEN_RESULT = "floodmap.uesk"; | |
82 public static final String I18N_WSPLGEN_DEFAULT = "floodmap.uesk"; | |
83 public static final String I18N_BARRIERS = "floodmap.barriers"; | |
84 public static final String I18N_BARRIERS_DEFAULT = "floodmap.barriers"; | |
85 | |
81 public static final int WSPLGEN_DEFAULT_OUTPUT = 0; | 86 public static final int WSPLGEN_DEFAULT_OUTPUT = 0; |
82 | 87 |
83 | 88 |
84 | 89 |
85 /** | 90 /** |
86 * Inner class that is used to create facets. An instance of this class is | 91 * Inner class that is used to create facets. An instance of this class is |
87 * used while packaging the data for the WSPLGEN calculation. | 92 * used while packaging the data for the WSPLGEN calculation. |
88 */ | 93 */ |
89 private static class FacetCreator { | 94 private static class FacetCreator { |
90 protected FLYSArtifact artifact; | 95 protected FLYSArtifact artifact; |
96 protected CallContext cc; | |
91 protected List<Facet> facets; | 97 protected List<Facet> facets; |
92 protected String url; | 98 protected String url; |
93 protected String hash; | 99 protected String hash; |
94 protected String stateId; | 100 protected String stateId; |
95 | 101 |
96 public FacetCreator(FLYSArtifact artifact, String hash, String sId) { | 102 public FacetCreator( |
103 FLYSArtifact artifact, | |
104 CallContext cc, | |
105 String hash, | |
106 String sId | |
107 ) { | |
97 this.facets = new ArrayList<Facet>(2); | 108 this.facets = new ArrayList<Facet>(2); |
98 this.artifact = artifact; | 109 this.artifact = artifact; |
110 this.cc = cc; | |
99 this.hash = hash; | 111 this.hash = hash; |
100 this.stateId = sId; | 112 this.stateId = sId; |
101 } | 113 } |
102 | 114 |
103 protected String getRiver() { | 115 protected String getRiver() { |
124 | 136 |
125 public void createWSPLGENFacet() { | 137 public void createWSPLGENFacet() { |
126 WMSLayerFacet wsplgen = new WMSLayerFacet( | 138 WMSLayerFacet wsplgen = new WMSLayerFacet( |
127 0, | 139 0, |
128 FLOODMAP_WSPLGEN, | 140 FLOODMAP_WSPLGEN, |
129 "Ergebnis der WSPLGEN Berechnung", | 141 Resources.getMsg( |
142 cc.getMeta(), | |
143 I18N_WSPLGEN_RESULT, | |
144 I18N_WSPLGEN_DEFAULT), | |
130 ComputeType.ADVANCE, | 145 ComputeType.ADVANCE, |
131 stateId, | 146 stateId, |
132 hash, | 147 hash, |
133 getUrl()); | 148 getUrl()); |
134 | 149 |
142 | 157 |
143 public void createBarrierFacet() { | 158 public void createBarrierFacet() { |
144 WMSLayerFacet barriers = new WMSLayerFacet( | 159 WMSLayerFacet barriers = new WMSLayerFacet( |
145 1, | 160 1, |
146 FLOODMAP_WSPLGEN, | 161 FLOODMAP_WSPLGEN, |
147 "Rohre/Graeben/Daemme", | 162 Resources.getMsg( |
163 cc.getMeta(), | |
164 I18N_BARRIERS, | |
165 I18N_BARRIERS_DEFAULT), | |
148 ComputeType.ADVANCE, | 166 ComputeType.ADVANCE, |
149 stateId, | 167 stateId, |
150 hash, | 168 hash, |
151 getUrl()); | 169 getUrl()); |
152 | 170 |
178 return null; | 196 return null; |
179 } | 197 } |
180 | 198 |
181 WSPLGENCalculation calculation = new WSPLGENCalculation(); | 199 WSPLGENCalculation calculation = new WSPLGENCalculation(); |
182 | 200 |
183 FacetCreator facetCreator = new FacetCreator(artifact, hash, getID()); | 201 FacetCreator facetCreator = new FacetCreator( |
202 artifact, context, hash, getID()); | |
184 | 203 |
185 WSPLGENJob job = prepareWSPLGENJob( | 204 WSPLGENJob job = prepareWSPLGENJob( |
186 artifact, | 205 artifact, |
187 facetCreator, | 206 facetCreator, |
188 artifactDir, | 207 artifactDir, |