Reference: Sample XML configuration files


This topic lists the contents of several sample files suitable for different purposes of portal configuration using XMLAccess. The sample files are also located in your WebSphere Portal installation in the directory wp_root/doc/xml-samples.

 

 

Sample file Export.xml

<?xml version="1.0" encoding="UTF-8"?>

<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xsi:noNamespaceSchemaLocation="PortalConfig_1.3.xsd"
         type="export"
         export-users="false">
    
    <!-- 
    Export the complete portal configuration (not including users). 

    Exporting users is not desirable when you transfer configurations between different 
    portal installations because the systems should be configured to use the same LDAP.
    It may, however, be useful when transferring configurations between development
    installations. 

    See also: ExportAllUsers.xml 
    -->

    <portal action="export"/>

</request>

 

Sample file ExportPage.xml

<?xml version="1.0" encoding="UTF-8"?>

<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="PortalConfig_1.3.xsd"
         type="export">

    <!-- sample for exporting a page -->

    <portal action="locate">
    
        <content-node action="export" 
                      uniquename="wps.SamplePage"/>

    </portal>
</request>

 

Sample file ExportPageResult.xml

<?xml version="1.0" encoding="UTF-8"?>
<!-- IBM WebSphere Portal/5.0 build @build.number@ exported on Mon Jun 16 16:23:46 CEST 2003 from darkwing/9.152.231.63 -->
<!-- 1 [content-node 6_0_A Content Root] -->
<!-- 2 [content-node _6_3HNGO0880305CK6G_35 My Portal] -->
<!-- 3 [content-node _6_3HNGO0880305CK6G_CM Sample Page uniquename=wps.SamplePage] -->
<!-- 4 [component _7_3HNGO0880305CK6G_GD] -->
<!-- 5 [component _7_3HNGO0880305CK6G_GE] -->
<!-- 6 [web-app _1_3HNGO0880305CK6G_6B uid=com.ibm.wps.portlets.welcome] -->
<!-- 7 [portlet-app _2_3HNGO0880305CK6G_6C uid=com.ibm.wps.portlets.welcome.1] -->
<!-- 8 [servlet _V_3HNGO0880305CK6G_6B] -->
<!-- 9 [portlet _3_3HNGO0880305CK6G_6D name=Welcome Portlet] -->
<!-- 10 [portletinstance _5_3HNGO0880305CK6G_9] -->
<request type="update" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xsi:noNamespaceSchemaLocation="PortalConfig_1.3.xsd">
    <portal action="locate">
        <web-app action="locate" objectid="_1_3HNGO0880305CK6G_6B" uid="com.ibm.wps.portlets.welcome">
            <servlet action="locate" objectid="_V_3HNGO0880305CK6G_6B"/>
            <portlet-app action="locate" name="Welcome" objectid="_2_3HNGO0880305CK6G_6C" 
                                 uid="com.ibm.wps.portlets.welcome.1">
                <portlet action="locate" name="Welcome Portlet" objectid="_3_3HNGO0880305CK6G_6D"/>
            </portlet-app>
        </web-app>
        <content-node action="locate" objectid="6_0_A Content Root" uniquename="wps.content.root"/>
        <content-node action="locate" objectid="_6_3HNGO0880305CK6G_35 My Portal" 
                         uniquename="wps.My Portal"/>
        <content-node action="update" active="true" allportletsallowed="false" 
                         content-parentref="_6_3HNGO0880305CK6G_35 My Portal" create-type="explicit" 
                                 objectid="_6_3HNGO0880305CK6G_CM Sample Page" ordinal="400" skinref="undefined" 
                                 themeref="undefined" type="page" uniquename="wps.SamplePage">
            <supported-markup markup="html" update="set"/>
            <localedata locale="en">
                <title>Sample Page</title>
            </localedata>
            <access-control externalized="false" owner="undefined" private="false"/>
            <component action="update" deletable="undefined" maxsize="undefined" 
                                 modifiable="undefined" movable="undefined" nestable="undefined" 
                                         objectid="_7_3HNGO0880305CK6G_GD" ordinal="100" orientation="H" 
                                         skinref="undefined" type="container" width="undefined">
                <component action="update" deletable="undefined" maxsize="undefined" 
                                         modifiable="undefined" movable="undefined" objectid="_7_3HNGO0880305CK6G_GE" 
                                                 ordinal="100" skinref="undefined" type="control" width="undefined">
                    <portletinstance action="update" objectid="_5_3HNGO0880305CK6G_9M" 
                                             portletref="_3_3HNGO0880305CK6G_6D"/>
                </component>
            </component>
        </content-node>
    </portal>
    <status element="all" result="ok"/>
</request>

 

Sample file CreatePage.xml

