ingo@1365: package de.intevation.flys.client.server; ingo@1365: ingo@1365: import java.io.InputStream; ingo@1365: import java.io.IOException; ingo@1365: ingo@1365: import org.w3c.dom.Document; ingo@1365: ingo@1367: import org.apache.log4j.Logger; ingo@1367: ingo@1365: import com.google.gwt.user.server.rpc.RemoteServiceServlet; ingo@1365: ingo@1365: import de.intevation.artifacts.common.utils.ClientProtocolUtils; ingo@1365: import de.intevation.artifacts.common.utils.XMLUtils; ingo@1365: ingo@1365: import de.intevation.artifacts.httpclient.http.HttpClient; ingo@1365: import de.intevation.artifacts.httpclient.http.HttpClientImpl; ingo@1365: import de.intevation.artifacts.httpclient.exceptions.ConnectionException; ingo@1365: ingo@1365: import de.intevation.flys.client.shared.exceptions.ServerException; ingo@1365: import de.intevation.flys.client.shared.model.Collection; ingo@1365: ingo@1365: import de.intevation.flys.client.client.services.MapOutputService; ingo@1365: ingo@1365: ingo@1365: public class MapOutputServiceImpl ingo@1365: extends RemoteServiceServlet ingo@1365: implements MapOutputService ingo@1365: { ingo@1365: ingo@1367: private static final Logger logger = ingo@1367: Logger.getLogger(MapOutputServiceImpl.class); ingo@1367: ingo@1367: ingo@1370: public void doOut(Collection collection) ingo@1365: throws ServerException ingo@1365: { ingo@1367: logger.info("MapOutputServiceImpl.doOut"); ingo@1365: ingo@1370: String url = getServletContext().getInitParameter("server-url"); ingo@1365: String uuid = collection.identifier(); ingo@1365: ingo@1365: try { ingo@1365: Document request = ClientProtocolUtils.newOutCollectionDocument( ingo@1365: uuid, "floodmap", "floodmap"); ingo@1365: ingo@1370: HttpClient client = new HttpClientImpl(url); ingo@1365: InputStream is = client.collectionOut(request, uuid, "floodmap"); ingo@1365: ingo@1365: Document response = XMLUtils.parseDocument(is); ingo@1365: ingo@1367: logger.debug(XMLUtils.toString(response)); ingo@1367: ingo@1365: // TODO parse response document and return a MapConfig object ingo@1365: } ingo@1365: catch (ConnectionException e) { ingo@1367: logger.error(e, e); ingo@1365: } ingo@1365: catch (IOException ioe) { ingo@1367: logger.error(ioe, ioe); ingo@1365: } ingo@1365: } ingo@1365: } ingo@1365: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :