On Apr 23, 8:03 pm, Tim Michelsen <
timmichel...@gmx-topmail.de> wrote:
> Hello!>> javascript has a problem fetching external urls.
> >> They created a proxy.cgi script [3].
> > Yup, I have the same issue :)
> Thanks for confirming this. Such a short time I am working with
> Openlayers (OL)...
This is the bit that I'm more comfortable with :)
> What I think is strange that the OL states that load from localhost
> shouldn't be a problem...
It should be fine from the *same* host as the originating query.
> I wonder how this is solved within other javascript frameworks. Do they
> never load external pages?
They use a Proxy too.
jQuery now supports using JSONP callbacks which avoid the issue
outside of OL:
http://docs.jquery.com/Ajax/jQuery.ajax#options
Need to ask on OL list if this same technique can be used for OL...
> Saving to a temporary file is not an option when the kml is generated
> dynamically from queries.
Why not?
How often are you updating the queries?
> > I /think/ we need to rewrite the CGI script as a Web2Py
> > controller...well, I do at least, as I don't want to depend on Apache
> > as my app is going to be deployed in many scenarios...
> Did you already start with this?
Not seriously...
> I do not yet know how to write this as native web2py controller since I
> do not understand the underlaying JS & proxy issues.
'Just' a question of porting the existing Python CGI to Web2Py I
think.
Ignore the JS issue - what you need is a simple, dumb HTTP Proxy.
(Need to provide for authentication somewhere, but that part's easy in
Web2Py)
> I will brach out you code and see what you have done so far.
:)
> What about looking at geo.turbogears & django?
Definitely a good idea.
Ill see if the TG geo author can help us with this too...he's
interested in helping Sahana :)
> >if you just have
> > a single instance & have Apache ready, then a simple CGI bin will sort
> > you out ;)
> I think OL is just not enough to justify running apache among cherrypy
> (web2py).
Great - glad you have the same idea here :)
F