Seaside to return (only) xml data?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Seaside to return (only) xml data?

jayh

Can anyone point me toward an example of Seaside
being used to return xml data (as in an RSS feed)?

In other words I want to load some data into xml (using
YAXO probably) and then have the renderContentOn:
method return that data.   On the receiving end would
be, say, a Flash application (no actual Seaside GUI).

I'm using Seaside because it handles multiple users,
in terms of serving and tracking instances of the application.
(Something I assume SOAP for instance does not do?)

Thanks for any help,
Jay
[hidden email]
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Seaside to return (only) xml data?

jayh

Actually, now I see that a post from a few days ago,
"Seaside text/plain output problems", addressed a
similar situation (sorry I missed it earlier).

So I assume that my renderContentOn: method
should contain something like:

        self session returnResponse: (WAResponse new
    contentType: 'text/xml';
      nextPutAll:  (some xml formatted string here...);
                yourself)


Somebody please stop me if I'm off on the wrong track...
Thanks,
Jay


On Jun 5, 2007, at 6:56 PM, Jay Hardesty wrote:

>
> Can anyone point me toward an example of Seaside
> being used to return xml data (as in an RSS feed)?
>
> In other words I want to load some data into xml (using
> YAXO probably) and then have the renderContentOn:
> method return that data.   On the receiving end would
> be, say, a Flash application (no actual Seaside GUI).
>
> I'm using Seaside because it handles multiple users,
> in terms of serving and tracking instances of the application.
> (Something I assume SOAP for instance does not do?)
>
> Thanks for any help,
> Jay
> [hidden email]
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Seaside to return (only) xml data?

Avi Bryant-2
On 6/5/07, Jay Hardesty <[hidden email]> wrote:

> So I assume that my renderContentOn: method
> should contain something like:
>
>         self session returnResponse: (WAResponse new
>                 contentType: 'text/xml';
>                 nextPutAll:  (some xml formatted string here...);
>                 yourself)

Code's right, placement's wrong - you shouldn't use #returnResponse:
from within a #renderContentOn: , use it from within a callback.

If your application is purely XML based, I wouldn't use WASession or
WAComponent at all, but just subclass WAEntryPoint and override
#handleRequest:.

Avi
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Seaside to return (only) xml data?

jayh

Thanks for the response.  I see #handleRequest: in WAApplication,
but not WAEntryPoint - is that the place?

Does this chunk of code in #handleRequest: maintain the connection
between particular users and particular object instances (as happens
transparently when using WAComponent)?

        self useSessionCookie ifTrue:
                [aRequest cookies at: self name ifPresent:
                        [:v |
                        aRequest fields at: self handlerField ifAbsentPut: [v]]].

Thanks again,
Jay



On Jun 5, 2007, at 8:02 PM, Avi Bryant wrote:

> On 6/5/07, Jay Hardesty <[hidden email]> wrote:
>
>> So I assume that my renderContentOn: method
>> should contain something like:
>>
>>         self session returnResponse: (WAResponse new
>>                 contentType: 'text/xml';
>>                 nextPutAll:  (some xml formatted string here...);
>>                 yourself)
>
> Code's right, placement's wrong - you shouldn't use #returnResponse:
> from within a #renderContentOn: , use it from within a callback.
>
> If your application is purely XML based, I wouldn't use WASession or
> WAComponent at all, but just subclass WAEntryPoint and override
> #handleRequest:.
>
> Avi
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Seaside to return (only) xml data?

jayh

OK - now I see:  the #handleRequest: method in
WARequestHandler would be the one overridden in
a subclass of WAEntryPoint.

Would I there replicate the cookie-checking that exists
in WAApplication>>handleRequest:  in order to route
requests from particular users to particular objects
(maintain sessions)?

Thanks once more,
Jay



On Jun 5, 2007, at 8:38 PM, Jay Hardesty wrote:

>
> Thanks for the response.  I see #handleRequest: in WAApplication,
> but not WAEntryPoint - is that the place?
>
> Does this chunk of code in #handleRequest: maintain the connection
> between particular users and particular object instances (as happens
> transparently when using WAComponent)?
>
> self useSessionCookie ifTrue:
> [aRequest cookies at: self name ifPresent:
> [:v |
> aRequest fields at: self handlerField ifAbsentPut: [v]]].
>
> Thanks again,
> Jay
>
>
>
> On Jun 5, 2007, at 8:02 PM, Avi Bryant wrote:
>
>> On 6/5/07, Jay Hardesty <[hidden email]> wrote:
>>
>>> So I assume that my renderContentOn: method
>>> should contain something like:
>>>
>>>         self session returnResponse: (WAResponse new
>>>                 contentType: 'text/xml';
>>>                 nextPutAll:  (some xml formatted string here...);
>>>                 yourself)
>>
>> Code's right, placement's wrong - you shouldn't use #returnResponse:
>> from within a #renderContentOn: , use it from within a callback.
>>
>> If your application is purely XML based, I wouldn't use WASession or
>> WAComponent at all, but just subclass WAEntryPoint and override
>> #handleRequest:.
>>
>> Avi
>> _______________________________________________
>> Seaside mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Seaside to return (only) xml data?

Philippe Marschall
In reply to this post by jayh
2007/6/6, Jay Hardesty <[hidden email]>:
>
> Can anyone point me toward an example of Seaside
> being used to return xml data (as in an RSS feed)?

RSRSS on SqueakSource ;)
Version 2 has a better architecture (uses a request handler subclass)
but works only on Seaside 2.8.

Cheers
Philippe

> In other words I want to load some data into xml (using
> YAXO probably) and then have the renderContentOn:
> method return that data.   On the receiving end would
> be, say, a Flash application (no actual Seaside GUI).
>
> I'm using Seaside because it handles multiple users,
> in terms of serving and tracking instances of the application.
> (Something I assume SOAP for instance does not do?)
>
> Thanks for any help,
> Jay
> [hidden email]
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside