Working with Release Builder

I wanted to learn about how to use the ReleaseBuilder tool but i have only one portal server so i decided to create /release Virtual Portal on my local and then my base portal would be my staging server and i will use my /release portal as production or target server.

Please note one important point that the environment that you want to act as target of release builder should be empty. If your installing new portal server then you should execute ConfigEngine.sh empty-portal command on it to create empty portal. In my case i wanted to use a virtual portal as target of release builder so i decided to use ConfigEngine.sh create-virtual-portal command to create empty virtual portal.

I followed these steps to learn release builder

  • The create-virtual-portal configuration task requires few configuration properties to be set. I had two options to handle it either specify all those values using -Dpropertyname=propertyvalue format on the command line or i set those properties in /WebSphere/wp_profile/ConfigEngine/config/helpers/virtual_portal.properties file, which is Configuration template file for creating virtual portal.

    # VirtualPortalTitle: Title of the Virtual Portal
    VirtualPortalTitle=Release Builder Test
    # VirtualPortalRealm: Realm of the Virtual Portal
    VirtualPortalRealm=

    # VirtualPortalHost: Hostname of the Virtual Portal
    VirtualPortalHostName=

    # VirtualPortalContext: Context of the Virtual Portal
    VirtualPortalContext=/release

    # VirtualPortalNlsFile: File which contains language specific information for the Virtual Portal
    VirtualPortalNlsFile=

    # VirtualPortalObjectId: ObjectId of the Virtual Portal
    # The ObjectId is needed to modify, delete Virtual Portals and
    # can be obtained by running task list-all-virtual-portals
    # Note: Do not delete the default Virtual Portal (ObjectId ends with _0)
    VirtualPortalObjectId=


  • Once the virtual_portal.properties file is ready execute create-virtual-portal configuration task to create the release virtual portal. Use this command

    ./ConfigEngine.sh -DparentProperties=/software/IBM/WebSphere/wp_profile/ConfigEngine/config/helpers/virtual_portal.properties create-virtual-portal


  • Execute the ./ConfigEngine.sh list-all-virtual-portals task to make sure that the virutal portal is created on the target environment. This is how the output of list-all-virtual-portal should look like


  • If you try accessing http://localhost:10040/wps/portal/release URL you will get a blank page with message like this "Error 404: There is no content available. "


  • Now i want to use current state of my base portal as first release. so export full release from base portal using xmlaccess command like this

    ./xmlaccess.sh -in /software/IBM/WebSphere/PortalServer/doc/xml-samples/ExportRelease.xml -out /tmp/firstrelease.xml -url http://localhost:10040/wps/config


  • This is the first release so i cant use the release builder to find out the difference so i decided to import the first full release as it is on my virtual portal using xmlaccess command

    [root@spinfotech bin]# ./xmlaccess.sh -out /tmp/firstreleaseresult.xml -in /tmp/firstrelease.xml -url http://localhost:10040/wps/config/release


  • Now login into http://localhost:10040/wps/portal/release and you will see that it is same as that of the base virtual portal.


  • Login into your base virtual portal and create a 'Release Builder Test Page' page and add Welcome to WebSphere Portal portlet to it.


  • Export second release of the virtual portal by executing this command

    ./xmlaccess.sh -in /s -in /software/IBM/WebSphere/PortalServer/doc/xml-samples/ExportRelease.xml -out /tmp/secondrelease.xml -url http://localhost:10040/wps/config


  • Use the releasebuilder.sh to create difference in first and second release using command like this

    ./releasebuilder.sh -inOld /tmp/firstrelease.xml -inNew /tmp/secondrelease.xml -out /tmp/difference.xml

    Take a look at difference.xml file which has only one change which is the Release builder test page and it

    <?xml version="1.0" encoding="UTF-8"?>
    <!-- IBM WebSphere Portal/6.1.0.1 build wp6101_115_01 exported on Sun Mar 22 15:17:06 EDT 2009 from spinfotech.com/127.0.0.1 -->
    <request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" build="wp6101_115_01" type="update" version="6.1.0.1" xsi:noNamespaceSchemaLocation="PortalConfig_6.1.0.xsd">
    <portal action="locate">
    <content-node action="update" active="true" allportletsallowed="true" content-parentref="6_CGAH47L00G72502N5S2MAV00I3" create-type="explicit" domain="rel" objectid="6_H24EGKG108OV70I0KF8AMK20U4" ordinal="400" type="page" uniquename="com.wpcertification.releasebuilder">
    <supported-markup markup="html" update="set"/>
    <localedata locale="en">
    <title>Release Builder Test Page</title>
    </localedata>
    <parameter name="com.ibm.portal.IgnoreAccessControlInCaches" type="string" update="set"><![CDATA[false]]></parameter>
    <parameter name="com.ibm.portal.bookmarkable" type="string" update="set"><![CDATA[Yes]]></parameter>
    <parameter name="com.ibm.portal.remote-cache-expiry" type="string" update="set"><![CDATA[0]]></parameter>
    <parameter name="com.ibm.portal.remote-cache-scope" type="string" update="set"><![CDATA[NON-SHARED]]></parameter>
    <access-control externalized="false" owner="uid=wasadmin,o=defaultwimfilebasedrealm" private="false"/>
    <component action="update" active="true" deletable="undefined" domain="rel" modifiable="undefined" objectid="7_H24EGKG108OV70I0KF8AMK20U2" ordinal="100" orientation="H" skinref="undefined" type="container" width="undefined">
    <component action="update" active="true" deletable="undefined" domain="rel" modifiable="undefined" objectid="7_H24EGKG108OV70I0KF8AMK20U6" ordinal="100" orientation="V" skinref="undefined" type="container" width="undefined">
    <component action="update" active="true" deletable="undefined" domain="rel" modifiable="undefined" objectid="7_H24EGKG108OV70I0KF8AMK20U7" ordinal="100" skinref="undefined" type="control" width="undefined">
    <portletinstance action="update" domain="rel" objectid="5_H24EGKG108OV70I0KF8AMK20U3" portletref="3_CGAH47L00G72502N5S2MAV0G21" shareref="5_H24EGKG108OV70I0KF8AMK20U3"/>
    </component>
    </component>
    </component>
    </content-node>
    </portal>
    </request>


  • Import the difference.xml on your release virtual portal using the command like this

    ./xmlaccess.sh -in /tmp/difference.xml -out /tmp/differenceresult.xml -url http://localhost:10040/wps/config/release

    Take a look at Release virtual portal, you should see that "Release Builder Test Page" is added at the top level


  • Now lets go back to the base virtual portal and delete the Welcome to WebSphere Portal portlet from it.

  • Use the xmlaccess command to export third release from the base virtual portal using this command



    ./xmlaccess.sh -in /s -in /software/IBM/WebSphere/PortalServer/doc/xml-samples/ExportRelease.xml -out /tmp/thirdrelease.xml -url http://localhost:10040/wps/config


  • Use the releasebuilder command to get difference between second and third release using this command

    ./releasebuilder.sh -inOld /tmp/secondrelease.xml -inNew /tmp/thirdrelease.xml -out /tmp/difference2.xml

    If you open difference2.xml file you will notice that it has instructions to delete the Welcome to WebSphere Portal instance.

    <?xml version="1.0" encoding="UTF-8"?>
    <!-- IBM WebSphere Portal/6.1.0.1 build wp6101_115_01 exported on Sun Mar 22 18:58:42 EDT 2009 from spinfotech.com/127.0.0.1 -->
    <request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" build="wp6101_115_01" type="update" version="6.1.0.1" xsi:noNamespaceSchemaLocation="PortalConfig_6.1.0.xsd">
    <portal action="locate">
    <content-node action="update" content-parentref="6_CGAH47L00G72502N5S2MAV00I3" create-type="explicit" domain="rel" objectid="6_H24EGKG108OV70I0KF8AMK20U4" preserve-old-layout="true" type="page" uniquename="com.wpcertification.releasebuilder">
    <component action="update" domain="rel" objectid="7_H24EGKG108OV70I0KF8AMK20U2" ordinal="100" type="container">
    <component action="update" domain="rel" objectid="7_H24EGKG108OV70I0KF8AMK20U6" ordinal="100" type="container">
    <component action="delete" domain="rel" objectid="7_H24EGKG108OV70I0KF8AMK20U7"/>
    </component>
    </component>
    </content-node>
    </portal>
    </request>


  • Now import this xmlaccess on the release virtual portal



