Changes to BackgroundTasks and ERJasperReportsExample
Changes to BackgroundTasks and ERJasperReportsExample
- Subject: Changes to BackgroundTasks and ERJasperReportsExample
- From: Pascal Robert <email@hidden>
- Date: Sun, 28 Aug 2011 20:03:21 -0400
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden