[Seaside] Seaside and urls
estebanlm at gmail.com
Fri Nov 15 16:36:42 UTC 2013
On Nov 14, 2013, at 5:31 AM, Sabine Knöfel <sabine.knoefel at gmail.com> wrote:
> Hi Philipe,
> great. I will use it as soon as I switch to 3.0
> On Wed, Nov 13, 2013 at 10:19 PM, Philippe Marschall [via Smalltalk] <[hidden email]> wrote:
> On Wed, Nov 13, 2013 at 4:59 PM, Esteban Lorenzano <[hidden email]> wrote:
> > 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...)
> > See:
> > in WARestfulFilter subclass: #EveRestFilter:
> > EveRestFilter >>#shoppingList
> > <get>
> > <path: 'shopping-list'>
> > 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.
> > requestContext
> > push: session
> > during: [
> > 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: [
> > application cache
> > at: sessionKey
> > ifAbsent: [ nil] ].
> > session ifNil: [
> > session := application newSession.
> > application register: session ].
> > ^ session
> > then in the main component:
> > EveMainComponent>>startOn: aComponent
> > contentComponent show: aComponent
> > is probably not the best way to do it, but is the easiest way I found, and it works :)
> In Seaside 3.1 there is WARestfulComponentFilter >> #startSessionWithRoot:
but my intention was to not create a new session each time I use an URL instead a callback... this way (and using session cookies), I can use some "hard links" mixed with my app.
> seaside mailing list
> [hidden email]
> If you reply to this email, your message will be added to the discussion below:
> To start a new topic under Seaside General, email [hidden email]
> To unsubscribe from Seaside, click here.
> View this message in context: Re: Seaside and urls
> Sent from the Seaside General mailing list archive at Nabble.com.
> seaside mailing list
> seaside at lists.squeakfoundation.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the seaside