[Seaside] odd difference in behavior when using WADispatcher>>register:

Gastón Dall' Oglio gaston.dalloglio at gmail.com
Fri Jun 29 18:38:04 UTC 2012


For test, normally I deploy an standart untrusted image, and then I run the
image with an script like below to initialize some apps:

_________________________

"+++ Password Protection (choose the password) +++"

#('browse' 'comet' 'config' 'examples' 'status' 'tests' 'tools' 'welcome'
'piersetup' .........) do: [ :e | | h |
   h := (WADispatcher default handlerAt: e).
   h configuration addParent: WAAuthConfiguration instance.
   h preferenceAt: #login put: 'admin'.
   h preferenceAt: #passwordHash put: (GRPlatform current secureHashFor:
'share-password').
   h addFilter: WAAuthenticationFilter new ].
!

"+++ Start the adaptor (choose the port prefix). Note: only one adaptor of
same type can exists +++"

ZnZincServerAdaptor startOn: 8509.
!
____________________


Regards.


2012/6/29 Lawson English <lenglish5 at cox.net>

> I got tired of having to manually either assign every application in
> seaside its own password if I wanted to partially test deployment, so I
> tried to move a specific set of applications inside an inner directory and
> then give the directory a password. This works. However, I thought I'd put
> the process in a loop, and it didn't work as I expected.
>
> This works:
>
> "++++++++++++++++++++++++++++++++++++++++++++++"
>
> "NOTE: only do this after you have created the Dispatcher named
> 'innerdispatcher' and have made 'browse' the default application"
>
> defaultH := WADispatcher default.
> innerDispatcher := defaultH handlerAt: 'innerdispatcher'.
>
> tests := defaultH handlerAt: 'comet'.
> defaultH unregister: 'comet'.
> innerDispatcher register: tests at: 'comet'.
>
> tests := defaultH handlerAt: 'config'.
> defaultH unregister: 'config'.
> innerDispatcher register: tests at: 'config'.
>
> tests := defaultH handlerAt: 'examples'.
> defaultH unregister: 'examples'.
> innerDispatcher register: tests at: 'examples'.
>
> tests := defaultH handlerAt: 'javascript'.
> defaultH unregister: 'javascript'.
> innerDispatcher register: tests at: 'javascript'.
>
> tests := defaultH handlerAt: 'seaside'.
> defaultH unregister: 'seaside'.
> innerDispatcher register: tests at: 'seaside'.
>
> tests := defaultH handlerAt: 'status'.
> defaultH unregister: 'status'.
> innerDispatcher register: tests at: 'status'.
>
>
> tests := defaultH handlerAt: 'tests'.
> defaultH unregister: 'tests'.
> innerDispatcher register: tests at: 'tests'.
>
> tests := defaultH handlerAt: 'tools'.
> defaultH unregister: 'tools'.
> innerDispatcher register: tests at: 'tools'.
>
> tests := defaultH handlerAt: 'files'.
> defaultH unregister: 'files'.
> innerDispatcher register: tests at: 'files'.
> "++++++++++++++++++++++++++++++++++++++++++++++"
>
> This only partially works (some of the Dispatchers are left unmoved):
>
>
>
> "++++++++++++++++++++++++++++++++++++++++++++++"
> defaultH := WADispatcher default.
> innerDispatcher := defaultH handlerAt: 'innerdispatcher'.
>
> defaultH handlers keysAndValuesDo:
>    [:key :value|
>        ((key = 'innerdispatcher' or: [key = 'browse']) or: [key =
> 'welcome']) ifFalse:
>        [
>            defaultH unregister: (defaultH handlerAt: key).
>            innerDispatcher register: value at: key.
>        ]
>    ]
> "++++++++++++++++++++++++++++++++++++++++++++++"
>
>
> Any ideas?
>
> --
> Squeak from the very start (introduction to Squeak and Pharo Smalltalk for
> the (almost) complete and compleate beginner).
> https://www.youtube.com/playlist?list=PL6601A198DF14788D&feature=view_all
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20120629/c53d9056/attachment.htm


More information about the seaside mailing list