[Seaside] setting 'expiry seconds' dynamically
Avi Bryant
avi at beta4.com
Wed Sep 22 12:48:00 CEST 2004
On Sep 22, 2004, at 10:52 AM, Lukas Renggli wrote:
> Hi Lukas,
>
>> I'm new to Seaside and currently building a web-interface to a
>> existing database application. Therefore I want the user to be able
>> to set the 'timeout' or 'expiry seconds'. how can I do that
>> dynamically?
>
> create a customized subclass of WASession and override the message
> #defaultTimeoutSeconds to return an i-var:
>
> MySession>>defaultTimeoutSeconds
> ^self timeoutSeconds
>
> Add an i-var 'timeoutSeconds' and write some accessor-methods:
>
> MySession>>timeoutSeconds
> ^timeoutSeconds
>
> MySession>>timeoutSeconds: anInteger
> timeoutSeconds := anInteger
>
> Now you are able to set the timeout on a per-session bases from any
> component:
>
> MyComponent>>foo
> ...
> self session timeoutSeconds: 1234.
Heh. Look at WASession's superclass, WAExpiring handler. It already
has a timeout ivar and #timeoutSeconds: accessor. So in fact there's
no need to do a custom subclass - your implementation of
MyComponent>>foo will work out of the box.
Avi
More information about the Seaside
mailing list