If I receive an external message (not a request from a browser) thru a socket telling me that all the presentation apps that share a particular Comet pusher need to advance to the next slide. How should this best be done?
My solution: I saved a reference to one of the presentation apps and send it the message #nextPage (from a Workspace window). This failed (got a walkback) in JSObject>>render:on: at document := JSDocument on: aStream codec: self requestContext codec. Since 'codec' is never used in JSDocument I changed the line above to: document := JSDocument on: aStream codec: #useless. This works BUT is it a reasonable approach? Or is there a canonical solution to the problem of external events? ---John
_______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
I did something similar using Announcements.
On Tue, Jan 26, 2010 at 10:42 PM, John Chludzinski <[hidden email]> wrote: > If I receive an external message (not a request from a browser) thru a > socket telling me that all the presentation apps that share a particular > Comet pusher need to advance to the next slide. How should this best be > done? > My solution: I saved a reference to one of the presentation apps and send > it the message #nextPage (from a Workspace window). This failed (got a > walkback) in JSObject>>render:on: at > document := JSDocument on: aStream codec: self requestContext codec. > Since 'codec' is never used in JSDocument I changed the line above to: > document := JSDocument on: aStream codec: #useless. > > This works BUT is it a reasonable approach? Or is there a canonical > solution to the problem of external events? > > ---John > > _______________________________________________ > 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 |
In reply to this post by John Chludzinski
Hi John,
Good question. Not a reasonable *approach* I'd say, but perhaps a reasonable workaround. :) I wouldn't know without looking at it further (which I can't do right this second) but it seems like there's a general problem here. It may be that the RenderContext needs to be given the codec (JSObjects hold onto their RenderContext for later use, I think). Or maybe the JSObject should cache it. But I'm not sure. There are some fundamental issues around encodings that we haven't been able to solve in 3.0 (might be a goal for 3.1?) so you may just need to work around this for now. Or Lukas may have a better suggestion... If you're sticking with the work around, you might want to do something like what WAUrl>>printOn: does, which will be a little more robust, I guess (and maybe that should be rolled into Seaside for now - again Lukas will have an opinion on that). Julian On Tue, Jan 26, 2010 at 1:42 PM, John Chludzinski <[hidden email]> wrote: > If I receive an external message (not a request from a browser) thru a > socket telling me that all the presentation apps that share a particular > Comet pusher need to advance to the next slide. How should this best be > done? > My solution: I saved a reference to one of the presentation apps and send > it the message #nextPage (from a Workspace window). This failed (got a > walkback) in JSObject>>render:on: at > document := JSDocument on: aStream codec: self requestContext codec. > Since 'codec' is never used in JSDocument I changed the line above to: > document := JSDocument on: aStream codec: #useless. > > This works BUT is it a reasonable approach? Or is there a canonical > solution to the problem of external events? > > ---John > > _______________________________________________ > 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 |
In reply to this post by John Chludzinski
Thanks Julian! This works just fine and is definitely less of a jury-rig! ---John render: aRenderable on: aStream "Render aRenderable on aStream."| document html codec | codec := [ self requestContext codec ] on: WARequestContextNotFound do: [ WANullCodec new ]. document := JSDocument on: aStream codec: codec. document open. canvas context document: document during: [ html := canvas species context: canvas context. html render: aRenderable; flush. document close ] On Tue, Jan 26, 2010 at 4:42 PM, John Chludzinski <[hidden email]> wrote:
_______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Great. I created an issue for your problem:
http://code.google.com/p/seaside/issues/detail?id=540 Julian On Wed, Jan 27, 2010 at 11:29 AM, John Chludzinski <[hidden email]> wrote: > > Thanks Julian! This works just fine and is definitely less of a jury-rig! > ---John > render: aRenderable on: aStream > "Render aRenderable on aStream." > > | document html codec | > > codec := [ self requestContext codec ] > on: WARequestContextNotFound > do: [ WANullCodec new ]. > > document := JSDocument on: aStream codec: codec. > > document open. > canvas context document: document during: [ > html := canvas species context: canvas context. > html render: aRenderable; flush. > document close ] > > > > On Tue, Jan 26, 2010 at 4:42 PM, John Chludzinski > <[hidden email]> wrote: >> >> If I receive an external message (not a request from a browser) thru a >> socket telling me that all the presentation apps that share a particular >> Comet pusher need to advance to the next slide. How should this best be >> done? >> My solution: I saved a reference to one of the presentation apps and send >> it the message #nextPage (from a Workspace window). This failed (got a >> walkback) in JSObject>>render:on: at >> document := JSDocument on: aStream codec: self requestContext codec. >> Since 'codec' is never used in JSDocument I changed the line above to: >> document := JSDocument on: aStream codec: #useless. >> >> This works BUT is it a reasonable approach? Or is there a canonical >> solution to the problem of external events? >> >> ---John > > > _______________________________________________ > 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 |
Free forum by Nabble | Edit this page |