comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.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 a4a68b4ee2a3
children 137daff2c732
comparison
equal deleted inserted replaced
228:bbe32496dc84 229:924da6695800
231 } 231 }
232 232
233 String newTitle = MSG.getString(module); 233 String newTitle = MSG.getString(module);
234 setTitle(newTitle); 234 setTitle(newTitle);
235 235
236 final String serverUrl = Config.getInstance().getServerUrl(); 236 Config config = Config.getInstance();
237 final String url = config.getServerUrl();
238 final String locale = config.getLocale();
239
237 final Data[] feedData = new Data[] { data[1] }; 240 final Data[] feedData = new Data[] { data[1] };
241
238 artifactService.create( 242 artifactService.create(
239 serverUrl, module.toLowerCase(), 243 url, locale, module.toLowerCase(),
240 new AsyncCallback<Artifact>() { 244 new AsyncCallback<Artifact>() {
241 public void onFailure(Throwable caught) { 245 public void onFailure(Throwable caught) {
242 GWT.log("Could not create the new artifact."); 246 GWT.log("Could not create the new artifact.");
243 SC.warn(MSG.getString(caught.getMessage())); 247 SC.warn(MSG.getString(caught.getMessage()));
244 } 248 }
245 249
246 public void onSuccess(Artifact artifact) { 250 public void onSuccess(Artifact artifact) {
247 GWT.log("Successfully created a new artifact."); 251 GWT.log("Successfully created a new artifact.");
248 252
249 forwardService.go(serverUrl, artifact, feedData, 253 forwardService.go(url, locale, artifact, feedData,
250 new AsyncCallback<Artifact>() { 254 new AsyncCallback<Artifact>() {
251 public void onFailure(Throwable caught) { 255 public void onFailure(Throwable caught) {
252 GWT.log("Could not feed the artifact."); 256 GWT.log("Could not feed the artifact.");
253 SC.warn(caught.getMessage()); 257 SC.warn(caught.getMessage());
254 } 258 }
370 * 374 *
371 * @param event The StepForwardEvent. 375 * @param event The StepForwardEvent.
372 */ 376 */
373 public void onStepForward(StepForwardEvent event) { 377 public void onStepForward(StepForwardEvent event) {
374 GWT.log("CollectionView - onStepForward()"); 378 GWT.log("CollectionView - onStepForward()");
375 String serverUrl = Config.getInstance().getServerUrl(); 379
376 380 Config config = Config.getInstance();
377 forwardService.go(serverUrl, artifact, event.getData(), 381 String serverUrl = config.getServerUrl();
382 String locale = config.getLocale();
383
384 forwardService.go(serverUrl, locale, artifact, event.getData(),
378 new AsyncCallback<Artifact>() { 385 new AsyncCallback<Artifact>() {
379 public void onFailure(Throwable caught) { 386 public void onFailure(Throwable caught) {
380 GWT.log("Could not feed the artifact."); 387 GWT.log("Could not feed the artifact.");
381 SC.warn(MSG.getString(caught.getMessage())); 388 SC.warn(MSG.getString(caught.getMessage()));
382 } 389 }
395 * 402 *
396 * @param e The StepBackEvent that holds the identifier of the target state. 403 * @param e The StepBackEvent that holds the identifier of the target state.
397 */ 404 */
398 public void onStepBack(StepBackEvent e) { 405 public void onStepBack(StepBackEvent e) {
399 final String target = e.getTarget(); 406 final String target = e.getTarget();
400 final String serverUrl = Config.getInstance().getServerUrl(); 407
401 408 Config config = Config.getInstance();
402 advanceService.advance(serverUrl, artifact, target, 409 final String serverUrl = config.getServerUrl();
410 final String locale = config.getLocale();
411
412 advanceService.advance(serverUrl, locale, artifact, target,
403 new AsyncCallback<Artifact>() { 413 new AsyncCallback<Artifact>() {
404 public void onFailure(Throwable caught) { 414 public void onFailure(Throwable caught) {
405 GWT.log("Could not go back to '" + target + "'"); 415 GWT.log("Could not go back to '" + target + "'");
406 SC.warn(MSG.getString(caught.getMessage())); 416 SC.warn(MSG.getString(caught.getMessage()));
407 } 417 }

http://dive4elements.wald.intevation.org