Okay, now that I've looked at it a little closer, what I have in mind is this:
- Add 3 tags to the .info file and the apm_package_version table:
<post-install-proc>name::of_proc</post-install-proc>
This is the name of a Tcl procedure, which, if defined, will get called after the package's data model, parameters, *-procs.tcl, etc., have been loaded, but before the *-init.tcl files are loaded. -init files are loaded once post-install and auto-mount is done. (We need to have sourced the -procs files, because that's where the post-install procedure itself will be defined.)
<post-instantiate-proc>name::of_some::other_proc</post-instantiate-proc>
This is a replacement for the current "magic" post_instantiation proc. I figured it was cleaner to explicitly name both the post-install proc and the post-instantiation proc in the .info file. For backwards compatibility, we'll still look for a package_key_post_instantiation procedure. Also, the APM will, when generating XML files, check if there is such a proc defined, and if so, output the name using the <post-install-proc> tag (unless another post-install proc is already defined.
<auto-mount>foldername</auto-mount>
This would be the name of a folder to be created off of the root of the site-map for the new package instance created. If a folder by that name already exists, we just crap out. We're not trying to be fancy here, just make installation a bit more convenient.
Install sequence:
1) Install data model, parameters, etc.
2) Load -procs files
3) Run post-install proc
4) Create new instance if neceesary singleton or automount
5) Mount new instance if automount
6) Load -init files
In order to implement this, here's the code we'll have to touch:
- acs-kernel data model for both PG and Oracle, plus upgrade scripts for both. Bump up the version number.
- Add the extra parameters to apm_package_version.new PL/SQL proc, and to apm_package_install_version Tcl proc.
- apm_generate_package_spec to output these 3 extra tags
- apm_read_package_info_file should read those new tags.
- apm_package_install should add the 3 new parameters to its call to apm_package_install_version.
- apm_package_install should call post-install-proc.
- apm_package_install should instantiate and mount if auto-mount is present.
- Add the 3 new parameters to the acs-admin/www/apm/version-edit.tcl.
- apm_post_instantiation_tcl_proc_from_key should first look in apm_package_versions for the name of the proc to call, then if there's nothing there, try the normal package_key_post_instantiation proc.
- Fix the bootstrap-installer to use the normal APM procs to install the packages it installs. I haven't looked at this in detail yet, but I think we should get rid of acs-install.sql completely, and instead use auto-mount and post-install proc to take care of mounting, setting permissions, and starting the DBMS job to gather statistics. (packages-install.tcl, auto-install.tcl)
This is a larger effort than I thought it would be, so I'll postpone implementing this until next week when we're back.
Meanwhile, I'd appreciate your comments. I have very likely overlooked something.
/Lars