Oracle® Fusion Middleware Federated Portals Guide for Oracle WebLogic Portal 10g Release 3 (10.3.5) Part Number E14235-06 |
|
|
View PDF |
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:
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.
To configure a WebLogic Server domain to be a WSRP producer involves two steps:
Create a basic WebLogic Server domain.
Extend the domain to include the producer components.
Create or reconfigure a web project to include appropriate WebLogic Portal facets that are required for the project to host remoteable components, such as Struts applications.
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 Section 3.4, "Understanding Producers and Consumers".
The basic steps you need to perform to enable a WebLogic Server domain to be a WSRP producer are:
Section 8.2.1, "Create a WebLogic Server Domain"
In this step, you use the Oracle WebLogic Configuration Wizard to create a WebLogic Server domain with the appropriate elements.
Section 8.2.2, "Extend the WebLogic Server Domain"
In this step, you use the Oracle WebLogic Configuration wizard to extend the WebLogic Server domain using an extension template. The extension template adds WSRP producer components to the 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.
Start the Oracle WebLogic Configuration Wizard. To do this, execute the config.cmd
(or config.sh
) command in <
WEBLOGIC_HOME
>/common/bin
.
In the Welcome dialog, select Create a new WebLogic domain, and click Next.
In the Select Domain Source dialog, Basic WebLogic Server Domain is selected by default. Leave the other checkboxes unselected, as shown in Figure 8-2.
Complete the rest of the configuration wizard steps to create the WebLogic Server domain. For detailed information on the configuration wizard, refer to Oracle Fusion Middleware Creating Domains Using the Configuration Wizard. See also the Oracle Fusion Middleware Tutorials for Oracle WebLogic Portal.
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.
Start the Oracle WebLogic Configuration Wizard. To do this, execute the config.cmd
(or config.sh
) command in <
WEBLOGIC_HOME
>/common/bin
.
In the Welcome dialog of the configuration wizard, select Extend an existing WebLogic domain, as shown in Figure 8-3, and click Next.
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.
In the Select Extension Source dialog, select Extend my domain using an existing extension template, and click Next.
Click Browse.
In the Select a Template dialog, select the following JAR file, as shown in Figure 8-5:
<WLPORTAL_HOME>/common/templates/applications/wsrp-simple-producer.jar
Click OK when you have selected the file.
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.
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.
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.
Open Oracle Enterprise Pack for Eclipse.
Select File > New > Other.
In the New – Select a wizard dialog, open the Web folder and select Dynamic Web Project. The Dynamic Web Project dialog appears.
Enter a name for the project and click Next. The Select Project Facets dialog appears.
In the Configuration section of the dialog, click Modify. The Project Facets dialog appears.
In the Project Facets dialog, expand the WebLogic Portal node, and select only the following facets, as shown in Figure 8-6:
Portal Framework Struts
WSRP Producer
WebLogic Integrated Commons Logging
Note:
Depending on the version of Portal Framework Struts you select, you may need to select other facets. The Project Facets dialog enforces these additional requirements and displays a list of any missing facets. For more information, see "Apache Beehive and Apache Struts Supported Configurations" in the Oracle Fusion Middleware Portal Development Guide for Oracle WebLogic Portal.
Click Finish.
Checkpoint: You have created a web project in which you can create portlets that will be visible to consumers.
To test the producer configuration, you can do the following:
If you have not done so, create a WebLogic Server in which to run the application on the producer:
Start Oracle Enterprise Pack for Eclipse.
Select File > New > Other.
In the Select dialog, open the Server folder and select Server.
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.
Start the server.
Tip:
For more information on creating a server using Oracle Enterprise Pack for Eclipse, see Oracle Fusion Middleware Tutorials for Oracle WebLogic Portal.
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.
Start WebLogic Server.
Enter the WSDL URL for the web project in a browser. For example:
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-7.
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.
You can use Oracle Enterprise Pack for Eclipse to create portlets in the web application on the producer.
For information on creating portlets, see the Oracle Fusion Middleware Portlet Development Guide for Oracle WebLogic Portal.
Another test you can perform is to try to consume a portlet deployed in the producer from a WebLogic Portal application.
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.
Use Oracle Enterprise Pack for Eclipse 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 Oracle Enterprise Pack for Eclipse by visiting the Oracle web site.
Create a new Portal Web Project to the application. This application is the consumer application.
Create a portal in the consumer application.
Start the server that hosts the consumer.
Create a remote portlet in the Portal Web Project you just created. Point the WSDL to the web application on the producer. For example:
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 Chapter 4, "Creating Remote Portlets, Pages, and Books" for more information.
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.
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"> ...