<?xml version="1.0" encoding="UTF-8"?>
<request
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="PortalConfig_1.3.xsd"
    type="update"
    create-oids="true">

    <!-- Sample for creating a page that contains an existing portlet. 
         This sample is very similar to DeployPortlet; the difference is that the portlet
         is not deployed (update actions) but only found (locate action).
         This sample also demonstrates how to set the skin for the new portlet and how 
         NLS settings (page title and description) can be read from properties files. -->
    <portal action="locate">

        <!-- skin for the portlet -->
        <skin action="locate" objectid="Shadow" uniquename="wps.skin.shadow"/>
        
        <!-- uid must match uid attribute of portlet-app in portlet.xml -->
        <web-app action="locate" uid="com.ibm.wps.portlets.welcome">
           <!-- uid must match uid attribute of concrete-portlet-app in portlet.xml -->
           <portlet-app action="locate" uid="com.ibm.wps.portlets.welcome.1">
                <!-- name must match content of portlet-name subtag  of concrete-portlet in portlet.xml -->
                <portlet action="locate" objectid="thePortlet" name="Welcome Portlet">
                </portlet>
            </portlet-app>
        </web-app>

        <!-- Parent element under which the new page is inserted -->
        <content-node action="locate" objectid="parentPage" uniquename="wps.My Portal"/>

        <!-- Note that the preceding elements are needed because the XML request uses ID generating mode
                and the new page must refer to the portlet and the parent place, so the object IDs
                thePortlet and wps.content.root.My_Portal must be defined.
                If you use ID preserving mode and have the correct objectid values for these two resources,
                you do not need to locate them. -->
        
        <!-- The new page. contentparentref attribute must match the objectid of the parent. 
                Change the uniquename attribute to create another page. -->
        <content-node action="update" uniquename="wps.SamplePage.2"  ordinal="last" 
                         content-parentref="parentPage" active="true" allportletsallowed="false" 
                                 create-type="explicit" type="page">
            <supported-markup markup="html" update="set"/>
            <!-- The title and description for the page are read from properties files. 
                    The property keys must end with the strings title, description, and keywords. (Pages do not support keywords.) 
                    The prefix attribute specifies a string that is prefixed to the property key 
                    so that you can keep titles for different resources in the same properties file. -->
            <localedata locale="en" prefix="page.sample">
                <url>file:///$server_root$/doc/xml-samples/pagetitles_en.properties</url>
            </localedata>
            <localedata locale="de" prefix="page.sample">
                <url>file:///$server_root$/doc/xml-samples/pagetitles_de.properties</url>
            </localedata>

            <component action="create" ordinal="100" type="container" orientation="H">
                <component action="create" ordinal="100" type="control" skinref="Shadow">
                    <!-- portletref must match the objectid attribute of portlet -->
                    <portletinstance action="update" portletref="thePortlet"/>
                </component>
            </component>
        </content-node>

    </portal>
</request>

 

Sample file DeployPortlet.xml

<?xml version="1.0" encoding="UTF-8"?>
<request
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="PortalConfig_1.3.xsd"
    type="update"
    create-oids="true">

    <!-- Sample for deploying a portlet and creating a page within the portlet. -->
    <portal action="locate">

         <!-- uid must match uid attribute of portlet-app in portlet.xml -->
        <web-app action="update" active="true" uid="com.ibm.wps.portlets.welcome">
           <url>file:///$server_root$/installableApps/WelcomePortlet.war</url>
           <!-- uid must match uid attribute of concrete-portlet-app in portlet.xml -->
           <portlet-app action="update" active="true" uid="com.ibm.wps.portlets.welcome.1">
                <!-- Name must match content of portlet-name subtag  of concrete-portlet in portlet.xml -->
                <portlet action="update" active="true" objectid="thePortlet" 
                                name="Welcome Portlet">
                </portlet>
            </portlet-app>
        </web-app>

        <!-- Parent element under which the new page is inserted -->
        <content-node action="locate" objectid="parentPage" uniquename="wps.My Portal"/>

        <!-- The new page. contentparentref attribute must match the objectid of the parent. 
             Change the uniquename attribute to create another page. -->
        <content-node action="update" uniquename="wps.SamplePage"  ordinal="last" 
                         content-parentref="parentPage" active="true" allportletsallowed="false" 
                                 create-type="explicit" type="page">
            <supported-markup markup="html" update="set"/>
            <localedata locale="en"><title>Sample Page</title></localedata>

            <component action="create" ordinal="100" type="container" orientation="H">
                <component action="create" ordinal="100" type="control">
                    <!-- The portletref must match the objectid attribute of the portlet -->
                    <portletinstance action="update" portletref="thePortlet"/>
                </component>
            </component>
        </content-node>

    </portal>
</request>

 

Sample file ClonePortlet.xml

<?xml version="1.0" encoding="UTF-8"?>
<request
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="PortalConfig_1.3.xsd"
    type="update"
    create-oids="true"
    transaction-level="request">
