ingo@11: package de.intevation.flys.client.server; ingo@11: ingo@11: import org.w3c.dom.Document; ingo@11: ingo@11: import com.google.gwt.user.server.rpc.RemoteServiceServlet; ingo@11: ingo@14: import de.intevation.artifacts.common.utils.ClientProtocolUtils; ingo@11: ingo@14: import de.intevation.artifacts.httpclient.exceptions.ConnectionException; ingo@14: import de.intevation.artifacts.httpclient.http.HttpClient; ingo@14: import de.intevation.artifacts.httpclient.http.HttpClientImpl; ingo@11: ingo@11: import de.intevation.flys.client.shared.model.Artifact; ingo@11: import de.intevation.flys.client.client.services.ArtifactService; ingo@11: ingo@11: ingo@11: /** ingo@11: * This interface provides artifact specific services as CREATE, DESCRIBE, FEED, ingo@11: * ADVANCE and OUT. ingo@11: * ingo@11: * @author Ingo Weinzierl ingo@11: */ ingo@11: public class ArtifactServiceImpl ingo@11: extends RemoteServiceServlet ingo@11: implements ArtifactService ingo@11: { ingo@14: public Artifact create(String serverUrl, String factory) { ingo@14: Document create = ClientProtocolUtils.newCreateDocument(factory); ingo@14: HttpClient client = new HttpClientImpl(serverUrl); ingo@11: ingo@14: try { ingo@14: return (Artifact) client.create(create, new FLYSArtifactCreator()); ingo@14: } ingo@14: catch (ConnectionException ce) { ingo@14: System.err.println(ce.getLocalizedMessage()); ingo@14: } ingo@14: ingo@11: return null; ingo@11: } ingo@11: } ingo@11: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :