[Seaside] Seaside-Rest question [WAS] Re: How can I make this kind of redirect in Seaside?

Mariano Martinez Peck marianopeck at gmail.com
Tue Jul 18 22:57:11 UTC 2017


On Tue, Jul 18, 2017 at 4:01 PM, Mariano Martinez Peck <
marianopeck at gmail.com> wrote:

>
>
> On Tue, Jul 18, 2017 at 1:09 PM, Philippe Marschall <
> philippe.marschall at gmail.com> wrote:
>
>> On Tue, Jul 18, 2017 at 4:02 PM, Mariano Martinez Peck
>> <marianopeck at gmail.com> wrote:
>> > Hi guys,
>> >
>> > Ley's say I have a root component registered in /registration which
>> takes
>> > care of user registration. Inside a callback of a button ('Register') I
>> want
>> > to redirect to /reps (my real app prefix) which is associated to a
>> different
>> > root task which renders the welcome/login window from which you enter
>> to the
>> > app.
>> >
>> > What I want is to "auto-login" after register. So I need to make a
>> redirect
>> > from /registration to /reps but auto-getting a session for that root
>> task
>> > etc. I guess the way to do this is to simulate getting a session and
>> make
>> > the redirect  to /reps_s=...
>> >
>> > Any ideas?
>>
>> Maybe you can take some ideas from WARestfulComponentFilter >>
>> #startSessionWithRoot: you can use #rootComponent: switch the root
>> component.
>>
>>
> Hi Philippe,
>
> Thanks, that did work nicely. The only thing that took me some time to
> figure out is HOW to build the methods with the pragmas. There was no
> subclass of the filter as an example. I had to search lot in mailing lists
> until I come up with a working method example. I ended doing something like
> this:
>
> userRegistration
> <get>
> <path: '/registration'>
> self startSessionWithRoot: MyComponent new.
>
>

BTW... how can I allow something like this:

<path: '/companyreport/{ticker}/{reportName}'>

I then somehow I would like to parse the URL inside the method so that I
answer the correct response based on the URL ...

Any idea?

Thanks,


-- 
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/seaside/attachments/20170718/90ee7805/attachment-0001.html>


More information about the seaside mailing list