[Pywps-devel] PyWPS synchronous mode
alan walsh
alanwalsh at hotmail.com
Wed May 19 02:15:15 CEST 2010
Hi,
OK, it seems that the onSucceeded function is not being called for some reason. I've tested it by replacing the openlayers part of the onSucceeded with a simple on screen alert and I don't get the alert.
Why would the onSucceeded function not be called if I can see from the server logs that the process executes successfully and is capable of returning the GML data.
Alan
> Subject: Re: [Pywps-devel] PyWPS synchronous mode
> From: jachym.cepicky at gmail.com
> To: alanwalsh at hotmail.com
> CC: pywps-devel at wald.intevation.org
> Date: Tue, 18 May 2010 15:40:11 +0200
>
> Hi,
>
> it runs synchronously by default, you would have to specify something like
>
> process.assync = true;
>
> in the javascript code, which is false by default.
>
> > function onSucceeded(process) {
> > OpenLayers.loadURL(process.outputs[0].value, "", null,
> > parseBufferResponse);
> > };
>
> this is the function which will be called, according to your
> configuration, after the process was successfully executed.
>
> you should be able to customise according to your needs
>
> Jachym
>
>
> alan walsh píše v Út 18. 05. 2010 v 02:05 +0000:
> > Hi all,
> >
> > I have written the script below to execute and parse with OpenLayers a
> > buffer query which has no user inputs (exampleBufferNoInputsProcess).
> >
> > The script is not working fully as yet. The script executes
> > successfully on the server which I can see from the server logs.
> > Also, when I execute the process from the browser address bar, I can
> > see all of the GML data for the features.
> >
> > However, I am running PyWPS on Windows 7. I'm not sure what the
> > problem is with the script but I know that Jachym said that Windows
> > can not operate PyWPS in asynchronous mode. I don't quite understand
> > what this means and also how I need to change the code to accomodate
> > this problem.
> >
> > Does anybody have any ideas on this?
> >
> > Regards,
> > Alan
> >
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
> > http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd>
> > <html xmlns=http://www.w3.org/1999/xhtml
> > xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
> > xsi:schemaLocation=http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd
> > xml:lang="en" >
> > <head>
> > <title>WPS Client - Execute</title>
> > <meta http-equiv="Content-Type" content="text/html;
> > charset=utf-8" />
> > <script type="text/javascript"
> > src="http://openlayers.org/api/OpenLayers.js"></script>
> > <script type="text/javascript" src="WPS.js"></script>
> > <style type="text/css">
> > #map {
> > width :550px;
> > height :400px;
> > }
> > </style>
> > <script type="text/javascript">
> >
> > var lon = -100;
> > var lat = 44;
> > var zoom = 6;
> > var map, layer;
> > function init() {
> >
> > map = new OpenLayers.Map('map');
> > map.addLayer(layer);
> >
> > map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
> > // Initialize WPS
> > var wps = new
> > OpenLayers.WPS("http://localhost/cgi-bin/pywps-3.1.0/wps.py",{onSucceeded: onSucceeded});
> >
> > // Define output for process
> > var bufferOut = new OpenLayers.WPS.ComplexPut({
> > identifier: "bufferout",
> > title: "Answer1",
> > asReference: true
> > });
> >
> > // define the process, with one output
> > var process = new OpenLayers.WPS.Process({
> > identifier: "exampleBufferNoInputsProcess",
> > async: false,
> > storeSupported: true,
> > grassLocation: true,
> > statusSupported: false,
> > outputs: [bufferOut]
> > });
> >
> > // add the process to wps
> > wps.addProcess(process);
> >
> > // execute the process
> > wps.execute(process.identifier);
> >
> > };
> >
> > // Load data and call parse response
> > function onSucceeded(process) {
> > OpenLayers.loadURL(process.outputs[0].value, "", null,
> > parseBufferResponse);
> > };
> >
> > // parse the resulting buffer
> > function parseBufferResponse(req) {
> > var g = new OpenLayers.Format.GML();
> > var features = g.read(req.responseText);
> > features[0].attributes = {};
> > var mPolygon = new
> > OpenLayers.Geometry.MultiPolygon(features[0].geometry);
> > features[0].geometry = mPolygon;
> > features[0].state = OpenLayers.State.INSERT;
> > map.addFeatures(features[0]);
> > };
> > }
> >
> > </script>
> > </head>
> > <body>
> >
> > <div>
> > <div id="messageLabel"></div>
> > <input type="button" value="Click Me!" onclick="init();" />
> > </div>
> >
> > <h1>WPS Execute</h1>
> > <div id="map" style="width: 600px; height: 300px"></div>
> > </div>
> > <div>
> > </div>
> > </body>
> > </html>
> >
> >
> >
> >
> > ______________________________________________________________________
> > Hotmail: Free, trusted and rich email service. Get it now.
> > _______________________________________________
> > Pywps-devel mailing list
> > Pywps-devel at wald.intevation.org
> > http://lists.wald.intevation.org/mailman/listinfo/pywps-devel
> --
> Jachym Cepicky
> e-mail: jachym.cepicky gmail com
> URL: http://les-ejk.cz
> PGP Public key: http://les-ejk.cz/pgp/JachymCepicky.pgp
_________________________________________________________________
Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
https://signup.live.com/signup.aspx?id=60969
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wald.intevation.org/pipermail/pywps-devel/attachments/20100519/d4c86888/attachment.htm
More information about the Pywps-devel
mailing list