Forum OpenACS Development: Re: Automated Install, Configuration, and Test

Posted by Randy O'Meara on
Here's another installment that describes the install.xml feature

Install.xml: Customized Installation

The following discussion describes actions performed in the acs-bootstrap-installer located in the /packages/acs-bootstrap-installer/installer directory. Unless otherwise noted, files discussed below are located relative to this directory. The install.xml file, located in the system's pageroot direcory, is processed in file index.tcl which places elements in an nsv named acs_application. These elements contained in this nsv are later processed in packages-install.tcl just after the core packages are installed with a call to apm_mount_core_packages. If the install.xml file is sucessfully parsed, a message is printed to the browser indicating that "The installer will automatically install the [specified] application after the basic OpenACS tookit has been installed"

The topmost install.xml element is application and, even though it looks possible that multiple application nodes may be presented in the install.xml file, only the first application node is processed. Also note that comments, delimited by the standard html comment markers (<!-- and -->), are allowed after the <?xml version> element and before the <application> element.

Analysis of packages-install.tcl  indicates that the following xml structure is valid within the install.xml file:

<application (although multiple application elements may exist, only first is processed)
        name= Used in displayed message during install (ex. "dotlrn")
        pretty-name= Used in displayed message during install (ex. ".LRN")
        home= Used in displayed message during install (ex. "")
        <actions> (only a single actions element is allowed)
                <text (all content within this element is ignored) />
                        package= A glob pattern, expanded at /packages/ (ex. "*" installs all packages)
                <mount (instantiates and mounts a package in site map at /mount-point)
                        package= Package_key of target package (ex. "dotlrn")
                        mount-point= Site node name. OK if node exists w/o package mounted (ex. "dotlrn")
                        instance-name= Site node instance name (ex. "dotLRN")
                <set-parameter (sets either a URL OR a package parameter)
                        <url= A valid mounted site map package instance (ex. "/")
                                name= A valid parameter for specified site node (ex. "DefaultMaster")
                                value= A value for specified parameter (ex. "/packages/dotlrn/www/dotlrn-master")
                        <package= A valid package_key (ex. "acs-kernel")
                                name= A valid parameter for specified package (ex. "IndexRedirectURL")
                                value= A value for specified parameter (ex. "/dotlrn/index")

In the description above (actually based on the dotLRN application install), the dotLRN application is installed and configured by:
  1. All packages in the /packages/ directory are installed (<install package="*"/>)
  2. The dotlrn package is instantiated and mounted in the site map at /dotlrn (<mount package="dotlrn" mount-point="dotlrn" instance-name="dotLRN"/>)
  3. The site DefaultMaster template is set to a the dotlrn-specific template file (<set-parameter url="/" name="DefaultMaster" value="/packages/dotlrn/www/dotlrn-master"/>). Note that the url form of the set-parameter action is used to set a parameter in specific instance of acs-subsite (the main subsite).
  4. The default site index page is set to /dotlrn/index by (<set-parameter package="acs-kernel" name="IndexRedirectUrl" value="/dotlrn/index"/>)
  5. The community member root URL is set to /dotlrn/community-member by (<set-parameter package="acs-kernel" name="CommunityMemberURL" value="/dotlrn/community-member"/>)
  6. The community member admin URL is set to /dotlrn/admin/user by (<set-parameter package="acs-kernel" name="CommunityMemberAdminURL" value="/dotlrn/admin/user"/>)