![]() ![]() ![]() ![]() ![]() ![]() |
This chapter focuses on how to use Workshop for WebLogic to create and configure remote portlets, pages, and books. This chapter includes the following sections:
Before getting started, we recommend that you review the following chapters in the architecture part of this guide:
.These chapters explain basic concepts such as producers, consumers, and remote portlets, pages, and books. This chapter assumes you familiar with these concepts.
Note: | This chapter is primarily for developers using Workshop for WebLogic to create consumer portal applications. If you plan to use the WebLogic Portal Administration Console to create federated portals, see Part III, Staging. |
WebLogic Portal applications can consume the following types of portlets:
To be consumable, a portlet must be deployed to a web application that is running in a WSRP-compliant producer. The consumer application must also be capable of contacting the producer using the producer’s WSDL URL.
This section presents a step-by-step example showing you how to create a remote (proxy) portlet in a consumer application using Workshop for WebLogic. This section includes the following topics:
For this example, you will consume a portlet deployed in a producer application. The producer application in this example is a Portal Web application deployed to a WebLogic Portal Domain.
Tip: | For information on working with a producer that is running in a WebLogic Server domain (as opposed to a WebLogic Portal Domain), see Configuring a WebLogic Server Producer. |
The basic procedure for creating remote portlets is fairly simple: Workshop for WebLogic provides a convenient wizard for this purpose. No programming is required. The basic steps always include:
Figure 4-1 illustrates the basic parts of a federated portal, where the consumer includes a remote portlet. A remote portlet is a proxy for a portlet that is deployed in a producer application.
Tip: | To an end user, the features of the remote portlet are indistinguishable from the actual portlet deployed on the producer. It is possible, however, to customize many of the properties of a proxy portlet, as explained in Configuring Remote Portlets. |
If you want to try the example discussed in this section, you need to run Workshop for WebLogic and perform the prerequisite tasks outlined in this section.
To set up the example environment, perform the prerequisite tasks outlined in Table 4-1. If you are not familiar with the specific procedures for these tasks, they are described in detail in the tutorial Setting Up Your Portal Development Environment.
Figure 4-2 shows the Project Explorer after the prerequisite tasks have been completed.
Tip: | If you do not see the Portlet feature on the New menu, be sure to open the Portal perspective using Window > Open Perspective > Portal. |
remoteExample.portlet
in the File name field, and click Finish. The Select Portlet Type dialog appears. http://wsrp.bea.com/portal/producer?wsdl
You can use another WSDL URL if you want to. Just remember that the pattern for the URL is as follows:
http://
host
:
port
/
webAppName
/producer?wsdl
where host is the host
and port
are the hostname and port number of the server on which the producer is deployed, and webAppName
is the name of the web application in which the producer’s portlets are deployed.
Tip: | If the producer was previously added to the consumer, it will appear in the Select Producer list, and you can simply choose Select Producer and select the producer from the list. |
Tip: | This WSDL URL points to an example producer hosted by BEA. This example producer hosts several demonstration portlets. WSDL stands for Web Services Description Language and is used to describe the services offered by a producer. For more information, see Federated Portal Architecture. |
Checkpoint: At this point, the consumer uses the WSDL to locate the producer and learn about its available portlets. The Producer Details section of the wizard panel now displays information about the producer, including the number of portlets that are available to the consumer, as shown in Figure 4-5.
Tip: | During registration, the producer stores information about the consumer and returns a handle to the consumer. Registration is an optional feature described in the WSRP specification. A WebLogic Portal complex producer implements this option and, therefore, requires consumers to register before discovering and interacting with portlets offered by the producer. See Complex Producers for more information. |
beaProducer
in the Producer Handle field, as shown in Figure 4-6. This handle identifies the producer on the consumer.Checkpoint: At this point the WSDL data from the producer has been retrieved and is displayed in the Producer Details panel of the dialog, as shown in Figure 4-7. Note that four portlets on the producer are available to the consumer.
Note: | If the producer does not require registration, the Producer’s Handle field will appear editable and unitialized. In this case, you must enter an arbitrary value for the producer handle before the Create button will be enabled. |
The new remote portlet shows up in the Project Explorer in the WebContent folder, as shown in Figure 4-10.
To view the portlet, you need to add it to the consumer portal, as explained in this section.
remoteExample.portlet
file from the Project Explorer to the portal. The result is shown in Figure 4-11. In this section you added a remote portlet to a WebLogic Portal consumer application. The consumed portlet is a proxy for a portlet that is deployed in a remote producer application. In addition to the basic setup steps, this example demonstrated the following tasks:
The primary advantage of remote books and pages is that they act as containers for other remote resources. For example, a producer can offer a remote book that contains several remoteable pages, each of which contain multiple remoteable portlets. When you consume that book, the remoteable pages and portlets it contains are consumed as well—no additional steps are required.
Tip: | The term remoteable refers to a book, page, or portlet that is deployed in a producer application and that is offered as remote to consumers. Application developers decide whether or not books, pages, and portlets they create are offered as remote. |
For detailed information on creating remoteable pages and books in a producer application, see Offering Books, Pages, and Portlets to Consumers. If a remote book or page does not appear as you expect it to, see Rules for Creating Remoteable Books and Pages.
Remember that changes you make to a remote book or page are not reflected back to the producer; therefore, after a remote book or page is modified on the consumer, it can become inconsistent with the original book, page, or portlet in the producer application.
You can add remote books and pages to your portal as you would any other book or page.
The procedure for creating a remote page or book is similar to the procedure for creating a remote portlet.
Tip: | This example explains how to create a remote page. The procedure for creating a remote book is similar. |
.page
file, and give the file a name, as shown in Figure 4-14, and click Next. The pattern for the WSDL URL is as follows:
http://
host
:
port
/
webAppName
/producer?wsdl
where host
and port
are the hostname and port number of the server on which the producer is deployed, and webAppName
is the name of the web application in which the producer’s remoteable pages and books are deployed.
Tip: | If the producer was previously added to the consumer, it will appear in the Select Producer list, and you can simply choose Select Producer and select the producer from the list. |
Checkpoint: At this point, the consumer uses the WSDL URL to locate the producer and learn about its available remoteable pages. The Producer Details section of the wizard panel now displays information about the producer, including the number of pages that are available to the consumer, as shown in Figure 4-15.
Tip: | During registration, the producer stores information about the consumer and returns a handle to the consumer. Registration is an optional feature described in the WSRP specification. A WebLogic Portal complex producer implements this option and, therefore, requires consumers to register before discovering and interacting with books and pages offered by the producer. See Complex Producers for more information. |
Checkpoint: At this point the WSDL data from the producer has been retrieved and is displayed in the Producer Details panel of the dialog.
Note: | If the producer does not require registration, the Producer’s Handle field will appear editable and unitialized. In this case, you must enter an arbitrary value for the producer handle before the Finish button will be enabled. |
The new remote page shows up in the Project Explorer in the folder you selected. The page appears as a .page
file, for example, /WebContent/myRemotePage.page
. You can now add the remote page to your portal. Any remoteable portlets on the page will show up in the remote page as inlined portlets. For more information on remoteable portlets, pages, and books as remote, see Offering Books, Pages, and Portlets to Consumers. For information on inlined portlets, see the Portlet Development Guide.
![]() ![]() ![]() |