changeset 844:ac70261bb3f8

Allow passing no master artifact to RPC service when creating new artifact. flys-client/trunk@2566 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 24 Aug 2011 14:31:13 +0000
parents 78ef14dc1877
children 4db672cdacb2
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java flys-client/src/main/java/de/intevation/flys/client/shared/model/Recommendation.java
diffstat 3 files changed, 20 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Wed Aug 24 13:53:36 2011 +0000
+++ b/flys-client/ChangeLog	Wed Aug 24 14:31:13 2011 +0000
@@ -1,3 +1,11 @@
+2011-08-24	Sascha L. Teichmann	<sascha.teichmann@intevation.de> 
+
+	* src/main/java/de/intevation/flys/client/shared/model/Recommendation.java:
+	  Added field for master artifact. Not uses, yet.
+
+	* src/main/java/de/intevation/flys/client/client/ui/CollectionView.java:
+	  Allow passing no master artifact to RPC service when creating new artifact.
+
 2011-08-24	Sascha L. Teichmann	<sascha.teichmann@intevation.de> 
 
 	* src/main/java/de/intevation/flys/client/client/services/ArtifactService.java,
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Wed Aug 24 13:53:36 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Wed Aug 24 14:31:13 2011 +0000
@@ -611,10 +611,6 @@
         final Collection collection = getCollection();
         final Artifact master       = getArtifact();
 
-        if (master == null) {
-            GWT.log("WARNING: Currently no master artifact set.");
-            return;
-        }
         if (recommendations == null) {
             GWT.log("WARNING: Currently no recommendations.");
             return;
@@ -629,8 +625,10 @@
 
             GWT.log("Load recommended artifact with factory: " + factory);
 
+            String uuid = master != null ? master.getUuid() : null;
+
             createArtifactService.create(
-                url, locale, factory, master.getUuid(), recommendation,
+                url, locale, factory, uuid, recommendation,
                 new AsyncCallback<Artifact>() {
                     public void onFailure(Throwable caught) {
                         GWT.log("Error loading recommendations: " +
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/Recommendation.java	Wed Aug 24 13:53:36 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/Recommendation.java	Wed Aug 24 14:31:13 2011 +0000
@@ -9,7 +9,7 @@
 
     protected String factory;
     protected String ids;
-
+    protected String masterArtifact;
 
     public Recommendation() {
     }
@@ -29,5 +29,13 @@
     public String getIDs() {
         return ids;
     }
+
+    public String getMasterArtifact() {
+        return masterArtifact;
+    }
+
+    public void setMasterArtifact(String masterArtifact) {
+        this.masterArtifact = masterArtifact;
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org