Using WSRP with WebLogic Portal
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
This section describes how you can modify existing applications to create either complex or simple Producers. It includes information in the following subjects:
You can turn a non-portal web application into a Producer. This is helpful when you want to make Java Page Flow or Struts portlets available as remote portlets. It is also helpful for converting applications created outside of WebLogic Workshop into Producers. You can make this conversion in either a portal application or in a non-portal application.
This section includes information on the following subjects:
This section describes how to create a Producer from a non-portal web application.
To convert a non-portal web application in a portal enterprise application into a Producer, use this procedure:
Note: WebLogic Workshop must be running.
Figure 6-2 *.work File Selected
The application appears in the Workshop application tree, as shown in Figure 6-3. Note the non-portal web application listed under the enterprise application.
Figure 6-3 Workshop Application Tree Showing Selected Application
WEB-INF/lib
folder under the portal web application to the WEB-INF/lib
folder under the non-portal web application:Figure 6-4 Install>WSRP Producer Menus
wsrp-producer-config.xml
in the WEB-INF
folder. If it is present, the project was successfully installed as a Producer.Figure 6-5 Application Tree with wsrp-producer-config.xml Added
To test the configuration, you need to make the Struts or Pageflow application available as a portlet and then view it in a proxy portlet in another web application. To do so, use the following procedure:
.portlet
file from <WebLogic813_Home>/portal/portalApp/sampleportal
into the non-portal web application..portlet
file inside a portal web application and copy the code sample in Listing 6-1 into that file:Listing 6-1 Code Sample for Creating a .portlet File
<?xml version="1.0" encoding="UTF-8"?>
<portal:root
xmlns:netuix="http://www.bea.com/servers/netuix/xsd/controls/netuix/1.0.0"
xmlns:portal="http://www.bea.com/servers/netuix/xsd/portal/support/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/servers/netuix/xsd/portal/
support/1.0.0 portal-support-1_0_0.xsd">
<netuix:portlet
definitionLabel="portlet_81b"
title="BEA: Non Portal">
<netuix:titlebar>
</netuix:titlebar>
<netuix:content>
<netuix:pageflowContent contentUri="/Controller.jpf"/>
</netuix:content>
</netuix:portlet>
</portal:root>
.portlet
file, update the URI to point to the Struts or Pageflow you want to enable; for example, refer to Listing 6-2Listing 6-2 Redirecting the URI
<netuix:portlet|
definitionLabel="portlet_81b"
title="BEA: Non Portal">
<netuix:titlebar>
</netuix:titlebar>
<netuix:content>
<netuix:pageflowContent contentUri="/Controller.jpf"/>
</netuix:content>
</netuix:portlet>
You can also update this URI in the WebLogic Workshop property editor, as shown in Figure 6-6
Figure 6-6 Updating the URI by Using the Property Editor
Note: For instructions on steps 3 and 4, please refer to Building a Remote Portlet in the BEA WebLogic Portal IDE online help system.
http://localhost:7001/
webAppName
/producer?wsdl
You can also convert a non-portal web application into a Producer from a non-portal enterprise application. This process require adding files that are part of the WebLogic Portal, but you do not need to use WebLogic Workshop.
To convert a non-portal web application into a Producer in a non-portal application, do the following:
set CLASSPATH=%WEBLOGIC_CLASSPATH%;%POINTBASE_CLASSPATH%;
%JAVA_HOME%\jre\lib\rt.jar;%WL_HOME%\server\lib\
webservices.jar;%WL_HOME\portal\lib\wsrp\wsrp-common.jar;
CLASSPATH=$WEBLOGIC_CLASSPATH%;%POINTBASE_CLASSPATH%;
%JAVA_HOME%\jre\lib\rt.jar;%WL_HOME%\server\lib\webservices.jar
${WEBLOGIC_CLASSPATH}${CLASSPATHSEP}${POINTBASE_CLASSPATH}
${CLASSPATHSEP}${JAVA_HOME}\jre\lib\rt.jar${CLASSPATHSEP}${WL_HOME}
/server/lib/webservices.jar"export CLASSPATH;$WL_HOME/portal
/lib/wsrp/wsrp-common.jar;
com.bea.wsrp.producer.adapter.pageflow.WsrpPageflowFilter
(Listing 6-3) and map it to the URL pattern /producer/*
(Listing 6-4).Listing 6-3 Adding com.bea.wsrp.producer.adapter.pageflow.WsrpPageflowFilter
<filter>
<filter-name>WsrpPageflowFilter</filter-name>
<filter-class>com.bea.wsrp.producer.adapter.pageflow.WsrpPageflowFilter
</filter-class>
</filter>
Listing 6-4 Mapping com.bea.wsrp.producer.adapter.pageflow.WsrpPageflowFilter
<filter-mapping>
<filter-name>WsrpPageflowFilter</filter-name>
<url-pattern>/producer/*</url-pattern>
</filter-mapping>
com.bea.wsrp.producer.WsrpServer
(Listing 6-5) and map it to the URL pattern /producer/*
(Listing 6-6) Make sure to set the <load-on-startup>
parameter in <servlet>
(Listing 6-5) to ensure that com.bea.wsrp.producer.WsrpServer
is loaded when the server starts up.Listing 6-5 Adding com.bea.wsrp.producer.WsrpServer
<servlet>
<servlet-name>com.bea.wsrp.producer.WsrpServer</servlet-name>
<servlet-class>com.bea.wsrp.producer.WsrpServer</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
Listing 6-6 Mapping com.bea.wsrp.producer.WsrpServer
<servlet-mapping>
<servlet-name>com.bea.wsrp.producer.WsrpServer</servlet-name>
<url-pattern>/producer/*</url-pattern>
</servlet-mapping>
Listing 6-7 Contents of wsrp-producer-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<wsrp-producer-config
xmlns="http://www.bea.com/servers/weblogic/wsrp-producer-config/8.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/servers/weblogic/wsrp-producer-config/8.0
wsrp-producer-config.xsd">
<description></description>
<service-config>
<registration required="false" secure="false"/>
<service-description secure="false"/>
<markup secure="false" rewrite-urls="true" transport="string"/>
<portlet-management required="false" secure="false"/>
</service-config>
<supported-locales>
<locale>en</locale>
<locale>en-US</locale>
</supported-locales>
</wsrp-producer-config>
Note: If you make any changes to wsrp-producer-config.xml
, you will need to redeploy or bounce the server before the changes become active.
To test the configuration, follow the same steps outlined above in Testing the Configuration. To test this configuration, you will need to create the consumer remote portlet (step 2, below) on a separate machine; otherwise the expense of running two domains on a single machine will severely impact performance.
Note: WebLogic Server must be running.
http://
separate.machine
/nonPortalWedApplication
/producer?wsdl
Unlike a complex Producer, a simple Producer is a non-portal web application that contains Pageflows and Struts applications. It does not depend upon any portal features (for example, customization). It doesn't allow registration, doesn't support URL rewriting in the Consumer, and does not support portlet customization.
A simple Producer is often advantageous because it easier to manage and you don't need to have the complete portal installed to run it. Simple Producers are commonly used in smaller, departmental settings, where more the more advanced features of complex Producers are not necessary.
By default, all portal projects created with WebLogic Workshop 8.1 SP3 are complex Producers. However, you can create a simple Producer from a complex Producer by following the procedures below.
To create a simple Producer from a complex one, use this procedure.
WEB-INF/
directory, open the wsrp-producer-config.xml file
and locate the <service-config>
element. It should look like the example in Listing 6-8: Listing 6-8 <service-config> Element of wsrp-producer-config.xml for a Complex Producer
<service-config>
<registration required="true" secure="false"/>
<service-description secure="false"/>
<markup secure="false" rewrite-urls="true" transport="string"/>
<portlet-management required="true" secure="false"/>
</service-config>
<registration required=>
and <portlet-management required=>
attributes from "true"
to "false"
, It should look like the example in Listing 6-9: Listing 6-9 Updated <service-config> Element for a Simple Producer
<service-config>
<registration required="false" secure="false"/>
<service-description secure="false"/>
<markup secure="false" rewrite-urls="true" transport="string"/>
<portlet-management required="false" secure="false"/>
</service-config>
![]() ![]() |
![]() |
![]() |