<!--
   Sample that clones an existing (concrete) portlet application.
   This sample requires the 'DeployPortlet.xml' sample to be executed
   successfully. The 'Welcome Portlet' deployed in that sample
   will be cloned and the new application will be activated along with its portlet.
   To prove everything worked, a new page will be created containing the
   cloned portlet. The page is linked to the 'My Portal' menu in the navigation.

    The Welcome Portlet does not have any portlet settings, but normally you
    would clone a portlet because you want to have a new version with
    different settings.
 -->
    <portal action="locate">
        <!-- skin for the portlet -->
        <skin action="locate" objectid="Shadow" uniquename="wps.skin.shadow"/>

                <!-- The web-app tag is taken from an export of the original portlet. The url and 
                         access-control tags were removed.
            -->
        <web-app action="locate" active="true" objectid="_1_3HNGO0880305CK6G_3B" 
                         removable="true" uid="com.ibm.wps.portlets.welcome">
            <!-- <url>file://localhost/$server_root$/installableApps/WelcomePortlet.war</url> -->
            <servlet action="update" active="true" objectid="_V_3HNGO0880305CK6G_3C" 
                                 referenceid="portletidwelcome"/>
            <portlet-app action="update" active="true" name="Welcome Portlet Clone" 
                                 objectid="_2_3HNGO0880305CK6G_3B" uid="com.ibm.wps.portlets.welcome.1">
                <portlet action="update" active="true" defaultlocale="en" 
                                         name="Cloned Welcome Portlet" objectid="_3_3HNGO0880305CK6G_3C" 
                                                 servletref="_V_3HNGO0880305CK6G_3C">
                    <localedata locale="en">
                        <title>About WebSphere Portal Clone</title>
                        <description>Displays Vand Copyright Statement</description>
                        <keywords>${portlet.keywords}</keywords>
                    </localedata>
                    <parameter name="url" type="string" update="set">/html/wps.jsp</parameter>
                </portlet>
            </portlet-app>
        </web-app>

        <!-- parent element under which the new page is inserted -->
        <content-node action="locate" objectid="parentPage" uniquename="wps.My Portal"/>

        <!-- new page. contentparentref attribute must match objectid of parent 
             change the uniquename attribute to create another page -->
        <content-node action="update" uniquename="wps.SamplePage.3"  ordinal="last" 
                         content-parentref="parentPage" active="true" allportletsallowed="false" 
                                 create-type="explicit" type="page">
            <supported-markup markup="html" update="set"/>
            <!-- The title and description for the page are read from properties files. The property keys must end 
                                   with the strings title, description, and keywords. (Pages do not support keywords.) The prefix 
                                           attribute specifies a string that is prepended to the property key, so that you can keep titles 
                                           for different resources in the same properties file -->
            <localedata locale="en">
                <title>Welcome Portlet (Cloned)</title>
            </localedata>

            <component action="create" ordinal="100" type="container" orientation="H">
                <component action="create" ordinal="100" type="control" skinref="Shadow">
                    <!-- portletref must match objectid attribute of portlet -->
                    <portletinstance action="update" portletref="_3_3HNGO0880305CK6G_3C"/>
                </component>
            </component>
        </content-node>

    </portal>
</request>

 

Sample file ModifyPortlet.xml

<?xml version="1.0" encoding="UTF-8"?>
<!-- IBM WebSphere Portal/5.0 build @build.number@ exported on Mon Jun 16 17:04:36 CEST 2003 from darkwing/9.152.231.63 -->
<!-- 1 [web-app _1_3HNGO0880305CK6G_6B uid=com.ibm.wps.portlets.welcome] -->
<!-- 2 [servlet _V_3HNGO0880305CK6G_6B] -->
<!-- 3 [portlet-app _2_3HNGO0880305CK6G_6C uid=com.ibm.wps.portlets.welcome.1] -->
<!-- 4 [portlet _3_3HNGO0880305CK6G_6D name=Welcome Portlet] -->
<!-- 5 [portlet _3_3HNGO0880305CK6G_6E name=Cloned Welcome Portlet] -->
<!-- 6 [content-node 6_0_A Content Root] -->
<!-- 7 [content-node _6_3HNGO0880305CK6G_35 My Portal] -->
<!-- 8 [content-node _6_3HNGO0880305CK6G_CM Sample Page uniquename=wps.SamplePage] -->
<!-- 9 [component _7_3HNGO0880305CK6G_GD] -->
<!-- 10 [component _7_3HNGO0880305CK6G_GE] -->
<!-- 11 [portletinstance _5_3HNGO0880305CK6G_9M] -->

