diff flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java @ 14:fe2f4d1dd784

Integrated the httpclient for the communication between client and server. It is now possible to create a new WINFO artifact. flys-client/trunk@1326 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 17 Feb 2011 11:52:55 +0000
parents 8d9075c07667
children f48b2cb2e219
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Thu Feb 17 09:17:37 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Thu Feb 17 11:52:55 2011 +0000
@@ -17,6 +17,7 @@
 import de.intevation.flys.client.shared.model.Artifact;
 import de.intevation.flys.client.shared.model.Collection;
 
+import de.intevation.flys.client.client.Config;
 import de.intevation.flys.client.client.FLYS;
 import de.intevation.flys.client.client.FLYSMessages;
 import de.intevation.flys.client.client.services.ArtifactService;
@@ -124,16 +125,20 @@
         IButton go = new IButton(messages.next());
         go.addClickHandler(new ClickHandler() {
             public void onClick(ClickEvent event) {
-                artifactService.create("winfo", new AsyncCallback<Artifact>() {
-                    public void onFailure(Throwable caught) {
-                        GWT.log("Could not create the new artifact.");
-                        GWT.log(caught.getMessage());
-                    }
+                String serverUrl = Config.getInstance().getServerUrl();
 
-                    public void onSuccess(Artifact artifact) {
-                        GWT.log("Successfully created a new artifact.");
-                        setArtifact(artifact);
-                    }
+                artifactService.create(
+                    serverUrl, "winfo",
+                    new AsyncCallback<Artifact>() {
+                        public void onFailure(Throwable caught) {
+                            GWT.log("Could not create the new artifact.");
+                            GWT.log(caught.getMessage());
+                        }
+
+                        public void onSuccess(Artifact artifact) {
+                            GWT.log("Successfully created a new artifact.");
+                            setArtifact(artifact);
+                        }
                 });
             }
         });

http://dive4elements.wald.intevation.org