[Seaside] Seaside and urls
estebanlm at gmail.com
Wed Nov 13 15:59:35 UTC 2013
I'm using Seaside-REST for that (even it is not its purpose), but I needed to hack it a bit (bah, not a BIT really...)
in WARestfulFilter subclass: #EveRestFilter:
self continueWithRoot: [ :root |
root startOn: EveUNOPSShoppingListPanel new ].
EveRestFilter >>#continueWithRoot: aBlock
"Continues the execution of the application.
I will pass aBlock to the root class of app, which I assume is a REApplication.
Otherwise, this will fail"
| requestContext application session rootComponent |
requestContext := self requestContext.
application := requestContext application.
session := self obtainSessionWithApplication: application context: requestContext.
rootComponent := requestContext rootComponentIfAbsent: [ nil ].
rootComponent ifNil: [
rootComponent := (application preferenceAt: #rootClass) new.
requestContext rootComponent: rootComponent ].
rootComponent do: aBlock.
self next handleFiltered: requestContext ].
EveRestFilter >>#obtainSessionWithApplication: application context: requestContext
| sessionKey session |
sessionKey := application trackingStrategy keyFromContext: requestContext.
session := sessionKey ifNotNil: [
ifAbsent: [ nil] ].
session ifNil: [
session := application newSession.
application register: session ].
then in the main component:
contentComponent show: aComponent
is probably not the best way to do it, but is the easiest way I found, and it works :)
On Nov 13, 2013, at 12:24 PM, Tommaso <tommaso.dalsasso at gmail.com> wrote:
> Hello everybody,
> I was looking into Seaside-REST, but I am wondering if it is the correct way to implement this, also because I would probably loose the session.
> Is there a way to provide some kind of routing to Seaside, or is REST the correct way?
> Thank you.
> Tommaso Dal Sasso_______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
More information about the seaside