<!-- this is an exported portlet, which will be modified now.-->
<request type="update" create-oids="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xsi:noNamespaceSchemaLocation="PortalConfig_1.3.xsd">
    <portal action="locate">
        <web-app action="update" active="true" objectid="_1_3HNGO0880305CK6G_6B" 
                         removable="true" uid="com.ibm.wps.portlets.welcome">
            <url>file://localhost/$server_root$/installableApps/WelcomePortlet.war</url>
            <access-control externalized="false" owner="undefined" private="false"/>
            <servlet action="update" active="true" objectid="_V_3HNGO0880305CK6G_6B" 
                                 referenceid="portletidwelcome"/>
            <portlet-app action="update" active="true" name="Welcome" 
                                 objectid="_2_3HNGO0880305CK6G_6C" uid="com.ibm.wps.portlets.welcome.1">
                <access-control externalized="false" owner="undefined" private="false"/>
                <portlet action="update" active="true" defaultlocale="en" 
                                         name="Welcome Portlet" objectid="_3_3HNGO0880305CK6G_6D" 
                                                 servletref="_V_3HNGO0880305CK6G_6B">
                    <localedata locale="en">
                        <title>Welcome to WebSphere Portal</title>
                        <description>Displays Vand Copyright Statement</description>
                    </localedata>
                    <parameter name="url" type="string" update="set">/html/wps.jsp</parameter>
                    <access-control externalized="false" owner="undefined" private="false"/>
                </portlet>
                <portlet action="update" active="true" defaultlocale="en" 
                                         name="Cloned Welcome Portlet" objectid="_3_3HNGO0880305CK6G_6E" 
                                                 servletref="_V_3HNGO0880305CK6G_6B">
                    <localedata locale="en">
                        <!-- changed the title -->
                        <title>Another About WebSphere Portal Portlet</title>
                        <description>Displays Vand Copyright Statement</description>
                    </localedata>
                    <parameter name="url" type="string" update="set">/html/wps.jsp</parameter>
                    <access-control externalized="false" owner="undefined" private="false"/>
                </portlet>
            </portlet-app>
        </web-app>
        <content-node action="locate" objectid="6_0_A Content Root" uniquename="wps.content.root"/>
        <content-node action="locate" objectid="_6_3HNGO0880305CK6G_35 My Portal" 
                         uniquename="wps.My Portal"/>
        <content-node action="update" active="true" allportletsallowed="false" 
                         content-parentref="_6_3HNGO0880305CK6G_35 My Portal" create-type="explicit" 
                                 objectid="_6_3HNGO0880305CK6G_CM Sample Page" ordinal="400" skinref="undefined" 
                                 themeref="undefined" type="page" uniquename="wps.SamplePage">
            <supported-markup markup="html" update="set"/>
            <localedata locale="en">
                <title>Sample Page</title>
            </localedata>
            <access-control externalized="false" owner="undefined" private="false"/>
            <component action="update" deletable="undefined" maxsize="undefined" 
                                 modifiable="undefined" movable="undefined" nestable="undefined" 
                                         objectid="_7_3HNGO0880305CK6G_GD" ordinal="100" orientation="H" 
                                         skinref="undefined" type="container" width="undefined">
                <component action="update" deletable="undefined" maxsize="undefined" 
                                         modifiable="undefined" movable="undefined" objectid="_7_3HNGO0880305CK6G_GE" 
                                                 ordinal="100" skinref="undefined" type="control" width="undefined">
                    <portletinstance action="update" objectid="_5_3HNGO0880305CK6G_9M" 
                                                 portletref="_3_3HNGO0880305CK6G_6D"/>
                </component>
            </component>
        </content-node>
    </portal>
    <status element="all" result="ok"/>
</request>

 

Sample file ExportPortletAndPage.xml

<?xml version="1.0" encoding="UTF-8"?>
<request
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="PortalConfig_1.3.xsd"
    type="export">

    <!-- sample for exporting a page with portlet -->
    <portal action="locate">
        <web-app action="export" uid="com.ibm.wps.portlets.welcome"/>
        <content-node action="export" uniquename="wps.SamplePage"/>

    </portal>
</request>

 

Sample file ExportSubTree.xml

<?xml version="1.0" encoding="UTF-8"?>
<request
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="PortalConfig_1.3.xsd"
    type="export">

    <!-- Sample for exporting subtree of the content hierarchy. This script exports the page customizer 
         place with all contained pages. -->
    <portal action="locate">
        <content-node action="export" uniquename="wps.My Portal" export-descendants="true"/>
    </portal>
</request>

 

Sample file UpdateAccesscontrol.xml

<?xml version="1.0" encoding="UTF-8"?>
<request
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="PortalConfig_1.3.xsd"
    type="update"
    create-oids="true">

    <!-- Sample for setting access control on resources -->
    <portal action="locate">

        <!-- Virtual resources allow you to set access control on all resources of a certain type.
             The following example assigns the administrator privileges on all user groups -->
        <virtual-resource name="USER_GROUPS" action="update">
            <access-control>
                <role actionset="Administrator" update="set">
                    <mapping subjectid="wpsadmin" subjecttype="USER" update="set"/>
                </role>
            </access-control>
        </virtual-resource>

        <!-- Set access control on a portlet - the portlet is  not redeployed.
             The same syntax can be used to set access control on a new deployed portlet -->
       <web-app action="locate" uid="com.ibm.wps.portlets.welcome">
          <portlet-app action="locate" uid="com.ibm.wps.portlets.welcome.1">
              <access-control>
                  <!-- The user role should not automatically propagate to portlets in this application. -->
                  <role-block type="propagation" actionset="User"/>
              </access-control>
               <portlet action="update" active="true" name="Welcome Portlet">
                   <access-control>
                       <!-- Remove all role blocks on this resource. -->
                       <role-block type="none"/>
                       <role actionset="Administrator" update="set">
                           <mapping subjectid="wpsadmin" subjecttype="USER" update="set"/>
                       </role>
                       <role actionset="Privileged User" update="set">
                           <mapping subjectid="all authenticated portal users" subjecttype="USER_GROUP" 
                                                            update="set"/>
                       </role>
                       <role actionset="User" update="set">
                           <mapping subjectid="anonymous portal user" subjecttype="USER" 
                                                            update="set"/>
                       </role>
                   </access-control>
               </portlet>
           </portlet-app>
       </web-app>
        
       <!-- Set access control on a page - the layout of the page is not modified.
            The same syntax can be used to set access control on a new created page. -->
       <content-node action="update" uniquename="wps.SamplePage">
            <access-control>
                <!-- The manager role should not be inherited automatically from parents of this page.  -->
                <role-block type="inheritance" actionset="Manager"/>
                <!-- The manager role is set explicitly on this page. -->
                <role actionset="Manager" update="set">
                    <mapping subjectid="wpsadmin" subjecttype="USER" update="set"/>
                </role>
                <role actionset="User" update="set">
                    <mapping subjectid="anonymous portal user" subjecttype="USER" update="set"/>
                </role>
            </access-control>
        </content-node>

    </portal>
