+

Search Tips   |   Advanced Search

Binding the theme to the context root of the web application

We must bind the theme to the context root of the web application for the theme.

  1. In PORTAL_HOME/bin, create the file input.xml with the following contents:
    <?xml version="1.0" encoding="UTF-8"?>
    <request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PortalConfig_8.5.0.xsd" type="export">
         <portal action="locate">
            <skin action="export" objectid="*" />
            <theme action="export" objectid="*" />
        </portal>
     </request>

  2. Export all skin and theme definitions to a file called output.xml:

    cd PORTAL_HOME/bin  ./xmlaccesss.sh -user <admin userid> \
     -password <admin password> \
     -url host:10039/wps/config \
     -in input.xml \
     -out output.xml

  3. Edit the output.xml file.

    Search for the title of the theme, such as Custom Theme. Scroll up to the line with the surrounding <theme> tag; it is likely the last <theme> tag in the file. Modify it from:

    <theme action="update" active="true" context-root="/wps/themeModules" default="false" domain="rel" objectid="ZJ_MLSU3F54089F00IP6G7P3F10S5" resourceroot="dynamicSpots">

    ...to...

    <theme action="update" active="true" context-root="/myTheme" default="false" domain="rel" objectid="ZJ_MLSU3F54089F00IP6G7P3F10S5" resourceroot="dynamicSpots" uniquename="myTheme">

    ...setting the correct context-root and uniquename for your theme.

  4. Search for the title of the skin. Scroll up to the line with the surrounding <skin> tag; it is likely the last <skin> tag in the file. Modify it from:
    <skin action="update"        
        active="true"        
        context-root="/wps/themeModules"        
        default="false"        
        domain="rel"        
        objectid="ZK_73OKBB1A088IE0I5O7IP2J0G77"        
        resourceroot="Hidden"        
        type="default">

    ...to...

    <skin action="update"        
        active="true"        
        context-root="/myTheme"        
        default="false"        
        domain="rel"        
        objectid="ZK_73OKBB1A088IE0I5O7IP2J0G77"        
        resourceroot="customSkin"        
        type="default"        
        uniquename="customSkin">

    ...setting the correct context-root, resourceroot, and uniquename for the skin.

  5. Find the <theme> tag for the Portal 8.5 theme, it is likely the first <theme> tag in the file.

    Find and copy one of the <allowed-skin> tag lines, such as:

      <allowed-skin skin="ZK_CGAH47L00GJJ40IDC03MS13OS2" update="set"/>

    Find the <theme> tag for the myTheme theme, it is likely the last <theme> tag in the file. Paste the <allowed-skin> tag line in just before the <parameter> tags. Modify the skin parameter value identifier to be the identifier of the customSkin skin, which can be found in the objectid parameter of the <skin> tag of the customSkin skin, likely the last <skin> tag in the file, such as:

    <allowed-skin skin="ZK_N0IEGGC0I08PF0IDQ60O6310N4" update="set"/>

  6. Find the com.ibm.portal.layout.template.href parameter for the myTheme theme. Modify it from:

    <parameter name="com.ibm.portal.layout.template.href" type="string" update="set"><![CDATA[dav:fs-type1/themes/Portal8.5/layout-templates/2ColumnEqual/]]>
    </parameter>

    ...to...

    <parameter name="com.ibm.portal.layout.template.href" type="string" update="set"><![CDATA[dav:fs-type1/themes/myTheme/layout-templates/2ColumnEqual/]]>
    </parameter>

    ...setting the correct context-root, resourceroot, and uniquename for the layout template.

    Verify the URI is encoded. If there are spaces or other characters that are not allowed, the theme does not work.

  7. Update the skin and theme definitions according to the change:

    xmlaccess.sh -user admin userid \
                 -password admin password \
                 -url hostname:10039/wps/config \
                 -in output.xml \
                 -out output2.xml

  8. Export all skin and theme definitions again to a file called output3.xml.

    ./xmlaccess.sh -user admin userid \
     -password admin password \
     -url hostname:10039/wps/config \
     -in input.xml \
     -out output3.xml

  9. Edit the output3.xml file to verify the result works, and then delete the input.xml, output.xml, output2.xml, and output3.xml files.


Parent Link the static resources to the dynamic resources for the theme