[Bese-devel] expired sessions
Marco Baringer
mb at bese.it
Sat Jul 24 11:28:02 UTC 2004
Marco Baringer <mb at bese.it> writes:
> while it works the api is still kind of odd, i'll use it a bit and see
> what it should be (of course, you could use it and tell me what you'd
> like too).
i win! i win! i beat you all to it! :)
here's the new api:
*action-url-generator* is special variable which must be bound (during
the entire service and rendering phase) to a 0 arg function. this
function must return a string which can be used as the "base" of an
action url. the generic function generate-action-url is specialized on
the current application and returns a complete url. the default
implementation of generate-action-url (specialized on
standard-appliciation (not standard-request-context)) calls
*action-url-generator*, prepends the application's url-root and
appends the session-id, frame-id and action-id parameters. this seems
like a good, default, balance between use of use and flexibiltiy, if
you really want to do weird things just define generate-action-url on
your own custom application class. nb: generate-action-url must be
able to handle nil values for session-id, frame-id and action-id (this
to accomadate our form handling stuff).
what this means, in practice, is that the default binding for
*action-url-generator* is simply:
(lambda () "index.ucw?")
[yes, this means you'll never see a ucw-action-call.ucw url ever
again]
this change moves much of the foot work of dealing with session-id,
frame-id and action-id parameters out the *action-url-generator* and
into a "core" method where developers don't have to worry about it.
as an exmple the documentation app can now simply bind
*action-url-generator* to the result of:
(defun doc-action-url-generator (node)
(lambda ()
(concatenate 'string "lookup.ucw?node-id=" (node.id node) "&")))
instead of the mess we had before.
--
-Marco
Ring the bells that still can ring.
Forget your perfect offering.
There is a crack in everything.
That's how the light gets in.
-Leonard Cohen
More information about the bese-devel
mailing list