changeset 847:25a4bf390757

Loading recommendations: If no reference artifact is given use current artifact as master artifact. flys-client/trunk@2581 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 25 Aug 2011 13:36:06 +0000
parents e47ef0ca8f33
children 9ecd58f619a4
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java
diffstat 2 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Wed Aug 24 16:52:40 2011 +0000
+++ b/flys-client/ChangeLog	Thu Aug 25 13:36:06 2011 +0000
@@ -1,3 +1,9 @@
+2011-08-24	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/CollectionView.java:
+	  Ugly workaraound: If no reference artifact is given use current
+	  artifact as master artifact.
+
 2011-08-24	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/shared/model/ToLoad.java
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Wed Aug 24 16:52:40 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Thu Aug 25 13:36:06 2011 +0000
@@ -610,6 +610,10 @@
         final String locale         = config.getLocale();
         final Collection collection = getCollection();
 
+
+        Artifact masterArtifact = getArtifact();
+
+
         if (recommendations == null) {
             GWT.log("WARNING: Currently no recommendations.");
             return;
@@ -620,6 +624,12 @@
                 continue;
             }
 
+            // XXX: UGLY! If no reference artifact given use uuid of
+            //      current artifact as reference.      
+            if (recommendation.getMasterArtifact() == null) {
+                recommendation.setMasterArtifact(masterArtifact.getUuid());
+            }
+
             final String factory = recommendation.getFactory();
 
             GWT.log("Load recommended artifact with factory: " + factory);

http://dive4elements.wald.intevation.org