</request>

 

Sample file UpdateVault.xml

<?xml version="1.0" encoding="UTF-8"?>
<request 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:noNamespaceSchemaLocation="PortalConfig_1.3.xsd"
    type="update" create-oids="true">
        
    <!-- Sample for updating the credential vault. This script creates a new segment containing one slot in the portal
         credential vault. The credentials (userid and password pairs) that are stored in the vault cannot be 
                  accessed using the XML configuration interface. You can only set the credentials using the administration 
                  portlets for the credential vault. -->
    <portal action="locate">
                <credential-segment action="update" adapter-type="default" name="CoporateSegment" 
                         user-mapped="false">
                        <description>Segment containing credentials for corporate backends</description>
                        <credential-slot action="update" name="CoporateFtpServer" active="false" 
                                 system="true" resource="none" secrettype="userid-password">
                <localedata locale="en">
                    <description>Credentials for accessing the Corporate FTP server</description>
                    <keywords>FTP Backend Corporate</keywords>
                </localedata>
            </credential-slot>
                </credential-segment>
        </portal>
</request>

 

Sample file CopyPage.xml

<?xml version="1.0" encoding="UTF-8"?>
<!-- IBM WebSphere Portal/5.0 build @build.number@ exported on Mon Jun 16 16:23:46 CEST 2003 from darkwing/9.152.231.63 -->
<!-- 1 [content-node 6_0_A Content Root] -->
<!-- 2 [content-node _6_3HNGO0880305CK6G_35 My Portal] -->
<!-- 3 [content-node _6_3HNGO0880305CK6G_CM Sample Page uniquename=wps.SamplePage] -->
<!-- 4 [component _7_3HNGO0880305CK6G_GD] -->
<!-- 5 [component _7_3HNGO0880305CK6G_GE] -->
<!-- 6 [web-app _1_3HNGO0880305CK6G_6B uid=com.ibm.wps.portlets.welcome] -->
<!-- 7 [portlet-app _2_3HNGO0880305CK6G_6C uid=com.ibm.wps.portlets.welcome.1] -->
<!-- 8 [servlet _V_3HNGO0880305CK6G_6B] -->
<!-- 9 [portlet _3_3HNGO0880305CK6G_6D name=Welcome Portlet] -->
<!-- 10 [portletinstance _5_3HNGO0880305CK6G_9M] -->

<!-- This is a sample export of an existing page that is modified. create-oids must be set to true, otherwise
         the original page would be overwritten.-->
<request type="update" create-oids="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xsi:noNamespaceSchemaLocation="PortalConfig_1.3.xsd">
    <portal action="locate">
        <!-- If we'd like another portlet on the page, we'd need to specify it here. -->
        <web-app action="locate" objectid="_1_3HNGO0880305CK6G_6B" 
                         uid="com.ibm.wps.portlets.welcome">
            <!-- Added the referenceid attribute. See also ClonePortlet.xml. -->
            <servlet action="locate" objectid="_V_3HNGO0880305CK6G_6B" 
                                 referenceid="portletidwelcome"/>
            <portlet-app action="locate" name="Welcome" objectid="_2_3HNGO0880305CK6G_6C" 
                                 uid="com.ibm.wps.portlets.welcome.1">
                <portlet action="locate" name="Welcome Portlet" objectid="_3_3HNGO0880305CK6G_6D"/>
            </portlet-app>
        </web-app>
        <content-node action="locate" objectid="6_0_A Content Root" uniquename="wps.content.root"/>
        <content-node action="locate" objectid="_6_3HNGO0880305CK6G_35 My Portal" 
                         uniquename="wps.My Portal"/>
        <!-- objectid is removed. It will be created.-->
        <content-node action="update" active="true" allportletsallowed="false" 
                         content-parentref="_6_3HNGO0880305CK6G_35 My Portal" create-type="explicit" ordinal="last" 
                                 skinref="undefined" themeref="undefined" type="page" 
                                 uniquename="wps.AnotherSamplePage">
            <supported-markup markup="html" update="set"/>
            <localedata locale="en">
                <!-- updated the title -->
                <title>Copied Sample Page</title>
            </localedata>
            <access-control externalized="false" owner="undefined" private="false"/>
            <component action="update" deletable="undefined" maxsize="undefined" 
                                 modifiable="undefined" movable="undefined" nestable="undefined" 
                                         objectid="_7_3HNGO0880305CK6G_GD" ordinal="100" orientation="H" 
                                         skinref="undefined" type="container" width="undefined">
                <component action="update" deletable="undefined" maxsize="undefined" 
                                         modifiable="undefined" movable="undefined" objectid="_7_3HNGO0880305CK6G_GE" 
                                                 ordinal="100" skinref="undefined" type="control" width="undefined">
                    <portletinstance action="update" objectid="_5_3HNGO0880305CK6G_9M" 
                                                 portletref="_3_3HNGO0880305CK6G_6D"/>
                </component>
            </component>
        </content-node>
    </portal>
    <status element="all" result="ok"/>
