[Seaside] [enh] once:

radoslav hodnicak rh at 4096.sk
Wed Sep 8 18:09:31 CEST 2004


I ported the #once: filter from 2.3. It even seems to work.
(for those who don't know it, once: allows every page to be displayed
only... once)

rado
-------------- next part --------------
'From Squeak3.6 of ''6 October 2003'' [latest update: #5424] on 8 September 2004 at 5:53:14 pm'!
WATransaction subclass: #WAOnce
	instanceVariableNames: 'seenKeys '
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Seaside-Components-Decorations'!

!WACallbackStream methodsFor: 'as yet unclassified' stamp: 'rh 9/8/2004 17:33'!
request
	^request! !


!WAComponent methodsFor: 'convenience' stamp: 'rh 9/8/2004 17:40'!
once: aBlock
	|txn val |
	txn _ WAOnce new.
	val _ self decorateWith: txn during: aBlock.
	txn close.
	^ val! !


!WAOnce methodsFor: 'as yet unclassified' stamp: 'rh 9/8/2004 17:38'!
initialize

	super initialize.
	seenKeys := Set new.! !

!WAOnce methodsFor: 'as yet unclassified' stamp: 'rh 9/8/2004 17:37'!
processChildCallbacks: aStream

	| key |
	key := aStream request fields at: self session actionField.
	^(seenKeys includes: key)
		ifTrue: [self session pageExpired]
		ifFalse: [seenKeys add: key. super processChildCallbacks: aStream]! !



More information about the Seaside mailing list