Hi,
I have tried various ways to accomplish this, so far with limited
success, any pointers would be appreciated :-)
Here is my scenario:
- a user fills in a web form on a non-Pier web site
- the form is submitted via HTTP post to a URL on the Pier site, like so:
http://the.piersite.net/seaside/pier?command=DoSomething
- DoSomething is a PRCommand that requires a login
- the user logs in
- Pier shows a confirmation form that summarizes the data from the original form
- user clicks OK
- DoSomething is executed
- Pier shows the home page of the user
http://the.piersite.net/seaside/pier/accounts/joeuser?command=PRViewCommand
I can have DoSomething execute successfully, but I cannot make the
change to the users home page.
Maybe my approach is wrong:
- I use Seaside 2.7b with the latest Pier, Magritte etc
- I use Pier Unix security
- DoSomething is a PRCommand that implements isValidIn: aContext on
the class side as aContext isLoggedIn. This, together with configuring
PUPierMain as the main class will invoke the on-the-fly login.
- I have a made a patch to PRPierMain>>commandFrom: such that the
newly created PRCCommand will have a chance to read additional data
from the external HTTP Request (inside DoSomething>>processRequest:)
- DoSomething answers a custom subclass of WAComponent (say,
ConfirmView) in its asComponent method
- the ConfirmView knows the DoSomething command so it can display the
users data, with a button "Confirm". Clicking the Confirm button will
send the message confirm to the view
ConfirmView>>confirm
command user: self context user..
command execute
- I can see that the command executes successfully. Inside
DoSomething>>execute I have
self
answer: (self context
structure: self user account "account is
a PRStructure"
view: UserAccountView)
- I have inspected the command at this point, and answer gets the
right contents.
- However, when I click on the button, the Confirm view just stays there.
Do you see any chance to get this working? I have tried to look at
Pier Blog and others, but they all seem to use #answer: without
problems.
I'd be thankful for any hints, or alternative ways to achieve the page
flow I described.
Cheers
Matthias