Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java @ 229:924da6695800
Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
flys-client/trunk@1681 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 14 Apr 2011 07:53:01 +0000 |
parents | 9040663aee01 |
children | 92c200887b20 |
comparison
equal
deleted
inserted
replaced
228:bbe32496dc84 | 229:924da6695800 |
---|---|
112 vertical.addMember(footer); | 112 vertical.addMember(footer); |
113 | 113 |
114 RootPanel.get("app").add(vertical); | 114 RootPanel.get("app").add(vertical); |
115 | 115 |
116 initConfiguration(); | 116 initConfiguration(); |
117 String serverUrl = Config.getInstance().getServerUrl(); | 117 |
118 Config config = Config.getInstance(); | |
119 String url = config.getServerUrl(); | |
120 String locale = config.getLocale(); | |
118 | 121 |
119 getRivers(); | 122 getRivers(); |
120 | 123 |
121 userService.getCurrentUser(serverUrl, new AsyncCallback<User>() { | 124 userService.getCurrentUser(url, locale, new AsyncCallback<User>() { |
122 public void onFailure(Throwable caught) { | 125 public void onFailure(Throwable caught) { |
123 GWT.log("Could not find a logged in user."); | 126 GWT.log("Could not find a logged in user."); |
124 SC.warn(MSG.getString(caught.getMessage())); | 127 SC.warn(MSG.getString(caught.getMessage())); |
125 } | 128 } |
126 | 129 |
186 return rivers; | 189 return rivers; |
187 } | 190 } |
188 | 191 |
189 | 192 |
190 protected void readRivers() { | 193 protected void readRivers() { |
191 String url = Config.getInstance().getServerUrl(); | 194 Config config = Config.getInstance(); |
195 String url = config.getServerUrl(); | |
196 String locale = config.getLocale(); | |
197 | |
192 GWT.log("Fetch rivers from server '" + url + "'"); | 198 GWT.log("Fetch rivers from server '" + url + "'"); |
193 | 199 |
194 riverService.list(url, new AsyncCallback<River[]>() { | 200 riverService.list(url, locale, new AsyncCallback<River[]>() { |
195 public void onFailure(Throwable caught) { | 201 public void onFailure(Throwable caught) { |
196 GWT.log("Could not recieve a list of rivers."); | 202 GWT.log("Could not recieve a list of rivers."); |
197 SC.warn(MSG.getString(caught.getMessage())); | 203 SC.warn(MSG.getString(caught.getMessage())); |
198 } | 204 } |
199 | 205 |
236 return; | 242 return; |
237 } | 243 } |
238 | 244 |
239 GWT.log("Open existing project: " + collectionID); | 245 GWT.log("Open existing project: " + collectionID); |
240 | 246 |
241 Config config = Config.getInstance(); | 247 Config config = Config.getInstance(); |
242 final String url = config.getServerUrl(); | 248 final String url = config.getServerUrl(); |
243 | 249 final String locale = config.getLocale(); |
244 describeCollectionService.describe(collectionID, url, | 250 |
251 describeCollectionService.describe(collectionID, url, locale, | |
245 new AsyncCallback<Collection>() { | 252 new AsyncCallback<Collection>() { |
246 public void onFailure(Throwable caught) { | 253 public void onFailure(Throwable caught) { |
247 SC.warn(MSG.getString(caught.getMessage())); | 254 SC.warn(MSG.getString(caught.getMessage())); |
248 } | 255 } |
249 | 256 |
256 return; | 263 return; |
257 } | 264 } |
258 | 265 |
259 getArtifactService.getArtifact( | 266 getArtifactService.getArtifact( |
260 url, | 267 url, |
268 locale, | |
261 item.identifier(), | 269 item.identifier(), |
262 item.hash(), | 270 item.hash(), |
263 new AsyncCallback<Artifact>() { | 271 new AsyncCallback<Artifact>() { |
264 public void onFailure(Throwable caught) { | 272 public void onFailure(Throwable caught) { |
265 SC.warn(MSG.getString(caught.getMessage())); | 273 SC.warn(MSG.getString(caught.getMessage())); |
283 | 291 |
284 /** | 292 /** |
285 * Create a new Artifact. | 293 * Create a new Artifact. |
286 */ | 294 */ |
287 public void newArtifact(String factory) { | 295 public void newArtifact(String factory) { |
288 String url = Config.getInstance().getServerUrl(); | 296 Config config = Config.getInstance(); |
289 | 297 String url = config.getServerUrl(); |
290 artifactService.create(url, factory, new AsyncCallback<Artifact>() { | 298 String locale = config.getLocale(); |
291 public void onFailure(Throwable caught) { | 299 |
292 GWT.log("Could not create the new artifact."); | 300 artifactService.create(url, locale, factory, |
293 GWT.log(caught.getMessage()); | 301 new AsyncCallback<Artifact>() { |
294 } | 302 public void onFailure(Throwable caught) { |
295 | 303 GWT.log("Could not create the new artifact."); |
296 public void onSuccess(Artifact artifact) { | 304 SC.warn(MSG.getString(caught.getMessage())); |
297 GWT.log("Successfully created a new artifact."); | 305 } |
298 } | 306 |
307 public void onSuccess(Artifact artifact) { | |
308 GWT.log("Successfully created a new artifact."); | |
309 } | |
299 }); | 310 }); |
300 } | 311 } |
301 } | 312 } |
302 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 313 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |