This post originated from an RSS feed registered with Agile Buzz
by James Robertson.
Original Post: Blog Management Progress
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
I've finally gotten around to creating some tools for automating the management of the blog server. This afternoon I knocked out a web interface for creating a new blog, and finished up the interface for disabling existing blogs. Other than the tedium of creating the SSP pages, it was all pretty easy - the only place that gave me a small hitch was the resetting of server state. Here's what I was doing at first:
The problem is, I was doing that in the #doPost method of a servlet, and on the page I was redirecting to there was an expectation of finding a session variable called 'currentUser'. In its absence, the page redirected over to the login page. This confused me for a few minutes, until the obvious dawned on me - clearing all the sites also cleared all existing session state - so of course there were no session variables left! As it happens, the WebToolkit has a very straightforward API, so I went and looked at class WebSite. What I wanted to do was programmaticall add a site, or remove a site (depending on which management page is in use. Here's all I had to do: