[Seaside] Significant differences between Continuation Class &
WAContinuation Class?
Paul DeBruicker
pdebruic at gmail.com
Fri Sep 4 20:35:08 UTC 2009
Hi
I'm trying to replicate the "Forgot your password" functionality in
SqueakSource 2 (http://www.squeaksource.com/ss2.html). In the method
SSSendPassword >> sendPasswordToUserWithLogin: login (Pasted in below)
it uses the Continuation class. In the beta Pharo image there is no
Continuation class. Does WAContinuation do the same thing or should I
use something else?
The problem I'm experiencing is that if I change Continuation to
WAContinuation in the method a Url is generated and I can email it to
myself from Pharo, but when I click the link in the email I am brought
to a blank page. I have not used Magritte in my project. I would
readily believe that my problem has nothing to do with Continuation vs
WAContinuation but just that I haven't created anything to be rendered
at the link generated by 'self session actionUrlForContinuation: cc.'
If thats the problem, how would I go about displaying a Component
when the link is clicked?
Thanks for any help you can provide
Paul
sendPasswordToUserWithLogin: login
| member url |
member := self model memberAt: login.
member isNil ifTrue: [
self informOnlyAdmin: 'You specified an unknown account. Please
contact the administrator.'.
self answer ].
member email isNil ifTrue: [
self informOnlyAdmin: 'No e-mail address specified for this account.
Please contact the administrator.'.
self answer ].
member isSuperUser ifTrue: [
self inform: 'Superusers shoud never forget their password.'.
self answer ].
Continuation currentDo: [ :cc |
url := self session actionUrlForContinuation: cc.
url := self repository rootUrl , url copyWithoutFirst.
[ self sendMailWithUrl: url toMember: member ]
on: Exception
do: [ :error | self informOnlyAdmin: error messageText , '. Please
contact the administrator.'; answer ].
self inform: 'An e-mail has been successfully sent to you.'.
self answer ].
self editMember: 'Change your password'.
self answer
The editMember method is here:
SSComponent>>editMember: aTitleString
| editor |
editor := self session user asComponent
addTitle: aTitleString;
addValidatedForm;
yourself.
(self call: editor)
ifNotNil: [ self session save ]
More information about the seaside
mailing list