Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/CollectionView.java @ 8709:71ae18553377
(issue1754) Also fixup master artifact for already loaded recommendations
As the load many call creates (and needs to create) all artifacts
in the reccomendations this would break "old" recommendations after
a reload through the "Pencil" mode.
A better fix would probably be to just set the master artifiact
in the recommendations but due to the extremly weird interaction
with the server at this point it is not trivial to identify how
this can be done.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Fri, 24 Apr 2015 15:57:23 +0200 |
parents | e3a63d9c5bb1 |
children | b5ac17a10d22 |
comparison
equal
deleted
inserted
replaced
8708:d718edbf0b0c | 8709:71ae18553377 |
---|---|
719 GWT.log("WARNING: Currently no recommendations."); | 719 GWT.log("WARNING: Currently no recommendations."); |
720 return; | 720 return; |
721 } | 721 } |
722 | 722 |
723 for (final Recommendation recommendation: recommendations) { | 723 for (final Recommendation recommendation: recommendations) { |
724 if (collection.loadedRecommendation(recommendation)) { | |
725 continue; | |
726 } | |
727 newRecommendations.push(recommendation); | |
728 | |
729 // XXX: UGLY! If no reference artifact given use uuid of | 724 // XXX: UGLY! If no reference artifact given use uuid of |
730 // current artifact as reference. | 725 // current artifact as reference. |
731 if (recommendation.getMasterArtifact() == null) { | 726 if (recommendation.getMasterArtifact() == null) { |
732 recommendation.setMasterArtifact(masterArtifact.getUuid()); | 727 recommendation.setMasterArtifact(masterArtifact.getUuid()); |
733 } | 728 } |
734 | 729 |
730 if (collection.loadedRecommendation(recommendation)) { | |
731 GWT.log("Already loaded " + recommendation.getDisplayName()); | |
732 continue; | |
733 } | |
734 newRecommendations.push(recommendation); | |
735 } | 735 } |
736 | 736 |
737 loadArtifactService.loadMany( | 737 loadArtifactService.loadMany( |
738 collection, | 738 collection, |
739 recommendations, | 739 recommendations, |