An OracleAS Portal Dynamic Page allows developers to control every aspect of their OracleAS Portal component. Unlike in the OracleAS Portal Reports and Forms wizards, there are no wizard pages here to specify column or page formatting, color or font specification, or portlet settings. While this OracleAS Portal component gives the developer the most flexibility when designing his or her portlet, the developer must handle all details of formatting, validation, and appearance.
Tip | It is important to note that the name Dynamic Page can be a little misleading. Most of the time, developers create these components to be used as portlets that are then placed on OracleAS Portal pages. Placing a Dynamic Page portlet on a page does not affect the characteristics of that page ”it s still an OracleAS Portal page. If the Dynamic Page is displayed in stand-alone mode, then it truly is a dynamic page; otherwise , it is just a dynamic portlet that is placed on an OracleAS Portal page. |
Figure 9-26 shows the first page of the Dynamic Page Wizard. Figure 9-27 lists Step 3 of 8 (what does Oracle have against Step 2?). On this page, we specify the HTML code that will be used to drive our dynamic HTML page. If you look at the code closely, you ll see a code snippet that looks like this:
<oracle>select * from portal_demo.emp</oracle>
For dynamic pages, Oracle introduces a new tag: <oracle>. This tag allows you to embed SQL or PL/SQL code directly into your dynamic HTML page. When the portlet is displayed, the code between the <oracle> and </oracle> tags is automatically replaced with HTML code to display the results of the query. Multiple <oracle> and </oracle> tags can be specified, but you cannot embed <oracle> tags inside of other <oracle> tags.
One of the most overlooked capabilities of this feature is the ability to use the htp.print function within Oracle to send HTML tags to the OracleAS Portal engine as in the code that follows (line numbers have been added for readability):
1 <HTML> 2 <HEAD> 3 <TITLE>Employees</TITLE> 4 </HEAD> 5 6 <BODY bgColor="#D3D3D3"> 7 8 <H2>Employees</H2> 9 <ORACLE> 10 declare 11 link_string varchar2(500); 12 link_string2 varchar2(500); 13 begin 14 htp.print(