changeset 843:78ef14dc1877

Forward recommendations as a structure to RPC service. flys-client/trunk@2564 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 24 Aug 2011 13:53:36 +0000
parents 95fd96b3a19f
children ac70261bb3f8
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/services/ArtifactService.java flys-client/src/main/java/de/intevation/flys/client/client/services/ArtifactServiceAsync.java flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java flys-client/src/main/java/de/intevation/flys/client/server/ArtifactServiceImpl.java
diffstat 5 files changed, 40 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Wed Aug 24 13:26:34 2011 +0000
+++ b/flys-client/ChangeLog	Wed Aug 24 13:53:36 2011 +0000
@@ -1,3 +1,15 @@
+2011-08-24	Sascha L. Teichmann	<sascha.teichmann@intevation.de> 
+
+	* src/main/java/de/intevation/flys/client/client/services/ArtifactService.java,
+	  src/main/java/de/intevation/flys/client/server/ArtifactServiceImpl.java:
+	  Forward recommendations as a structure to RPC service.
+	  TODO: use this to give filters to creation.
+
+	* src/main/java/de/intevation/flys/client/client/services/ArtifactServiceAsync.java,
+	  src/main/java/de/intevation/flys/client/client/services/ArtifactService.java,
+	  src/main/java/de/intevation/flys/client/client/ui/CollectionView.java:
+	  Adjusted calls.
+
 2011-08-24	Felix Wolfsteller	<felix.wolfsteller@intevation.de> 
 
 	Fix loading of recommendations when collection is not yet in place.
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/ArtifactService.java	Wed Aug 24 13:26:34 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/ArtifactService.java	Wed Aug 24 13:53:36 2011 +0000
@@ -6,6 +6,8 @@
 import de.intevation.flys.client.shared.exceptions.ServerException;
 import de.intevation.flys.client.shared.model.Artifact;
 
+import de.intevation.flys.client.shared.model.Recommendation;
+
 /**
  * This interface provides artifact specific services as CREATE, DESCRIBE, FEED,
  * ADVANCE and OUT.
@@ -25,11 +27,11 @@
      * @return the new artifact.
      */
     public Artifact create(
-        String serverUrl,
-        String locale,
-        String factory,
-        String uuid,
-        String ids
+        String         serverUrl,
+        String         locale,
+        String         factory,
+        String         uuid,
+        Recommendation recommendation
     ) throws ServerException;
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/ArtifactServiceAsync.java	Wed Aug 24 13:26:34 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/ArtifactServiceAsync.java	Wed Aug 24 13:53:36 2011 +0000
@@ -4,6 +4,7 @@
 
 import de.intevation.flys.client.shared.model.Artifact;
 
+import de.intevation.flys.client.shared.model.Recommendation;
 
 /**
  * This interface provides artifact specific services as CREATE, DESCRIBE, FEED,
@@ -14,11 +15,11 @@
 public interface ArtifactServiceAsync {
 
     public void create(
-        String serverUrl,
-        String locale,
-        String factory,
-        String uuid,
-        String ids,
+        String         serverUrl,
+        String         locale,
+        String         factory,
+        String         uuid,
+        Recommendation recommendation,
         AsyncCallback<Artifact> callback);
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Wed Aug 24 13:26:34 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Wed Aug 24 13:53:36 2011 +0000
@@ -626,13 +626,11 @@
             }
 
             final String factory = recommendation.getFactory();
-            final String ids     = recommendation.getIDs();
-
 
             GWT.log("Load recommended artifact with factory: " + factory);
 
             createArtifactService.create(
-                url, locale, factory, master.getUuid(), ids,
+                url, locale, factory, master.getUuid(), recommendation,
                 new AsyncCallback<Artifact>() {
                     public void onFailure(Throwable caught) {
                         GWT.log("Error loading recommendations: " +
--- a/flys-client/src/main/java/de/intevation/flys/client/server/ArtifactServiceImpl.java	Wed Aug 24 13:26:34 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/ArtifactServiceImpl.java	Wed Aug 24 13:53:36 2011 +0000
@@ -2,6 +2,7 @@
 
 import org.w3c.dom.Document;
 
+
 import com.google.gwt.user.server.rpc.RemoteServiceServlet;
 
 import de.intevation.artifacts.common.utils.ClientProtocolUtils;
@@ -14,6 +15,7 @@
 import de.intevation.flys.client.shared.model.Artifact;
 import de.intevation.flys.client.client.services.ArtifactService;
 
+import de.intevation.flys.client.shared.model.Recommendation;
 
 /**
  * This interface provides artifact specific services as CREATE, DESCRIBE, FEED,
@@ -31,11 +33,12 @@
 
 
     public Artifact create(
-        String serverUrl,
-        String locale,
-        String factory,
-        String uuid,
-        String ids)
+        String         serverUrl,
+        String         locale,
+        String         factory,
+        String         uuid,
+        Recommendation recommendation
+    )
     throws ServerException
     {
         System.out.println("ArtifactServiceImpl.create");
@@ -43,7 +46,12 @@
         Document create = null;
 
         if (uuid != null && uuid.length() > 0) {
-            create = ClientProtocolUtils.newCreateDocument(factory, uuid, ids);
+            String ids = recommendation != null
+                ? recommendation.getIDs()
+                : null;
+
+            create = ClientProtocolUtils.newCreateDocument(
+                factory, uuid, ids);
         }
         else {
             create = ClientProtocolUtils.newCreateDocument(factory);

http://dive4elements.wald.intevation.org