Exporting Theme Policies in WP7

Exporting Theme Policy in WP7 is changed little bit compared to previous versions.

To Export all Theme Policies in previous Versions(till 6.1.5) XML looks like below

a)      To export all theme policies

<?xml version="1.0" encoding="UTF-8"?>
<request xsi:noNamespaceSchemaLocation="PortalConfig_1.4.xsd"
 create-oids="true" type="export"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     <portal action="locate">
        <policy-node action="export" label="WebPage"
                type="theme" path="">
             <url>file:///c:/temp/exportThemePolicies.xml</url>
        </policy-node>
    </portal>
</request>

b)      To export specific theme policy

<?xml version="1.0" encoding="UTF-8"?>
<request xsi:noNamespaceSchemaLocation="PortalConfig_1.4.xsd"
 create-oids="true" type="export"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <portal action="locate">
        <policy-node action="export" label="WebPage"
                type="theme" path="TestThemePolicy">
             <url>file:///c:/temp/exportTestThemePolicy.xml</url>
        </policy-node>
    </portal>
</request>


But from WP 7.0.X onwards , XML will be like below

a)      To export all theme policies

<?xml version="1.0" encoding="UTF-8"?>
<request xsi:noNamespaceSchemaLocation="PortalConfig_7.0.0.xsd" 
         create-oids="true" type="export"  
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <portal action="locate">
        <policy-node action="export" path="/theme" />
    </portal>
</request>

b)      To export the specific theme policy

<?xml version="1.0" encoding="UTF-8"?>
<request xsi:noNamespaceSchemaLocation="PortalConfig_7.0.0.xsd"
         create-oids="true" type="export"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <portal action="locate">
        <policy-node action="export" path="/theme/TestThemePolicy" />
    </portal>
</request>

c)      To delete theme policy

<request xsi:noNamespaceSchemaLocation="PortalConfig_7.0.0.xsd"
         create-oids="true" type="update"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <portal action="locate">
        <policy-node action="delete" path="/theme/TestThemePolicy">
        </policy-node>
    </portal>
</request>

Run the following xmlacess command ( at /ibm/websphere/portalserver/bin/ )
xmlaccess.bat -in c:/siva_work/exportThemePolicy.xml -url http://localhost:10039/wps/config -user wpsadmin -password wpsadmin –out c:/siva_work/exportThemePolicyResults.xml

4 comments:

  1. Hello,
    I'm trying to export policies in a Portal 6.1 instance and import them into a Portal 7. Generated xml in portal 6.1 cannot be imported in 7 as you state in this blog entry so... do you know how I can generate a xml with the policies in Portal 6.1 so they can be imported in Portal 7? Thanks.

    ReplyDelete
    Replies
    1. You may not be able import WP6.1 policies directly into WP7 because of schema changes...etc, Once you export theme policy from WP6.1 copy the policy nodes that you want add it to WP7 . Then append nodes to theme policies xml that is exported from WP7 and then import into WP7.

      Delete
  2. Thanks Siva,
    I finally could not make it so I recreated policies in the Portal 7 Dev server. Now I have to do something simple: export and import from Portal 7 Dev to Portal 7 Quality server. I've exported as you explain in this page but... how do I import them in target portal?
    thanks

    ReplyDelete
  3. Its always better to export the existing theme policies from the target environment (i.e your quality center) and add these policy definitions manually in the result file and import it.
    Importing is stright forward , either you can use "import XML" option from portal admin console or you can use the simple xmlaccess command like below to import it
    xmlaccess.bat -in c:/temp/yourupdatedPolicyfile.xml -url http://localhost:10039/wps/config -user wpsadmin -password wpsadmin

    ReplyDelete