Create a Producer definition and consuming a portlet by a single XML script
We can use a single XML script to create a Producer definition and then consume portlets from that same Producer.
If you consume the portlet in an XML script that has already created the Producer in a previous step, we must specify the following items in the XML script:
- A locate action on the Producer.
- A locate action on the web-app tag with the u attribute.
- The servlet subtag with the remotehandle and wsrp-producerref attributes.
- A locate action on the portlet-app subtag with the u attribute.
- The portlet subtag with the servletref attribute.
The following XML sample shows how we use the XML configuration interface to integrate a remote portlet:
<?xml version="1.0" encoding="UTF-8" ?> <request type="update" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PortalConfig_8.5.0.xsd"> <portal action="locate"> <wsrp-producer action="locate" object uniquename="wps.myProducer1"> <web-app action="locate" u> <servlet action="update" object remotehandle="Remote_handle" wsrp-producerref="Producer_OID"/> <portlet-app action="locate" u> <portlet action="update" active="true" defaultlocale="en" servletref="Servlet_OID" name="Sample_Portlet"> <localedata locale="en"> <title>Sample Portlet</title> <description>Simple sample portlet as Web service</description> </localedata> <access-control externalized="false" owner="undefined" private="false"/> </portlet> </portlet-app> </web-app> </portal> </request>