XML Customization With Packages

This document dwells on building Parallels H-Sphere packages to customize XML configuration files.

Some custom XML files can be merged with default XMLs by means of XML merger. Instead of moving and changing a default XML file, a small custom file is created containing necessary changes and its location is specified in ~cpanel/shiva/psoft_config/hsphere.properties in the parameter with the "CUSTOM_" prefix added to the default parameter name, e.g.:

MENU_CONFIG = /hsphere/local/home/cpanel/shiva/psoft/hsphere/menu.xml

CUSTOM_MENU_CONFIG = /hsphere/local/home/cpanel/shiva/custom/xml/menu.xml

To build packages with custom XMLs:

  1. Log into CP server as the cpanel user.
  2. Create Custom XML files

    Custom XML files should contain only parts to be added to or to modify default XMLs. During the package installation these custom files will be merged with default XMLs. Please refer to the XML Manager guide for examples.

  3. Run Package Configurator.

    Run package configurator in the package directory you created with the following options, at least:

  4. Configure the Package

    To include custom XMLs into the package configuration, add corresponding parameters into the package properties file. Go to the src/pkg_config directory of the package directory (~cpanel/custom/packages/MyPackage in the above example).

    Edit the default.properties file. It will be empty if you did not specify the path to the package properties file in the --with-properties option of package configurator.

    You don't need to copy all contents of the default hsphere.properties file to your package properties file. Only add custom parameters that will be merged with the default ones when the package is installed.

    In the package properties file, specify just the names of the XML config files to be customized, without paths to the. For example, to include changes in menu and designs, just add these lines to the properties file:

    # Custom design

    DESIGN_SCHEME_CONFIG=design_config.xml

    # Custom menu

    MENU_CONFIG=menu.xml

    After you have configured package properties, proceed to other package configuration options required.

  5. Run Package Builder

    Run package builder to build the package, for example:

    java psoft.hsp.tools.PkgBuilder --with-source=/hsphere/local/home/cpanel/custom/packages/MyPackage

    The package will be assembled to the .hsp Jar file in the current directory.

  6. Install the Package

    Login as cpanel and run package installer, for example:

    java psoft.hsp.tools.PkgInstaller --package=./MyPackage