<div dir="ltr">Hi Philipe,<div><br><div>great. I will use it as soon as I switch to 3.0</div><div><br></div><div>Regards</div><div>Sabine</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Nov 13, 2013 at 10:19 PM, Philippe Marschall [via Smalltalk] <span dir="ltr"><<a href="/user/SendEmail.jtp?type=node&node=4721941&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>></span> wrote:<br>
<blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
        On Wed, Nov 13, 2013 at 4:59 PM, Esteban Lorenzano <<a href="http://user/SendEmail.jtp?type=node&node=4721861&i=0" rel="nofollow" link="external" target="_blank">[hidden email]</a>> wrote:
<div><div class='shrinkable-quote'><br>> 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...)
<br>>
<br>> See:
<br>>
<br>> in WARestfulFilter subclass: #EveRestFilter:
<br>>
<br>> EveRestFilter >>#shoppingList
<br>> <get>
<br>> <path: 'shopping-list'>
<br>>
<br>> self continueWithRoot: [ :root |
<br>> root startOn: EveUNOPSShoppingListPanel new ].
<br>>
<br>> EveRestFilter >>#continueWithRoot: aBlock
<br>> "Continues the execution of the application.
<br>> I will pass aBlock to the root class of app, which I assume is a REApplication.
<br>> Otherwise, this will fail"
<br>> | requestContext application session rootComponent |
<br>>
<br>> requestContext := self requestContext.
<br>> application := requestContext application.
<br>> session := self obtainSessionWithApplication: application context: requestContext.
<br>>
<br>> requestContext
<br>> push: session
<br>> during: [
<br>> rootComponent := requestContext rootComponentIfAbsent: [ nil ].
<br>> rootComponent ifNil: [
<br>> rootComponent := (application preferenceAt: #rootClass) new.
<br>> requestContext rootComponent: rootComponent ].
<br>> rootComponent do: aBlock.
<br>> self next handleFiltered: requestContext ].
<br>>
<br>> EveRestFilter >>#obtainSessionWithApplication: application context: requestContext
<br>> | sessionKey session |
<br>>
<br>> sessionKey := application trackingStrategy keyFromContext: requestContext.
<br>> session := sessionKey ifNotNil: [
<br>> application cache
<br>> at: sessionKey
<br>> ifAbsent: [ nil] ].
<br>>
<br>> session ifNil: [
<br>> session := application newSession.
<br>> application register: session ].
<br>>
<br>> ^ session
<br>>
<br>>
<br>> then in the main component:
<br>>
<br>> EveMainComponent>>startOn: aComponent
<br>> contentComponent show: aComponent
<br>>
<br>>
<br>>
<br>> is probably not the best way to do it, but is the easiest way I found, and it works :)
</div></div></div></div><div class="im">In Seaside 3.1 there is WARestfulComponentFilter >> #startSessionWithRoot:
<br><br>Cheers
<br>Philippe
<br>_______________________________________________
<br>seaside mailing list
<br></div><div class="im"><a href="http://user/SendEmail.jtp?type=node&node=4721861&i=1" rel="nofollow" link="external" target="_blank">[hidden email]</a>
<br><a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" rel="nofollow" link="external" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
        
        
        
        <br>
        <br>
        <hr noshade size="1" color="#cccccc">
        </div><div style="color:#444;font:12px tahoma,geneva,helvetica,arial,sans-serif"><div class="im">
                <div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
                </div><a href="http://forum.world.st/Seaside-and-urls-tp4721764p4721861.html" target="_blank" rel="nofollow" link="external">http://forum.world.st/Seaside-and-urls-tp4721764p4721861.html</a>
        </div>
        <div style="color:#666;font:11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
                To start a new topic under Seaside General, email <a href="/user/SendEmail.jtp?type=node&node=4721941&i=1" target="_top" rel="nofollow" link="external">[hidden email]</a> <br><div class="im">
                To unsubscribe from Seaside, <a href="" target="_blank" rel="nofollow" link="external">click here</a>.<br>
                <a href="http://forum.world.st/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" style="font:9px serif" target="_blank" link="external">NAML</a>
        </div></div></blockquote></div><br></div>
        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://forum.world.st/Seaside-and-urls-tp4721764p4721941.html">Re: Seaside and urls</a><br/>
Sent from the <a href="http://forum.world.st/Seaside-General-f86180.html">Seaside General mailing list archive</a> at Nabble.com.<br/>