Merging XML Configuration Files

To customize XML configuration files:

  1. Login as the 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 URL 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>

    ]>

    <config>

    <menus>

    <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"/>

    </menu>

    </menus>

    </config>

    Important: 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/hsphere.properties, 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 Parallels H-Sphere.