This patch is extracted from my own extension to Tclhttpd, and adds new commands to the global namespace:
::Object_Url {virtual object {inThread 0}}
::Obj_UrlRemove {object}
::Objdomain {object sock suffix}
::Object_Respond {sock code result {type text/html}}
These commands inject specially designed objects into the Direct() array, and allow those objects to export methods as direct URLS.
Each object referenced is assumed to have at least these 5 methods:
Translate an id into an object:
method urlObjectFromId id { ... }
Throw errors if security tokens are not in order
method urlPrelim {} { ... }
# Perform any object specific cleanups on
# something that has been displayed
method urlPostlim object { ... }
# Take raw output from an object and format it
# into the final HTML result
method urlTemplateApply infodict { ... }
# Translate a combination of the url suffix and post data
# into an object method and key/value list of arguments to feed it
method urlMarshallArguments {url nvlist} { ... }
(All object methods exposed are assumed to accept a single key/value list as an argument)
New file to add to distro