We briefly discussed this some time ago, just wanted to bring it up
again and maybe get some fresh ideas as it is still something I am
interested in doing. And also ask a sanity check from those with better
knowledge of the AOLserver core.
The goal would be to have simple deployable application modules, quite
like a "WAR" file in J2EE. Let's codename it "AOLserver Application
Package", or AAP for short. (yes, that is Dutch for "monkey")
This would give the advantage that it would be easy to deploy any open
source applications written for AOLserver without having to copy loads
of files into the right location or do much editing the global nsd.tcl.
Just drop it in and go. You could even do it the Tomcat way; just drop
the .aap file in the "applications" directory and it will unpack and
bind it to a url automatically.
In the simplest form this would look something like:
/modules/tcl/ <-- Tcl library files
/pages/ <-- adp, html, images, etc.
/config.tcl <-- application level config file
You should then be able to deploy this application to a root, like
"/openacs", or simply "/". (developers need to make sure they only use
relative urls in their html!)
Initialy I thought this was something that needed to go into the core,
but now I am thinking a module could do it. You could load the "ns_aap"
module in the server of choice with a section like
"ns/server/server1/aap" listing the applications to be loaded and
"ns/server/server1/aap/my_aap" can list config values for the AAP in
question.
Using functionality found in ns_rewrite (where did that disappear to?)
we should be able to map anything under the designated root to the AAP's
pages directory.
Now for the hard parts:
- Library loading: Could the module instruct the server to source the
Tcl library files from the application? Ns_TclInitModule does something
like it, but is limited to the server's modules/tcl directory. It also
stores it by name in a Tcl list, so I guess the path expansion happens
further down. That may need a core change after all.
- Application protection: an application that is a good citizen could
run in the normal shared interpreter pool, but applications not using
their own namespaces or non-prefixed nsv keys need to be seperated. I
know you can have different thread pools, but would it be possible to a)
create these at runtime by the ns_aap module and b) load them with the
application's Tcl lib, not the server global one? I do consider this to
be an optional one, I could live without it; developers just have to
follow the rules.
- registered procedures and traces. The root should be taken into
account when registering these in the the AAP's init.tcl. I guess the
module could overwrite the appropriate procedures with wrapper that does
just that before the application's Tcl lib is sourced.
I'd love to hear back from the usual suspects (and others!) about their
views on the implementation of this.
Cheers,
Bas.
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]>
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject:
field of your email blank.