+

Search Tips   |   Advanced Search


Use the XML configuration interface to provide or withdraw a portlet

You can provide portlets as WSRP services by using the XML configuration interface.

To provide or withdraw the portlet using the XML configuration interface, specify the provided attribute to the portlet tag:

provided = "true | false"

Use this attribute with the portlet tag to specify providing or withdrawing a portlet as a WSRP service:

true

To provide the portlet as a WSRP service, you set the provided attribute to true. When you run the XML script, the portlet is provided as a WSRP service. The portlet can now be consumed as a remote portlet by Consumer portals.

false

To withdraw the portlet, set the provided attribute to false. The portlet is withdrawn. It is no longer available for Consumer portals to consume.

XML script examples:

The following two XML samples show you how to use the XML configuration interface to provide a portlet that complies with the IBM portlet API and a portlet that complies with the standard portlet API. The examples show the provided attribute highlighted. To withdraw a portlet by using the XML configuration interface, specify false instead of true for the provided tag.

Here and in the following sections and examples, IBM portlet has the following meaning:

  1. This portlet has been written according to the IBM portlet API.

  2. The IBM portlet API is the API version that applies to the Versions 4 and 5 of the WebSphere Portal.

  3. This portlet does not comply with the standard portlet API (JSR 168 or later standards).

Providing an IBM portlet:

The first XML sample shows you how to provide a portlet that complies with the IBM portlet API:

<?xml version="1.0" encoding="UTF-8" ?>
<request type="update" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:noNamespaceSchemaLocation="PortalConfig_1.4.xsd">
      <!-- 
          Sample for providing a portlet as a WSRP producer. 
      -->
   <portal action="locate">
      <!-- 
          uid must match uid attribute of portlet-app in portlet.xml
      -->
      <web-app action="locate" active="true" 
         uid="com.ibm.wps.portlets.reminder">
            <!-- 
                uid must match uid attribute of concrete-portlet-app in portlet.xml 
            -->
         <portlet-app action="update" 
            uid="com.ibm.wps.portlets.reminder.1">
               <!-- 
                   Name must match the content of the portlet-name subtag of concrete-portlet in portlet.xml.
                   To actually provide the portlet, the provided attribute is set to true. 
               -->
            <portlet action="update" name="Reminder" provided="true" /> 
         </portlet-app>
      </web-app>
   </portal>
</request>

Providing a standard API portlet:

The following XML sample shows you how to provide a portlet that complies with the standard portlet API:

<?xml version="1.0" encoding="UTF-8" ?>
<request type="update" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:noNamespaceSchemaLocation="PortalConfig_1.4.xsd">
      <!-- 
          Sample for providing a standard API compliant portlet as a WSRP producer. 
          Be aware that this sample is provided as a sample only.
          It might or might not work, depending on the configuration of the portal. 
      --> 
   <portal action="locate">
      <!-- 
          uid must match the uid of the portlet application appended with .webmod 
      --> 
      <web-app action="locate" active="true" 
         uid="stdTestsuite.war.webmod">
            <!-- 
                uid must match the optional portlet-app id attribute from the portlet.xml. 
                If this is not set, the .war file name must be supplied here. 
            --> 
         <portlet-app action="update" uid="stdTestsuite.war">
            <!--
                Name must match the portlet-name tag in the portlet.xml file. 
            --> 
            <portlet action="update" name="TestPortlet1" provided="true" /> 
         </portlet-app>
      </web-app>
   </portal>
</request>


Parent topic:

Providing WSRP services as a Producer


Related concepts


The XML configuration interface