[Seaside] Here Is A Deployed Seaside App

Nevin Pratt nevin at smalltalkpro.com
Fri Apr 11 06:54:25 CEST 2003



Derek Brans wrote:

>
>To be honest, my first rxn was on the negative side.  I thought it was a bit
>like using baby heart and liver to give it more of a life-like feel, though
>I suppose it's really not that bad.  :)
>
>  
>

Interesting.  Thanks for the feedback.

Whenever we put one on eBay, we start at $1 with no reserve.  So far the 
mohair dolls (goat hair) have done better than the human hair dolls.

>  
>
>>The #checkout action method of the BBViewCart component is:
>>
>>checkout
>>    | ses |
>>    ses _ self session.
>>    ses shoppingCart isEmpty
>>        ifTrue: [self call: BBAddAuctionToCart new]
>>        ifFalse: [| bbco url |
>>            self call: BBBillToShipTo new.
>>            bbco _ BBCheckout new.
>>            url _ renderer
>>                        urlForAction: [self call: bbco].
>>            ses
>>                returnResponse: (WAResponse forwardTo:
>>'https://bountifulbaby.com' , url)].
>>
>>You can see I just forward to the https port on the server.  On the
>>server, I have Stunnel listening, and Stunnel does the SSL work.
>>
>>    
>>
>
>That's amazing.  I need to get on the stunnel bandwagon.
>
>Good use of WAResponse.  How did you learn that?  
>

 From Avi.  Here is his post-- it was for 2.3, but gave me the pointer 
for 2.2 as well:

******************
On Sat, 29 Mar 2003, Nevin Pratt wrote:

>> process: request
>>     ^ request redirectTo: 'http://www.anywhere.com/somepath'
>>
>> And in reality, this is what I really want to do from the action method
>> of the button for a Seaside component-- redirect the request to a secure
>> port of an arbitrary web URL via an 'https' redirect.
>>
>> How do I do that?
>  
>

This should do the trick:

someActionMethod
  session returnResponse:
   (WARedirectResponse location: 'http://www.anywhere.com/somepath')

Avi
****************


>Can ask the session to
>respond from any method that isn't a rendering method?
>
>  
>

To invoke arbitrary methods in 2.3, see my responses in thread titled:
       Re: [Seaside] anchors behaving like buttons?
I use a similar scheme for 2.2, and this allows old bookmarks to work.

For example, for the old 'Comanche module' version of the web site, the 
'Available Babies' page was at:
    http://www.bountifulbaby.com/availablebaby.html
Now that page has been replaced with a simple page that consists of this:

*************
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>Bountiful Baby</title>
    <meta http-equiv="refresh" 
content="0;URL=http://www.bountifulbaby.com/seaside/index/availablebaby">
    </meta>
  </head>
  <body>
  </body>
</html>
*************

Notice that all that the html page now does is forward to a Seaside 
"page".  So, if anybody has the old page bookmarked, they will now 
automatically get forwarded to the new "page".

On the Seaside app, such a forward invokes the #availablebaby method of 
the BBIndex component (because of the mods I made).

The BBIndex component has a header component (the top-most button menu 
on the web pages), a footer component (the bottom-most link menu on the 
web pages), and a replaceable/embedded "body" component.  The 
#availablebaby method just puts a lazily created and then cached 
instance of the BBAvailableBaby component into this "body" (cached on a 
per-BBIndex instance basis, which also means it is cached on a 
per-WASession basis).

This #availablebaby method also happens to be the action method for the 
"Available Babies" menu button (header) and menu link (footer) on all 
the pages.

Thus, all of the old bookmarks that customers have still work.  And, I 
can also email somebody a URL that gives them an arbitrary entry point 
into the app.  For example, for the "Available Babies" entry point, I 
would email them this:

    http://www.bountifulbaby.com/seaside/index/availablebaby

Try that link and you will see that it works.

Nevin




More information about the Seaside mailing list