comparison flys-client/src/main/java/de/intevation/flys/client/server/ArtifactServiceImpl.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 6aeb4072eeb4
children e02f50a3ad59
comparison
equal deleted inserted replaced
13:8d9075c07667 14:fe2f4d1dd784
2 2
3 import org.w3c.dom.Document; 3 import org.w3c.dom.Document;
4 4
5 import com.google.gwt.user.server.rpc.RemoteServiceServlet; 5 import com.google.gwt.user.server.rpc.RemoteServiceServlet;
6 6
7 import com.google.gwt.core.client.GWT; 7 import de.intevation.artifacts.common.utils.ClientProtocolUtils;
8 8
9 import de.intevation.artifacts.common.utils.ClientProtocolUtils; 9 import de.intevation.artifacts.httpclient.exceptions.ConnectionException;
10 import de.intevation.artifacts.common.utils.XMLUtils; 10 import de.intevation.artifacts.httpclient.http.HttpClient;
11 import de.intevation.artifacts.httpclient.http.HttpClientImpl;
11 12
12 import de.intevation.flys.client.shared.model.Artifact; 13 import de.intevation.flys.client.shared.model.Artifact;
13 import de.intevation.flys.client.client.services.ArtifactService; 14 import de.intevation.flys.client.client.services.ArtifactService;
14 15
15 16
21 */ 22 */
22 public class ArtifactServiceImpl 23 public class ArtifactServiceImpl
23 extends RemoteServiceServlet 24 extends RemoteServiceServlet
24 implements ArtifactService 25 implements ArtifactService
25 { 26 {
26 public Artifact create(String factory) { 27 public Artifact create(String serverUrl, String factory) {
27 Document create = ClientProtocolUtils.newCreateDocument(factory); 28 Document create = ClientProtocolUtils.newCreateDocument(factory);
29 HttpClient client = new HttpClientImpl(serverUrl);
28 30
29 // TODO Implement the artifact creation. 31 try {
32 return (Artifact) client.create(create, new FLYSArtifactCreator());
33 }
34 catch (ConnectionException ce) {
35 System.err.println(ce.getLocalizedMessage());
36 }
37
30 return null; 38 return null;
31 } 39 }
32 } 40 }
33 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 41 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org