Federated Portals Guide

     Previous  Next    Open TOC in new window    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Configuring a WebLogic Server Producer

By default, WebLogic Portal projects deployed to a WebLogic Portal domain are configured to function as WSRP producers. If you want to use a Basic WebLogic Server or WebLogic Express domain as a producer, some configuration is required. This chapter explains how to configure a Basic WebLogic Server or WebLogic Express domain as a WSRP producer. Portlets deployed to the server can then be used by consumer applications.

This chapter includes the following topics:

 


Introduction

This chapter explains how to configure a basic WebLogic Server domain as a WSRP producer. The example in this section assumes that you have a functioning Struts module deployed in a WebLogic Server domain. The goal of this procedure is to create a portlet in a producer that can be consumed remotely.

By following this procedure, you can expose a Struts application as a remote portlet that a WebLogic Portal application can consume, as illustrated in Figure 8-1.

Figure 8-1 WebLogic Server Producer

WebLogic Server Producer

To configure a WebLogic Server domain to be a WSRP producer involves two steps:

 


Using WSRP in a Basic WebLogic Server Domain

This section explains how to configure a WebLogic Server domain as a producer. You might do this if you want to make portlets available to consumers, but do not want to install the full WebLogic Portal product on your server.

Tip: A producer created in this way is a simple producer. A simple producer is a producer that offers core WSRP services without requiring a full WebLogic Portal installation. In this configuration, some advanced features, such as registration and interportlet communication, are not supported. For more information on simple and complex producers, see Understanding Producers and Consumers.

The basic steps you need to perform to enable a WebLogic Server domain to be a WSRP producer are:

Create a WebLogic Server Domain

This section explains how to create a new WebLogic Server domain using the Oracle WebLogic Configuration Wizard. You can then extend the domain to include WSRP producer components.

  1. Start the Oracle WebLogic Configuration Wizard. To do this, execute the config.cmd (or config.sh) command in <WEBLOGIC_HOME>/common/bin.
  2. In the Welcome dialog, select Create a new WebLogic domain, and click Next.
  3. In the Select Domain Source dialog, select WebLogic Server (the default) and Workshop for WebLogic, and leave the other checkboxes unselected, as shown in Figure 8-2.
  4. Figure 8-2 Select Domain Source


    Select Domain Source

  5. Complete the rest of the configuration wizard steps to create the WebLogic Server domain. For detailed information on the configuration wizard, refer to “Creating WebLogic Domains Using the Configuration Wizard” in the WebLogic Server documentation.

Extend the WebLogic Server Domain

This section explains how to extend your WebLogic Server domain to include the components of a simple producer.

You extend the domain using an extension template. An extension template defines applications and services that can be used to extend an existing domain. The extension template you will use in this example is called wsrp-simple-producer.jar.

  1. Start the Oracle WebLogic Configuration Wizard. To do this, execute the config.cmd (or config.sh) command in <WEBLOGIC_HOME>/common/bin.
  2. In the Welcome dialog of the configuration wizard, select Extend an existing WebLogic domain, as shown in Figure 8-3, and click Next.
  3. Figure 8-3 Extend a Domain


    Extend a Domain

  4. In the Select a WebLogic Domain Directory dialog, navigate to the WebLogic Server domain that you want to extend, select it, as shown in Figure 8-4, and click Next.
  5. Figure 8-4 Select a Domain Directory


    Select a Domain Directory

  6. In the Select Extension Source dialog, select Extend my domain using an existing extension template, as shown in Figure 8-5, and click Next.
  7. Figure 8-5 Select Extension Source


    Select Extension Source

  8. Click Browse.
  9. In the Select a Template dialog, select the following JAR file, as shown in Figure 8-6:
  10. <WLPORTAL_HOME>/common/templates/applications/wsrp-simple-producer.jar 
    Figure 8-6 Selecting the Template


    Selecting the Template

  11. Click OK when you have selected the file.
  12. In the configuration wizard, click Next and complete the wizard steps as appropriate. When you reach the last dialog, click Extend.

Checkpoint: At this point, you have extended the WebLogic Server domain so that it can function as a simple WSRP producer. Next, you need to configure your web projects.

 


Configuring a Web Project

After you have a WebLogic Server domain that is configured to function as a WSRP producer, you also need to enable any web projects that you deploy to function as a WSRP producer in the domain. After you configure a web project to function as a WSRP producer, portlets you deploy in that project will be available to consumers.

Create a Web Project

