A simple introduction to Seaside

I took about a month off technical postings in this blog mostly because of the many trips I made over the past 2 months but I’m back again! Let me start the new year by coming back to a topic that seems (surprisingly) popular amongst my blog readers — Seaside on Squeak.

The last I left off, I was explaining how the Squeak environment works. I’ll not talk more about Squeak this time round and focus on Seaside but you should know that this posting and most likely all my postings on Seaside are based on Squeak. I tried Cincom Smalltalk for a short while, but my personal preference is still Squeak, probably because I started with it first.

In this post, my focus is on getting you to run Seaside the fastest way possible, so I’ll drop out most of the features and comparison discussions for another time.

You can find most if not all Seaside materials, downloads and links in the Seaside main site (http://www.seaside.st). Assuming you already have Squeak running (if not please refer to my earlier post), you should download this image (http://www.seaside.st/Download/Images/). There are other images with more features or tighter configurations though, if you dig around the Seaside main site or Google for it.
Load this image. You should get something like this:

Seaside startup

In the ‘Welcome to Seaside’ window you should see some instructions and a simple explanation on how to get started. What always tickled me pink on is that this apparently ‘readme’ file is also a point for executing Seaside! It took me a couple of minutes (when I first encountered this) to realise that to start up Seaside you just have to select the ‘WAKom startOn: 8080.’ line in the window, right-click and select the ‘do-it’ action on the menu (the one with the lightning icon). That’s it! You’ve just started Seaside.

Go back to your normal browser, go to ‘http://localhost:8080/seaside/counter’ and you should see the application running. What is also interesting is that if you save this image before you exit Squeak (and therefore Seaside), the next time you start Squeak with this image, Seaside starts automatically. It seems pretty obivious if you think about it, but it’s one of those nice little things that normally don’t get with other environments.

Login into the Seaside configuration application and muck around with that a bit. You should see a list of applications that have already been installed as samples. One of the more interesting samples is the Sushi store. You should browse around that one to see how things work.

By now you’ll notice the Seaside toolbar at the bottom of each web application. This toolbar is another interesting feature in Seaside web applications. It’s there in all applications and you can use it to configure, test or even program the application right there and then!

Click on the Toggle Halos link. You’ll a box surrounding each component on the web page. Each component has 3 icons — System Browser, Inspector and Style Editor. The Style Editor allows you to change the look and feel of the application using CSS styles. The Inspector allows you to look into each component in details while the System Browser is very much like the System Browser in Squeak and allows you to change the behavior of the component itself.

If you want to disable the Seaside toolbar, click on ‘Configure’ in the toolbar. Under the ‘General’ heading you will see a ‘Deployment Mode’ option, which is set to ‘false’ by default (the value is inherited from WAGlobalConfiguration). Click on the ‘override’ link and this will give you an option to change it to ‘true’. Do that, then scroll to the bottom of the web page and save your configuration, then click on ‘done’ to exit the configuration application and the toolbar should go away. If it doesn’t, just remove the session tied to the URL at your browser or refresh the page.

This is a very simple whirlwind introduction to running Seaside. The next post on Seaside I’ll go into writing a simple web application. If you are eager to know more and can’t stand my rambling style, try David Shaffer’s excellent tutorial (http://www.shaffer-consulting.com/david/Seaside/) or the famous A Walk on the Seaside tutorial (http://www.seaside.st/Tutorial/AWalkontheSeaside/). Another great resource is Stephane Ducasse’s videos (http://www.iam.unibe.ch/~ducasse/Videos/ )