</request>

 

Sample file CreateURL.xml

<?xml version="1.0" encoding="UTF-8"?>
<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xsi:noNamespaceSchemaLocation="PortalConfig_1.3.xsd"
    type="update" 
    create-oids="true">

    <!-- Sample for creating a URL mapping context for "SamplePage." See DeployPortlet.xml. -->
        <portal action="locate">
                <!-- Locate the resource and name it "Favorites."-->
            <content-node action="locate" uniquename="wps.SamplePage" objectid="SamplePage"/>
            <!-- The label defines the URL, for example <hostname>/wps/portal/<portal id>/samples. -->
            <url-mapping-context action="update" label="samples">
                <!-- It's also accessible by <hostname>/wps/portal/<portal id>/examples. -->
                    <additional-label>examples</additional-label>
                    <!-- The link to the resource -->
                    <portal-url resourceref="SamplePage" locale="en"/>
                </url-mapping-context>
        </portal>
</request>

 

Sample file CreateUser.xml

<?xml version="1.0" encoding="UTF-8"?>
<request 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:noNamespaceSchemaLocation="PortalConfig_1.3.xsd"
    type="update" create-oids="true">
    <!-- sample for creating a user and adding the user to a group -->
        <portal action="locate">
        <user action="update" name="hsimpson" firstname="Homer" lastname="Simpson" 
                         password="secret">
            <description>My favorite TV star</description>
            <parameter name="preferredLanguage" type="string" update="set">en</parameter>
                </user>
        <group action="update" name="springfielders">
            <description>Inhabitants of Springfield</description>
            <member-user update="set" id="hsimpson"/>
        </group>
        </portal>
</request>

 

Sample file DeployTheme.xml

<?xml version="1.0" encoding="UTF-8"?>
<request 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:noNamespaceSchemaLocation="PortalConfig_1.3.xsd"
    type="update" create-oids="true">
        <portal action="locate">
        <!-- Sample for deploying themes and skins in an XML script. Note that this only created the database entries;
             you still need to provide the rendering JSPs under the resource root directories specified in the XML. -->

                <skin action="update" active="true" objectid="hedgehogSkin" 
                         uniquename="wps.skin.Hedgehog" resourceroot="Hedgehog">
                        <localedata locale="en">
                                <title>Hedgehog</title>
                <description>A skin with lots of spikes!</description>
                        </localedata>
                </skin>
                <theme action="update" active="true" defaultskinref="hedgehogSkin" 
                         uniquename="wps.theme.Forest" resourceroot="Forest">
                        <localedata locale="en">
                                <title>A natural theme</title>
                        </localedata>
            <!-- There's only one skin that may be combined with this theme. -->
                        <allowed-skin skin="hedgehogSkin" update="set"/>
                </theme>

        </portal>
</request>

 

Sample file ExportAllPortlets.xml

<?xml version="1.0" encoding="UTF-8"?>
<request
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:noNamespaceSchemaLocation="PortalConfig_1.3.xsd"
    type="export">
    
    <!-- Example for using the * wildcard to export all resources of a given type. This script exports all
         Web modules (and their contained portlets) that are defined in the portal. -->
    <portal action="locate">
        <web-app objectid="*" action="export"/>
    </portal>
</request>

 

Sample file Transaction.xml

