ClonePortlet.xml

 

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

<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="PortalConfig_1.4.xsd"
         type="update">
<!--
   Clone 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 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="ibm.portal.skin.IBM"/>

        <!-- The web-app tag is taken from an export of the original portlet. 
             The url and access-control tags were removed. -->

        <web-app action="update" active="true" uid="com.ibm.wps.portlets.welcome">

            <servlet action="locate" objectid="_V_3HNGO0880305CK6G_3C" referenceid="portletidwelcome"/>

            <!-- The name/ uid must be constructed from the original name/ uid appended with ".$cloned." 
                 and appended with some id that makes the string unique. Optional you can set a unique name. -->

            <portlet-app action="update" 
                         active="true" 
                         name="Welcome Portlet.$cloned.1" 
                         uid="com.ibm.wps.portlets.welcome.$cloned.1" 
                         uniquename="com.ibm.wps.portletapp.welcome.$cloned.1">

                <!-- The name must be constructed from the original name appended with ".$cloned." 
                     and appended with some id that makes the string unique. Optional you can set a unique name. -->

                <portlet action="update"
                         active="true"
                         defaultlocale="en"
                         name="Welcome Portlet.$cloned.1"
                         objectid="cloned_portlet"
                         servletref="_V_3HNGO0880305CK6G_3C"
                         uniquename="com.ibm.wps.portlet.welcome.$cloned.1">

                    <localedata locale="en">
                        <title>About WebSphere Portal Clone</title>
                        <description>Displays Version and Copyright Statement</description>
                        <keywords>${portlet.keywords}</keywords>
                    </localedata>

                    <parameter name="url" type="string" update="set">/WEB-INF/jsp/wps.jsp</parameter>

                </portlet>

            </portlet-app>

        </web-app>

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

        <!-- new page. contentparentref attribute must match objectid of parent 
             change the uniquename attribute to create another page -->

        <content-node action="update"
                      uniquename="ibm.portal.SamplePage.3"
                      ordinal="last"
                      content-parentref="parentPage"
                      active="true" 
                      create-type="explicit"
                       type="page">

            <supported-markup markup="html" update="set"/>

            <!-- The title and description for the page are read from property 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 property 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="cloned_portlet"/>

                </component>

            </component>

        </content-node>

    </portal>
</request>