When your working with releasebuilder it is always better to check in your release.xml in the source control.

Important Note: In my sample since i was using the virtual portal on same machine as target i skipped few steps such as copying content of wp_profile_root/PortalServer/deployed/archive directory from stage to production. WHen you deploy a portlet its .war file gets copied to this directory. The XMLAccess file has reference to this directory. So if there is a portlet that is installed on stage and not on production then at the time of importing out of release builder it will install portlets copied in /deployed/archive directory on production. If it cant find the portal in this directory then xmlaccess will fail.


IN addition to this take a look at Manual steps prior to using ReleaseBuilder for more information what other steps are required.

1 comment:

Dan Shapira said...

A problem occurs if you try to use releasebuilder to synchronize the same Virtual Portal on 2 servere.

in this case the one export will include:
url-mapping-context action="update" domain="rel" label="xxxx" objectid="ZC_8100HBO0HOR5C0I1RFN7CL34Q3"

and the other:
url-mapping-context action="update" domain="rel" label="xxxx" objectid="ZC_HO961BO0HOK950I1RM4UVI3003"

(Notice: diferance in objectid)

releasebuilder tryed to make the objectid identisk by generating delete/define :

url-mapping-context action="delete" domain="rel" objectid="ZC_8100HBO0HOR5C0I1RFN7CL34Q3"

url-mapping-context action="update" domain="rel" label="xxxx" objectid="ZC_HO961BO0HOK950I1RM4UVI3003"

But the is not leagel and results in an error:
EJPEC0620E: The virtual portal's root context cannot be
deleted.