<?xml version="1.0" encoding="UTF-8"?>
<request
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="PortalConfig_1.3.xsd"
    type="update"
    create-oids="true"
    transaction-level="request">

    <!-- Sample to demonstrate the different transaction levels. 
         This sample is very similar to CreatePage.xml; the difference is that the portlet
         is not deployed (update actions) but only found (locate action), and that there's 
         a second page being created. 
         The second page generates an error about the uniquename being used.
                 With the transaction-level set to "request,"  none of the pages is being created, 
                 whereas transaction-level="resource" creates the first page.
                 After running this sample with transaction-level="resource," it can be cleaned up
                 with the DeletePage.xml sample.
        -->
    <portal action="locate">

        <!-- skin for the portlet -->
        <skin action="locate" objectid="Shadow" uniquename="wps.skin.shadow"/>
        
        <!-- uid must match the uid attribute of portlet-app in portlet.xml -->
        <web-app action="locate" uid="com.ibm.wps.portlets.welcome">
           <!-- uid must match uid attribute of concrete-portlet-app in portlet.xml -->
           <portlet-app action="locate" uid="com.ibm.wps.portlets.welcome.1">
                <!-- name must match the content of portlet-name subtag of concrete-portlet in portlet.xml -->
                <portlet action="locate" objectid="thePortlet" name="Welcome Portlet">
                </portlet>
            </portlet-app>
        </web-app>

        <!-- The parent element under which the new page is inserted. -->
        <content-node action="locate" objectid="parentPage" uniquename="wps.My Portal"/>

        <!-- Note that the preceding elements are needed because the XML request uses ID generating mode
             and the new page must refer to the portlet and the parent place, so the object IDs
             thePortlet and wps.content.root.My_Portal must be defined.
             If you use ID preserving mode and have the correct objectid values for these two resources,
             you do not need to locate them. -->
        
        <!-- The new page. contentparentref attribute must match the objectid of parent. 
             Change the uniquename attribute to create another page. -->
        <content-node action="update" uniquename="wps.SamplePage.2"  ordinal="last" 
                         content-parentref="parentPage" active="true" allportletsallowed="false" 
                                 create-type="explicit" type="page">
            <supported-markup markup="html" update="set"/>
            <!-- The title and description for the page are read from properties files. The property keys must 
                                     end with the strings title, description, and keywords. (Pages do not support keywords.) 
                                                 The prefix attribute specifies a string that is prepended to the property key so that you 
                                                 can keep titles for different resources in the same properties file. -->
            <localedata locale="en" prefix="page.sample">
                <url>file:///$server_root$/doc/xml-samples/pagetitles_en.properties</url>
            </localedata>
            <localedata locale="de" prefix="page.sample">
                <url>file:///$server_root$/doc/xml-samples/pagetitles_de.properties</url>
            </localedata>

            <component action="create" ordinal="100" type="container" orientation="H">
                <component action="create" ordinal="100" type="control" skinref="Shadow">
                    <!-- portletref must match the objectid attribute of the portlet -->
                    <portletinstance action="update" portletref="thePortlet"/>
                </component>
            </component>
        </content-node>
        <!-- This is the second page that will generate the error as we set the uniquename to one
                 that is already defined.
        -->
        <content-node action="update" uniquename="wps.SamplePage.2"  ordinal="last" 
                         content-parentref="parentPage" active="true" allportletsallowed="false" 
                                 create-type="explicit" type="page">
            <supported-markup markup="html" update="set"/>
            <!-- The title and description for the page are read from properties files. The property keys must 
                                     end with the strings title, description, and keywords. (Pages do not support keywords.) 
                                                 The prefix attribute specifies a string that is prepended to the property key, so that you 
                                                 can keep titles for different resources in the same properties file. -->
            <localedata locale="en">
                <title>Page that should not appear</title>
            </localedata>
            <component action="create" ordinal="100" type="container" orientation="H">
                <component action="create" ordinal="100" type="control" skinref="Shadow">
                    <!-- portletref must match the objectid attribute of the portlet -->
                    <portletinstance action="update" portletref="thePortlet"/>
                </component>
            </component>
        </content-node>
    </portal>
</request>

 

Sample file MovePage.xml

Note: The actual move of the page is done by the last two lines. They are highlighted here.

<?xml version="1.0" encoding="UTF-8"?>
<request
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="PortalConfig_1.3.xsd"
    type="update"
    create-oids="true">

    <portal action="locate">

        <!-- skin for the portlet -->
        <skin action="locate" objectid="Shadow" uniquename="wps.skin.shadow"/>
        
        <!-- uid must match uid attribute of portlet-app in portlet.xml -->
        <web-app action="locate" uid="com.ibm.wps.portlets.welcome">
           <!-- uid must match uid attribute of concrete-portlet-app in portlet.xml -->
           <portlet-app action="locate" uid="com.ibm.wps.portlets.welcome.1">
                <!-- name must match content of portlet-name subtag  of concrete-portlet in portlet.xml -->
                <portlet action="locate" objectid="thePortlet" name="Welcome Portlet">
                </portlet>
            </portlet-app>
        </web-app>

        <!-- Parent element under which the new page is inserted -->
        <content-node action="locate" objectid="parentPage" uniquename="wps.My Portal"/>

        <!-- Note that the preceding elements are needed because the XML request uses ID generating mode
             and the new page must refer to the portlet and the parent place, so the object IDs
             thePortlet and wps.content.root.My_Portal must be defined.
             If you use ID preserving mode and have the correct objectid values for these two resources,
             you do not need to locate them. -->
        
        <!-- The new page. contentparentref attribute must match the objectid of the parent. 
             Change the uniquename attribute to create another page. -->

        <content-node action="update" uniquename="wps.SamplePage.4101"  objectid="SamplePage4101" ordinal="last"
       content-parentref="parentPage" active="true" create-type="explicit" type="page">
            <supported-markup markup="html" update="set"/>
            <localedata locale="en" prefix="page.sample">
                <url>file:///$server_root$/doc/xml-samples/pagetitles_en.properties</url>
            </localedata>

            <component action="create" ordinal="100" type="container" orientation="H">
                <component action="create" ordinal="100" type="control" skinref="Shadow">
                    <!-- portletref must match the objectid attribute of portlet -->
                    <portletinstance action="update" portletref="thePortlet"/>
                </component>
            </component>
        </content-node>

        <content-node action="update" uniquename="wps.SamplePage.4102"  objectid="SamplePage4102" ordinal="last"
       content-parentref="parentPage" active="true" create-type="explicit" type="page">
            <supported-markup markup="html" update="set"/>
            <localedata locale="en" prefix="page.sample">
                <url>file:///$server_root$/doc/xml-samples/pagetitles_en.properties</url>
            </localedata>

            <component action="create" ordinal="100" type="container" orientation="H">
                <component action="create" ordinal="100" type="control" skinref="Shadow">
                    <!-- portletref must match the objectid attribute of portlet -->
                    <portletinstance action="update" portletref="thePortlet"/>
                </component>
            </component>
        </content-node>


       <content-node action="locate" uniquename="wps.SamplePage.4101"  />
       <content-node action="update" uniquename="wps.SamplePage.4102"  
           content-parentref="wps.SamplePage.4101"  />
        <!--   Note that this specifies a new parent that differs from the previous one.  -->
  
    </portal>
