[Seaside] seaside and rest
Esteban Lorenzano
estebanlm at gmail.com
Tue Mar 29 11:15:04 UTC 2011
Hi Oliver,
I also had a hard time to use it... what I did is to study bibliocello and squeaksource3 packages (both at seaside.gemstone.com/ss)
One interesting thing I found, is that you normally will want do something like this:
index
| index |
<GET>
<Path: '/index'>
"HERE I WANT TO SHOW MY COMPONENT"
index := MyIndex new.
self requestContext respond: [:response |
response
contentType: WAMimeType textHtml;
nextPutAll: ( WARenderCanvas builder
fullDocument: true;
rootBlock: [ :root | index updateRoot:root ];
render: [ :canvas | index renderContentOn: canvas ])].
This is the "common answer pattern" I found.
Of course, this is just an example, and IRL you'll want to place the response login in a separate method, probable extending WAComponent with a method #respondRendered of something (both bibliocello and squeaksource3 uses this approach).
I hope this helps :)
cheers,
Esteban
El 29/03/2011, a las 4:56a.m., Olivier Auverlot escribió:
> Hi,
>
> I try desperately to use seaside-Rest for building REST services with Seaside. I read the documentation (http://code.google.com/p/seaside/wiki/SeasideRest) and read this post on the ML (http://lists.squeakfoundation.org/pipermail/seaside-dev/2009-September/003584.html).
>
> Someone could explain me how to use this library ? Must I create an Seaside application for hosting the web service ? What is the content of the createRoutes method ? What is the goal of the life ? 42 ? I feel that i become crazy... <X
>
> Thanks for your help.
> best regards
> Olivier ;-)
>
> www.auverlot.fr
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20110329/081877dd/attachment.htm
More information about the seaside
mailing list