Parallels H-Sphere Documentation Customization Guide


Merging XML Configuration Files


Related Docs:   XML Manager Customizing XMLs With Packages

Last modified: 18 Oct 2007


WARNING: This documentation covers Parallels H-Sphere versions up to 3.1. For the latest up-to-date Parallels H-Sphere documentation, please proceed to the official Parallels site.


Customizable XML Configuration Files

The following H-Sphere components are configured by means of XML files:

Component Property
Default Location
CP Skins (Designs) DESIGN_SCHEME_CONFIG /hsphere/local/home/cpanel/shiva/psoft/hsphere/design_config.xml
CP Menu MENU_CONFIG /hsphere/local/home/cpanel/shiva/psoft/hsphere/menu.xml
CP Crons CRON_CONFIG /hsphere/local/home/cpanel/shiva/psoft/hsphere/cron_config.xml
Online (Context) Help HELP_CONFIG,
Promotion Validators And Calculators PROMO_CONFIG /hsphere/local/home/cpanel/shiva/psoft/hsphere/promotion/xml/promotions.xml
Merchant Gateways MERCHANT_GATEWAYS_CONF /hsphere/local/home/cpanel/shiva/psoft/hsphere/merchants.xml
Domain Registrars REGISTRAR_CONF /hsphere/local/home/cpanel/shiva/psoft/hsphere/registrar.xml
E-Mail Notifications USER_EMAILS /hsphere/local/home/cpanel/shiva/psoft/hsphere/user_emails.xml


XML Customization Step By Step

Custom XML files can be merged with default XML files by means of XML merger. Instead of moving and changing a default XML file, a small custom file is created containing only the changes to be implemented, and its location is specified in in the parameter with the "CUSTOM_" prefix added to the default parameter name. For example:

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

Go through the following steps to customize your XML configuration files:

  1. Login as cpanel user.
  2. Create a directory for custom XML configuration files if it does not exist, for example, ~cpanel/custom/xml.
  3. In the custom directory, create a custom XML file if it hasn't been created yet. Here, you add only those tags that need to be added or modified with relation to the default XML file. Please follow the rules for merging XMLs.

    For example, if you need just to add a new item to the menu, the custom menu.xml file will look like:

    <?xml version="1.0"?>
    <!DOCTYPE config [
     <!ELEMENT config (menus,interface)>
      <!ELEMENT menus (menu+)>
      <!ELEMENT menu (menuitem*,initmenu*)>
      <!ELEMENT menuitem (#PCDATA)>
      <!ELEMENT initmenu (#PCDATA)>
      <!ELEMENT interface (menudef+)>
      <!ELEMENT menudef (initmenu*,menuitem*)>
      <!ATTLIST menudef id CDATA #REQUIRED>
      <!ATTLIST menu name CDATA #REQUIRED>
      <!ATTLIST menu label CDATA #REQUIRED>
      <!ATTLIST menu platform_type CDATA "">
      <!ATTLIST menu resource CDATA "">
      <!ATTLIST menu defaultitem CDATA #REQUIRED>
      <!ATTLIST menu tip CDATA "">
      <!ATTLIST menuitem name CDATA #REQUIRED>
      <!ATTLIST menuitem label CDATA #REQUIRED>
      <!ATTLIST menuitem platform_type CDATA "">
      <!ATTLIST menuitem resource CDATA "">
      <!ATTLIST menuitem tip CDATA "">
      <!ATTLIST menuitem check_type CDATA "1">
      <!ATTLIST menuitem new_window CDATA "0">
      <!ATTLIST initmenu name CDATA #REQUIRED>
    <menu name="info" label="info.label" defaultitem="info-plans" tip="info.tip">
      <menuitem name="new_item" label="NEW PAGE" URL="/newpage.html" resource="" tip="Positive Software Corporation"/>

    In the custom XML file to be merged with the default one, you must define the same DTD structure!

  4. In ~cpanel/shiva/psoft_config/, add the location for the custom XML file, for instance:

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

  5. Login as root (log off from cpanel) and restart H-Sphere.

Related Docs:   XML Manager Customizing XMLs With Packages

© Copyright 2018. Parallels Holdings. All rights reserved.