</request>

 

Sample file Task.xml

This sample creates a scheduler task in the Application Server that will run at the specified date and time. You can create multiple "run once" tasks but only one single task that is regularly scheduled. For example, you cannot create a task that combines a weekly and a monthly run. Uncomment the task definitions that best matches your requirements. The "run once" task is enabled by default.

<?xml version="1.0" encoding="UTF-8"?>
<request type="update" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:noNamespaceSchemaLocation="PortalConfig_1.3.xsd">

    <portal action="locate">

<!-- This sample creates a scheduler task in the Application Server that will run at the specified date and time.
     You can create only one single task that is regularly scheduled.  
     For example, you cannot create a task that runs both weekly and monthly.
     Uncomment one of the following task definitions that best match your needs.
     The "run once" task is enabled by default.     -->     

<!-- Runs once, starts immediately -->       
        <task action="create" bean="ejb/wpsSchedulerTask"/>   

<!-- Runs daily at 12:30      
        <task action="create" bean="ejb/wpsSchedulerTask">
            <startTime>12:30</startTime>
        </task>          -->

<!-- Runs weekly, on early Friday morning     
        <task action="create"  bean="ejb/wpsSchedulerTask">
            <dayOfWeek>5</dayOfWeek>
            <startTime>7:00</startTime>
        </task>          -->

<!-- Runs monthly, at the latest time possible     
        <task action="create"  bean="ejb/wpsSchedulerTask">
            <dayOfMonth>31</dayOfMonth>
            <startTime>23:59</startTime>
        </task>          -->

    </portal>

</request>

 

Sample file RegisterPreDeployedEAR.xml

Use the following example to install a predeployed portlet. You might have to change this sample for your requirements. For more information about how to predeploy portlets refer to Deploying J2EE resources with portlet application WAR files.

<?xml version="1.0" encoding="UTF-8"?>
<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xsi:noNamespaceSchemaLocation="PortalConfig_1.3.xsd" 
         type="update" create-oids="true">
    <portal action="locate">

        <!-- Use the predeployed attribute to indicate that the URL of the Web application is the location in the file system 
                to where the EAR file with the contained WAR file has been extracted. -->   
        <web-app action="update" uid="my.test.web-app" active="true" predeployed="true">

            <!-- In this case, the URL points to the root directory of the extracted WAR file in the portal server directory. -->
            <url>file://localhost/D:/WebSphere/PortalServer/installedApps/myapp.ear/myportletapp</url>

            <!-- The context root that is assigned to the web application of the portlet application in the 
                    predeployed EAR file (reference: application.xml). -->
            <context-root>my/context/root</context-root>

            <!-- The name that is assigned to the application in the predeployed EAR file (reference: application.xml). -->
            <display-name>My Web App</display-name>

            <portlet-app action="update" active="true" name="My portlet app" uid="my.test.portlet-app">
                <portlet action="update" active="true" name="My Portlet"/>
            </portlet-app>
        </web-app>
    </portal>
</request>

 

Sample file CleanupUsers.xml

Use the following example to identify users and groups in you portal database who have been removed from the user registry, but not from the portal database. In order for the file to work properly, set both attributes cleanup-users and export-users to true . Running this sample file results in a file that lists those users and groups and marks them for deletion. The result file also lists all users who have been muted, for example after too many wrong password attempts. Before you re-import the file, check the file and remove all users and groups that you want to keep in the portal database. During XML import all users and groups that remain listed in the file will be removed from the portal database.

After deleting these entries via the modified XML script, all customizations are lost for the deleted users and groups.

<?xml version="1.0" encoding="UTF-8"?>
<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="PortalConfig_1.3.xsd"

         type="export" export-users="true" cleanup-users="true">
 
    <portal action="locate">
        <user  action="export" objectid="*"/>
        <group action="export" objectid="*"/>
    </portal>
</request>

 

See also

Home |

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.