Okay, a basic proxy restlet has hit trunk.  I had to make a few
modifications to the rest module to get it to compile, but have not
committed these.  A patch is attached if someone (jdeolive, maybe?)
would care to review.  I guess I'll need to update the code anyway when
the changes from 1.7.x are ported forward anyway so perhaps it's not
that important that this compiles right now.

--
David Winslow
OpenGeo - http://opengeo.org/

On Tue, 2009-06-16 at 13:16 -0400, David Winslow wrote:
> The proxy is not for hosting the application itself, but allowing it to
> circumvent the same-origin policy imposed on JavaScript applications by
> web browsers (JavaScript applications cannot make HTTP requests to
> domains other than the one hosting the page they run in).  This is only
> needed for OpenLayers applications that need to read XML data from
> third-party servers.
> 
> For the curious, more on the same-origin policy:
> http://en.wikipedia.org/wiki/Same_origin_policy
> 
> --
> David Winslow
> OpenGeo - http://opengeo.org/
> 
> On Tue, 2009-06-16 at 19:08 +0200, Andrea Aime wrote:
> > David Winslow ha scritto:
> > > Hey all,
> > > 
> > > In order to simplify deployment of OpenLayers applications on top of
> > > GeoServer, I would like to create a community module on trunk that
> > > mimics the proxy.cgi script that is often used with OpenLayers.
> > > Basically, this script accepts a URL as a query parameter and forwards
> > > the request to another server, allowing OpenLayers applications to load
> > > feature data and other resources from servers other than the one hosting
> > > the application.  The script would eventually allow for host-based and
> > > mimetype-based filtering of proxied requests to help admins prevent
> > > abuse.
> > > 
> > > If there are no objections I'd like to get this into SVN later today.
> > 
> > No objections, but one curiosity. How is this better than the "www" 
> > folder provided in the data dir (that allows for static file publishing?)
> > 
> > Cheers
> > Andrea
> > 
> 
> 
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing 
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> Geoserver-devel mailing list
> Geoserver-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
Index: src/main/java/org/geoserver/rest/MapResource.java
===================================================================
--- src/main/java/org/geoserver/rest/MapResource.java	(revision 12640)
+++ src/main/java/org/geoserver/rest/MapResource.java	(working copy)
@@ -8,6 +8,8 @@
 import java.util.Map;
 import java.util.logging.Logger;
 
+import org.geoserver.config.GeoServer;
+import org.geoserver.config.GeoServerInfo;
 import org.geoserver.ows.util.RequestUtils;
 import org.geoserver.platform.GeoServerExtensions;
 import org.restlet.Context;
@@ -17,7 +19,6 @@
 import org.restlet.data.Status;
 import org.restlet.resource.Resource;
 import org.restlet.resource.StringRepresentation;
-import org.vfny.geoserver.global.GeoServer;
 
 
 /**
@@ -29,13 +30,14 @@
 public abstract class MapResource extends Resource {
     private Map myFormatMap;
     private DataFormat myRequestFormat;
-	private GeoServer myGeoserver;
+	private GeoServerInfo myGeoserver;
     protected static Logger LOG = org.geotools.util.logging.Logging.getLogger("org.geoserver.community");
 
     public MapResource() {
         super();
         myFormatMap = getSupportedFormats();
-		myGeoserver = (GeoServer)GeoServerExtensions.bean("geoServer");
+        GeoServer gs = (GeoServer)GeoServerExtensions.bean("geoServer");
+		myGeoserver = (GeoServerInfo)gs.getGlobal();
     }
 
     public MapResource(Context context, Request request, Response response) {
Index: src/main/java/org/geoserver/rest/XStreamFormat.java
===================================================================
--- src/main/java/org/geoserver/rest/XStreamFormat.java	(revision 12640)
+++ src/main/java/org/geoserver/rest/XStreamFormat.java	(working copy)
@@ -1,15 +1,15 @@
 package org.geoserver.rest;
 
 import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
 import java.io.OutputStream;
-import java.io.IOException;
 
 import org.geoserver.rest.xstream.CRSConverter;
-import org.vfny.geoserver.config.WCSConfig;
-import org.vfny.geoserver.config.WFSConfig;
-import org.vfny.geoserver.config.WMSConfig;
-
+import org.geoserver.wcs.WCSInfoImpl;
+import org.geoserver.wfs.WFSInfoImpl;
+import org.geoserver.wms.WMSInfo;
+import org.geoserver.wms.WMSInfoImpl;
+import org.geotools.geometry.GeneralEnvelope;
+import org.opengis.referencing.crs.CoordinateReferenceSystem;
 import org.restlet.data.MediaType;
 import org.restlet.data.Status;
 import org.restlet.resource.OutputRepresentation;
@@ -17,10 +17,6 @@
 
 import com.thoughtworks.xstream.XStream;
 
-import org.geotools.geometry.GeneralEnvelope;
-import org.geotools.referencing.crs.DefaultGeographicCRS;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
-
 public class XStreamFormat implements DataFormat {
 
     public Representation makeRepresentation(final Object data) {
@@ -46,11 +42,11 @@
         XStream xstream = new XStream();
         xstream.setMode(XStream.NO_REFERENCES);
         xstream.alias("envelope", GeneralEnvelope.class);
-        xstream.alias("WCS", WCSConfig.class);
-        xstream.alias("WFS", WFSConfig.class);
-        xstream.alias("WMS", WMSConfig.class);
+        xstream.alias("WCS", WCSInfoImpl.class);
+        xstream.alias("WFS", WFSInfoImpl.class);
+        xstream.alias("WMS", WMSInfoImpl.class);
         xstream.alias("crs", CoordinateReferenceSystem.class);
-        xstream.aliasField("abstract", WMSConfig.class, "__abstract");
+        xstream.aliasField("abstract", WMSInfo.class, "__abstract");
         xstream.registerConverter(new CRSConverter());
         return xstream;
     }
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to