Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java @ 1425:bc06a671ef60
Removed the URL parameter from service calls. The service
implementations read the URL from the web.xml config file now.
flys-client/trunk@3367 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 08 Dec 2011 09:12:27 +0000 |
parents | 94d4f040da3a |
children | 40f4137a2c31 |
comparison
equal
deleted
inserted
replaced
1424:8974e220b193 | 1425:bc06a671ef60 |
---|---|
222 */ | 222 */ |
223 protected void createNewCollection(String ownerId) { | 223 protected void createNewCollection(String ownerId) { |
224 GWT.log("CollectionView.createNewCollection"); | 224 GWT.log("CollectionView.createNewCollection"); |
225 | 225 |
226 Config config = Config.getInstance(); | 226 Config config = Config.getInstance(); |
227 final String url = config.getServerUrl(); | |
228 final String locale = config.getLocale(); | 227 final String locale = config.getLocale(); |
229 | 228 |
230 createCollectionService.create( | 229 createCollectionService.create( |
231 url, locale, ownerId, | 230 locale, |
231 ownerId, | |
232 new AsyncCallback<Collection>() { | 232 new AsyncCallback<Collection>() { |
233 public void onFailure(Throwable caught) { | 233 public void onFailure(Throwable caught) { |
234 GWT.log("Could not create the new collection."); | 234 GWT.log("Could not create the new collection."); |
235 SC.warn(messages.getString(caught.getMessage())); | 235 SC.warn(messages.getString(caught.getMessage())); |
236 } | 236 } |
366 loadRecommendedArtifacts(recom); | 366 loadRecommendedArtifacts(recom); |
367 } | 367 } |
368 | 368 |
369 if (c != null) { | 369 if (c != null) { |
370 Config config = Config.getInstance(); | 370 Config config = Config.getInstance(); |
371 String url = config.getServerUrl(); | |
372 String locale = config.getLocale(); | 371 String locale = config.getLocale(); |
373 | 372 |
374 describeCollectionService.describe(c.identifier(), url, locale, | 373 describeCollectionService.describe(c.identifier(), locale, |
375 new AsyncCallback<Collection>() { | 374 new AsyncCallback<Collection>() { |
376 public void onFailure(Throwable caught) { | 375 public void onFailure(Throwable caught) { |
377 GWT.log("Could not DESCRIBE collection."); | 376 GWT.log("Could not DESCRIBE collection."); |
378 SC.warn(messages.getString(caught.getMessage())); | 377 SC.warn(messages.getString(caught.getMessage())); |
379 } | 378 } |
573 final Collection collection = getCollection(); | 572 final Collection collection = getCollection(); |
574 | 573 |
575 artifactsQueue++; | 574 artifactsQueue++; |
576 | 575 |
577 addArtifactService.add( | 576 addArtifactService.add( |
578 collection, artifact, url, locale, | 577 collection, artifact, locale, |
579 new AsyncCallback<Collection>() { | 578 new AsyncCallback<Collection>() { |
580 public void onFailure(Throwable caught) { | 579 public void onFailure(Throwable caught) { |
581 GWT.log("An error occured while adding artifact."); | 580 GWT.log("An error occured while adding artifact."); |
582 artifactsQueue--; | 581 artifactsQueue--; |
583 SC.warn(messages.getString(caught.getMessage())); | 582 SC.warn(messages.getString(caught.getMessage())); |
595 } | 594 } |
596 | 595 |
597 | 596 |
598 protected void addRecommendationsToCollection() { | 597 protected void addRecommendationsToCollection() { |
599 Config config = Config.getInstance(); | 598 Config config = Config.getInstance(); |
600 final String url = config.getServerUrl(); | |
601 final String locale = config.getLocale(); | 599 final String locale = config.getLocale(); |
602 final Collection collection = getCollection(); | 600 final Collection collection = getCollection(); |
603 | 601 |
604 collection.addRecommendations(newRecommendations); | 602 collection.addRecommendations(newRecommendations); |
605 | 603 |
606 updater.update(collection, url, locale, | 604 updater.update(collection, locale, |
607 new AsyncCallback<Collection>() { | 605 new AsyncCallback<Collection>() { |
608 public void onFailure(Throwable caught) { | 606 public void onFailure(Throwable caught) { |
609 newRecommendations.removeAllElements(); | 607 newRecommendations.removeAllElements(); |
610 setCollection(collection); | 608 setCollection(collection); |
611 | 609 |
652 final String factory = recommendation.getFactory(); | 650 final String factory = recommendation.getFactory(); |
653 | 651 |
654 GWT.log("Load recommended artifact with factory: " + factory); | 652 GWT.log("Load recommended artifact with factory: " + factory); |
655 | 653 |
656 createArtifactService.create( | 654 createArtifactService.create( |
657 url, locale, factory, recommendation, | 655 locale, factory, recommendation, |
658 new AsyncCallback<Artifact>() { | 656 new AsyncCallback<Artifact>() { |
659 public void onFailure(Throwable caught) { | 657 public void onFailure(Throwable caught) { |
660 GWT.log("Error loading recommendations: " + | 658 GWT.log("Error loading recommendations: " + |
661 caught.getMessage()); | 659 caught.getMessage()); |
662 } | 660 } |