I did a couple of small changes to BackgroundTasks and ERJasperReportsExample 
in Wonder.

First, they both use H2 as the default instead of MySQL, so hopefully the 
examples will run out of the box without any properties change. 

I also added a "background task in a REST context" example in BackgroundTasks. 
To start the app, you do a POST, like this:

        $ curl -v -X POST 
http://192.168.0.106:65473/cgi-bin/WebObjects/BackgroundTasks.woa/ra/taskInfos.json

In the reply, you will a 202 code instead of 201 or 200, 202 = Accepted, 
meaning that the job was accepted. The response, you will also get this header:

        HTTP/1.0 202 Apple WebObjects
        content-location: 
http://mbp-pascal-robert-4.local:65473/cgi-bin/WebObjects/BackgroundTasks.woa/ra/taskInfos/17.json

So you can query that URL to find out details about the status of the task:

        $ curl -v -X GET 
http://192.168.0.106:65473/cgi-bin/WebObjects/BackgroundTasks.woa/ra/taskInfos/17.json

When the job is still running, you will get a 200 code. But when the job is 
done, that URL will return a 303 code instead of 200, and again, with a header 
with a link to the details:

        HTTP/1.0 303 Apple WebObjects
        content-location: 
http://mbp-pascal-robert-4.local:65473/cgi-bin/WebObjects/BackgroundTasks.woa/ra/taskInfos/17/results.json

Just query that new URL to get everything. 
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to