Oracle® Fusion Middleware Federated Portals Guide for Oracle WebLogic Portal 10g Release 3 (10.3.4) Part Number E14235-05 |
|
|
View PDF |
WebLogic Portal producer applications can offer books, pages, and portlets to consumers. This chapter explains the procedures and best practices involved in making books, pages, and portlets remoteable.
Tip:
In this chapter, we use the term remoteable to refer to a book, page, or portlet that is deployed in a producer application. To be remoteable, the Offer As Remote property of the book, page, or portlet must be set to true, as explained in later in this chapter.
This chapter includes these sections:
A complex producer can offer remoteable books, pages, and portlets. When a page or book is offered as remote from a complex producer application, the nested contents of the page or book are, by default, also offered as remote. This means that you can group multiple portlets in a page, for example, and a WebLogic Portal consumer can then consume both the page and its portlets in one operation.
Tip:
Portlets deployed in a simple application can also be remoteable; however, only complex producers can offer remoteable books and pages. See Chapter 8, "Configuring a WebLogic Server Producer" for more information on creating remoteable portlets in a WebLogic Server application. For information on simple and complex producers, see Section 3.4, "Understanding Producers and Consumers".
Table 6-2 summarizes which Oracle tools you can use to create and consume remote books, pages, and portlets. Although you can consume remote portlets using Oracle Enterprise Pack for Eclipse, you cannot consume remote books and pages. Oracle Enterprise Pack for Eclipse does not provide a feature for locating and consuming remote books and pages. If you want to incorporate remote books and pages into a WebLogic Portal consumer application, you must use the WebLogic Portal Administration Console, see Chapter 18, "Adding Remote Resources to the Library."
By default, all portlets deployed in a WebLogic Portal producer application are available to consumers as remote portlets. You can, however, specify which portlets are actually available to consumers by setting the Offer As Remote property in the Properties view for the portlet, as shown in Figure 6-6.
If you want a portlet to be available to consumers, set Offer As Remote to true
(the default). If you want to hide a portlet from consumers, set Offer As Remote to false
.
For detailed information on creating portlets and setting properties, see the Oracle Fusion Middleware Portlet Development Guide for Oracle WebLogic Portal.
If you want to create books and pages that are accessible to remote consumer applications, you must use Oracle Enterprise Pack for Eclipse.
To make a remoteable book or page in Oracle Enterprise Pack for Eclipse, as the following procedures explain, you must create the book or page as a standalone .book
or .page
file. In Oracle Enterprise Pack for Eclipse, you can do this by selecting New > File > Other > WebLogic Portal > Book (or Page).
Tip:
For more information on creating and working with pages and books, see the Oracle Fusion Middleware Portal Development Guide for Oracle WebLogic Portal.
This section includes these topics:
If you want to try the example discussed in this section, you need to run Oracle Enterprise Pack for Eclipse and perform the prerequisite tasks outlined in this section.
To set up the example environment, perform the prerequisite tasks outlined in Table 6-2. If you are not familiar with the specific procedures for these tasks, they are described in detail in the Oracle Fusion Middleware Tutorials for Oracle WebLogic Portal.
Task | Recommended Name |
---|---|
Create a WebLogic Portal domain. |
producerPortalDomain |
Create a Portal EAR Project. |
producerEAR |
Create an Oracle WebLogic Server v10.x. |
N/A |
Associate the EAR project with the server. |
N/A |
Create a Portal Web Project and add it to the EAR. |
producerWebProject |
Figure 6-2 shows the Package Explorer after the prerequisite tasks have been completed.
Figure 6-2 Package Explorer After Prerequisite Tasks are Completed
Tip:
The procedure for creating a remoteable book is almost identical to the procedure for creating a page. Rather than reproduce both procedures here, we explain how to create a remoteable page and, where appropriate, highlight any differences between the two procedures.
To create a page in a producer application that is accessible to consumer applications:
Start Oracle Enterprise Pack for Eclipse.
Create a Portal Web Project, as explained in the previous section.
Select File > New > Other.
In the New – Select a wizard dialog, open the WebLogic Portal folder, select Page, and click Next.
Tip:
To create a remoteable book, select Book instead of Page.
In the New Page dialog, select a parent folder for the new page and enter a name for the page, as shown in Figure 6-3. In this example, the parent folder is WebContent
, and the filename is myPage.page
.
Click Finish.
Checkpoint: The file myPage.page
is added to the Portal Web Project in the folder you specified, as shown in Figure 6-4.
In addition, the page opens in the editor, as shown in Figure 6-5.
Figure 6-5 Page File Displayed in the Editor
Click on the border of the page to display the page's Properties view. If the Properties view is not currently available, select Window > Show View > Properties.
Note that, by default, the Offer As Remote property is set to true
for this .page
file, as shown in Figure 6-6. This property setting means that this page, and any books, pages, and portlets you add to it (according to the rules discussed in Section 6.4, "Rules for Creating Remoteable Books and Pages") will be visible to consumers if their respective Offer As Remote properties are also set to true
.
You can treat the page shown in Figure 6-5 like any other page. You can add books and portlets to it and you can drag and drop the page into a portal. If you create a remote book, you can add pages to it, and those pages can in turn contain portlets and other books.
The key points to remember with respect to making a page (or book) accessible to remote consumers are:
If you have a book or page that is offered as remote, but none of the book's or page's contents (other books, pages, and portlets) are offered as remote, the book or page will not be visible to consumers. To be visible, a book or page must be offered as remote and must contain at least one other entity that is offered as remote.
For example, Figure 6-7 shows a sample configuration. In this configuration, consumers can locate Book_1
. To a consumer, Book_1
contains one page, Page_2
. Because Page_1
is not offered as remote, it will not be visible to consumers, nor will any of its contents.
Figure 6-8 shows another sample configuration. In this case, Book_1
is offered as remote; however, it is not visible to consumers. This is because none of its contents are offered as remote. Page_1
is not offered as remote explicitly and Page_2
is not offered as remote because it is empty (even though its property is set to true
).
Remoteable books and pages must be created as standalone .book
and .page
files as explained previously in Section 6.3.2, "Creating a Remoteable Page (or Book)".
Changes to remoteable pages and books made on the producer cannot be propagated to consumers of those pages and books. This means that if you change a remoteable page or book in a producer application, and that page or book has already been consumed by consumer applications, the changes will not show up in the consumers.
Portal look and feel elements that are used in .page
and .book
files must be replicated on the consumer. This means that look and feel files, such as .layout
, .theme
, and supporting JSP files that are used in a remoteable book or page must exist on both the producer and the consumer.
A backing file placed on a remoteable .book
or .page
file in a producer application has no effect when the book or page is consumed.