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 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 Understanding Producers and Consumers. |
Table 6-1 summarizes which Oracle tools you can use to create and consume remote books, pages, and portlets. Although you can consume remote portlets using Workshop for WebLogic, you cannot consume remote books and pages. Workshop for WebLogic 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 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 Portlet Development Guide.
If you want to create books and pages that are accessible to remote consumer applications, you must use Workshop for WebLogic.
To make a remoteable book or page in Workshop for WebLogic, as the following procedures explain, you must create the book or page as a standalone .book
or .page
file. In Workshop for WebLogic, 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 Portal Development Guide. |
This section includes these topics:
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 6-2. If you are not familiar with the specific procedures for these tasks, they are described in detail in the WebLogic Portal tutorial “Setting Up Your Portal Development Environment.”
Figure 6-2 shows the Package Explorer after the prerequisite tasks have been 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:
Tip: | To create a remoteable book, select Book instead of Page. |
WebContent
, and the filename is myPage.page
.
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.
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 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:
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
).
.book
and .page
files as explained previously in Creating a Remoteable Page (or Book). .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. .book
or .page
file in a producer application has no effect when the book or page is consumed.