[Seaside] expiring pages

Lukas Renggli renggli at iam.unibe.ch
Mon Jul 19 11:36:43 CEST 2004


> I know about session isolate: [] but I can't quite figure out how to 
> use
> it here. This is seaside 2.3. The component works like
>
> -render all nodes
> -action to add/delete node
> -repeat until save/cancel
>
> So for example after the user deletes a node I want to make the 
> previous
> pages expired so that they can't go back and work with the deleted 
> node.

Hi,

as far as I remember Seaside 2.3 did #isolate: on the session level. In 
one of our older web-applications I found the following code, that does 
exactly what you requested:

- create a subclass of your session class:

WAControllerSession subclass: #MySession
	instanceVariableNames: 'transactionFilter '
	classVariableNames: ''
	poolDictionaries: ''
	category: ''

- add the following methods:

MySession>>initialize
	super initialize.
	self isolate.

MySession>>isolate
	transactionFilter := WATransaction new.
	self addFilter: transactionFilter

MySession>>invalidate
	self removeFilter: transactionFilter.
	transactionFilter close.
	self bookmarkForExpiry.
	self isolate.

- now you can call 'self session invalidate' from you component-actions 
to invalidate all the previous pages.

I'm sure something similar can be done on component level with the 
decorator framework in Seaside 2.5.

Hope this helps,
Lukas

-- 
Lukas Renggli
http://renggli.freezope.org



More information about the Seaside mailing list