You need to create a web project that is enabled with WSRP producer components. In this example, we demonstrate how to enable a Dynamic Web Project. This type of project does not contain any WebLogic Portal components or WSRP producer components by default.

  1. Open Workshop for WebLogic.
  2. Select File > New > Other.
  3. In the New – Select a wizard dialog, open the Web folder and select Dynamic Web Project. The Dynamic Web Project dialog appears.
  4. Enter a name for the project, and click Next. The Select Project Facets dialog appears.
  5. In the Select Project Facets dialog, expand the WebLogic Portal node, and select only the following facets, as shown in Figure 8-7:
    • Portal Framework Struts
    • WSRP Producer
  6. Also select the Beehive NetUI 1.0.1 or newer facet and the WebLogic Control Extensions 10.0 or newer facet. These facets are required with the WSRP Producer facet.
Note: If you select Beehive NetUI 1.0.1, you must also select the proper version number for the Dynamic Web Module facet. The correct version is 2.4. You can select this version from the drop down menu next to the Dynamic Web Module facet in the Project Facets dialog.
Figure 8-7 Select Project Facets

Select Project Facets

  1. Click Finish.

Checkpoint: You have created a web project in which you can create portlets that will be visible to consumers.

 


Testing the Producer Configuration

To test the producer configuration, you can do the following:

Create a Server on the Producer

If you have not done so, create a WebLogic Server in which to run the application on the producer:

  1. Start Workshop for WebLogic.
  2. Select File > New > Other.
  3. In the Select dialog, open the Server folder and select Server.
  4. Follow the wizard prompts to create the server. Use the WebLogic Server domain that you configured to function as a WSRP producer and add the WSRP-producer enabled web project to the server.
  5. Start the server.
Tip: For more information on creating a server using Workshop for WebLogic, see the WebLogic Portal tutorial “Setting Up Your Portal Development Environment.”

Test for a Producer WSDL

The first test to perform is to check that the producer web application returns a WSDL description when you enter the WSDL URL in a browser.

  1. Start WebLogic Server.
  2. Enter the WSDL URL for the web project in a browser. For example:
  3. http://localhost:7001/myWebProj/producer?wsdl

    If the server and web application are configured properly, the WSDL file appears in the browser. Part of a sample WSDL file is shown in Figure 8-8.

    Figure 8-8 Sample WSDL File


    Sample WSDL File

Checkpoint: If the WSDL file appears in the browser, then the server is functioning as a producer. You can now create portlets in the web application that can be consumed as remote portlets in consumer applications.

Create a Portlet in the Producer Web Application

You can use Workshop for WebLogic to create portlets in the web application on the producer. If you created a Dynamic Web Application, you can create one of the following types of portlets:

For information on creating these portlet types, see the Portlet Development Guide.

Consuming a Producer Portlet

Another test you can perform is to try to consume a portlet deployed in the producer from a WebLogic Portal application.

  1. On another machine, create a WebLogic Portal Domain. You can use the WebLogic Configuration Wizard to do this. If you cannot use another machine, be sure the server’s listen port does not conflict with the port used by the producer server.
  2. Use Workshop for WebLogic to create a Portal Application and associate the application with the new WebLogic Portal Domain. If necessary, you can obtain a free developer’s version of Workshop for WebLogic by visiting the Oracle website.
  3. Create a new Portal Web Project to the application. This application is the consumer application.
  4. Create a portal in the consumer application.
  5. Start the server that hosts the consumer.
  6. Create a remote portlet in the Portal Web Project you just created. Point the WSDL to the web application on the producer. For example:
  7. http://producerHost:producerPort/myWebApp/producer?WSDL

    Where producerHost:producerPort is the IP address and port number of the machine hosting the producer, and myWebApp is the name of the context directory for the web application that contains the producer portlet(s) that you wish to surface. See Creating Remote Portlets, Pages, and Books for more information.

  8. On the consumer, add the remote portlet to the portal and open the portal. The portlet you created on the producer appears in the portal.

Summary

In this section you tested a configuration where a remote portlet in a consumer references a portlet that is deployed to a producer running in a basic WebLogic Server domain.

 


Disabling a WSRP Producer

To disable a WSRP producer, open the WEB-INF/wsrp-producer-config.xml file and set the <service-config> element’s enabled attribute to false. For example:

<?xml version="1.0" encoding="UTF-8"?>
 <wsrp-producer-config
         xmlns="http://www.bea.com/servers/weblogic/wsrp-producer-config/9.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     <description>
         This configuration file disables the WSRP producer.
     </description>
     <service-config enabled="false">
 ...

  Back to Top       Previous  Next