Oracle9i Application Server Portal Building Advanced Portals Release 3.0.9 Part Number A90098-01 |
|
This chapter describes how to use Oracle Portal to build an interface, or a portal, that contains material such as calendars, reports from your own database, links to external Web sites, and customized HTML. If you've already built several portals and want to work with advanced applications, see Chapter 3, "Creating a line of business page for your intranet portal".
In this chapter, you will create a portal that enables users to access multiple portals and other information from the same screen. The first step in creating a portal is designing the page. You must identify:
For more information on planning how your portal looks and functions, see Chapter 1, "Planning Your Web Content".
You then create the portal page (the screen that displays the applications, links, etc.) with a style you like, create the applications you want to include in the portal, then add those applications to the portal so users can easily access them.
To build a simple intranet portal, use the Page Wizard to create a page and the Customize Page tab set to add and edit portlets. You will also use the Calendar, Form, Sequence, and Link wizards to build an event calendar.
You need Edit or higher access privileges to the demo schema to complete this chapter. You also need Edit or higher application privileges to build the calendar portion of this chapter. If you do not have these privileges, contact your portal administrator.
The following figure illustrates the four parts of your simple intranet portal.
The completed portal is available in the installation package that contains the demo schema. For more information, contact your portal administrator.
This chapter contains the following sections:
Step | Location |
---|---|
Use the Page Wizard to create a page. |
|
Create an HTML portlet that contains your own customized HTML content. |
|
Add and modify a Favorites portlet. |
|
Use the Calendar, Link, Form, and Sequence Wizards to create an updateable calendar portlet. |
Section 2.4, "Create an event calendar and add it as a portlet" |
Display the portal to the public. |
This section shows you how to use the Page Wizard to create a page and design its layout.
For more information: Visit the Oracle Portal Online Help. From the Categories list, choose Page Tasks and click Go. In the right pane, click Creating a page.
Note: If you do not have a user name and password, contact your portal administrator.
The Page Properties tab of the Page Wizard displays.
Page
.
A preview of the style displays below the list.
Tip: If you end your Oracle Portal session, you can always return to this page by going to the Navigator. Click the Pages tab, then My Pages. Then, find <YourName>_Main_Page_Page.
Note: You can change the graphic in the banner by clicking Edit Page, then Portlet. Click the Edit Defaults link in the banner located on the Portlets tab. Under Banner Logo Settings, enter the file name of the Logo you want to use.
The steps in this section show you how to add customized HTML code as a portlet. To create an HTML portlet, you write your own HTML in a text editor and paste it in a portlet, or write HTML directly into the portlet.
HTML portlets are useful when you have HTML you want to copy into your portal, for example a banner. In this section, we create a company news HTML page and paste it into the portlet.
<YourName> Main
page.
It should now appear in the Selected Portlets list.
The Add Portlet page closes.
<html> <body> <li>Nutritionists choose Healthy Living as their #1 wholesaler.</li> <li>Healthy Living allies with so-far-unnamed wholesale healthy pet food company.</li> <li>New associate program now available. Become an affiliate of Healthy Living!</body> </html>
Your portal should now look something like this:
The steps in this section help you customize the Favorites portlet by adding a new favorite link and deleting existing links. You can use the Favorites portlet to maintain and organize your more commonly used services. For example, instead of relying on the bookmarks in your browser, you can add the same links to the Favorites portlet and access the Web sites via your portal.
Note: You may already be on this page. You can verify your location at the bottom of the page.
Favorites now displays in the Selected Portlets list.
The Favorites portlet displays the Oracle Portal default links. You can also new links to this portlet, or enable your users to add and remove links. You might want to add a few commonly-used ones, for example, your organization's Internet address.
The Navigate Favorites page displays.
Oracle Portal creates the new link and displays the Add Favorite page again so you can add another favorite link.
Note: You can click the link at the top of the page to edit the link you just created.
The new Oracle Technology Network favorite now displays on the Navigate Favorites page.
The Oracle Technology Network link should now display in the Favorites portlet.
The steps in this section help you create a calendar application which you can use to add your own events and display them to others users.
Note: To create the components in this section, you must have access to the
<DEMO_SCHEMA>.EVENTS table, where <DEMO_SCHEMA> is the name of the schema where the objects for the demos in this book are installed. You must also be able to create components within the Casebook30_Application application. If you do not have access to this tables to this application, contact your portal administrator. Instructions are in Appendix A of this manual.
To create a view-only calendar, where users can view the dates but not add events, follow the steps in this section (Section 2.4.1). To make the calendar updateable, complete all sections in Section 2.4, "Create an event calendar and add it as a portlet".
For more information about building components: Visit the Oracle Portal Online Help. From the Categories list, choose Application Tasks and click Go. In the right pane, click Building Components.
You should now see the following path:
Path: Applications, Casebook30_Application.
The Calendar Wizard displays.
select e.event_start_date the_date, e.event_title the_name, null the_name_link, null the_date_link, null the_target from <DEMO SCHEMA>.hlw_events e order by 1 Note: You must replace <DEMO_SCHEMA> with the name of the schema where the objects for the demos in this book are installed.
Note: Doing so accepts the defaults in the remainder of the wizard. You can always return to the wizard later to customize the appearance of the calendar.
The calendar displays in a new browser window, and should look something like this:
Note: You may see an error "No Rows Returned," because you don't yet have any data to display in the calendar. After you've created the form in the following section, you can insert data and display the calendar.
You create the following form to enable users to add, update and delete events in the calendar.
Note: To complete this section, you must have UPDATE privileges on the <DEMO SCHEMA>.HLW_EVENTS table, where <DEMO_SCHEMA> is where the demos in this book are installed. If you do not have these privileges, contact your database administrator.
The Form from Table or View Wizard displays.
Note: <DEMO_SCHEMA> is the name of the schema where the objects for the demos in this book are installed.
go('<http://<host name>/pls/<DAD>/<DEMO_SCHEMA>.
<YourName>_EVENT_CAL.show>');
Notes:
Replace <host name> with the URL for Oracle Portal, for example http://mycomputer.domain.com/pls/portal30.
You can find this URL by displaying the Manage Component page for the <YourName>_EVENT_CAL and dragging your mouse over RUN. The URL displays at the bottom of your browser.
If you get an error, ensure you have entered quotes, usually straight quotes ('
), that your browser can recognize.
Doing so builds the form using the default values in the remaining steps of the wizard. If you want to see the default values, click Next in each of the wizard steps, but do not change any of the values. Then, click Finish when you're done.
Note: Selecting this check box enables you to display the form as a portlet.
The new form displays in a separate browser window.
Since users of your calendar will also use the form to update and view events in the calendar, you might also want to customize the way the form displays.
Start Date (DD-MON-YY)
.
The form now displays in a new browser window with the new colors and label names.
Since you will be allowing users to add, update, and delete events by using your new form, you will need to assign sequence numbers to each record. You can use the Create Sequence Wizard to enable Oracle Portal to automatically generate a new sequence number for each record in the database. This way, when a user edits or removes an event, the user (and Oracle Portal) can refer to the sequence number to retrieve the appropriate record.
Note: You must have the MANAGE ALL SCHEMAS global privilege or Manage privileges on the <DEMO_SCHEMA> schema to create database objects. <DEMO_SCHEMA> is where the objects for the demos in this book are installed
For more information: Visit the Oracle Portal Online Help. From the Categories list, choose Administration Tasks and click Go. In the right pane, click Building Database Objects.
<YourName>_EVENT_SEQ now displays in the Database Navigator.
Note: If you don't see the sequence in the list, you may have to click Next, or you can use the Find field.
Tip: Granting access to PUBLIC enables the form you create to use this sequence. Doing so also enables anyone who can use your form to insert records in the database. Note that you can also grant access on a user-by-user or group-by-group basis.
Note: If you select the with Grant Option check box, you will enable the public to grant other users privileges to the database sequence.
#<DEMO_SCHEMA>.<YourName>_EVENT_SEQ.nextval
Now, whenever a user adds an event using the EVENT_FORM, Oracle Portal automatically assigns the new record an ID number. This number is unique to each record, and makes it easy to retrieve, update, and delete the record.
To enable users to update the event calendar, you must create a link between the form and the calendar.
For more information: Visit the Oracle Portal Online Help. From the Categories list, choose Application Tasks and click Go. In the right pane, click Building Components, then click Using a link between components.
The link now displays in the Manage Component page.
Note: Before you perform the following steps, you need to note down the module id of <YourName>_EVENT_FORM, for example, 1130756850. The module id displays in the Run Link field on the Manage Component page for <YourName>_EVENT_FORM.
The SQL Query for your event calendar displays.
select e.event_start_date the_date, e.event_title the_name, <PORTAL_SCHEMA>.wwa_app_module.link?p_arg_names=moduleid&p_arg_ values=<EventFormID>&p_arg_names=_event_id_cond&p_arg_values=%3D&p_arg_ names=_show_header&p_arg_values=YES'||E.EVENT_ID||' ' the_date_link, null the_target from <DEMO_SCHEMA>.hlw_events e order by 1
Notes:
You must change <PORTAL_SCHEMA>
to the name of the schema in which Oracle Portal is installed, and <DEMO SCHEMA>
to the schema where the objects for the demos in this book are installed.
Replace EventFormID
with the module ID of <YourName>_EVENT_FORM that you noted down earlier.
If you get an error running this code, ensure you have entered quotes, usually straight quotes ('
), that your browser can recognize.
You have now finished creating links for your calendar.
You next create a button on the calendar that enables users to access the form.
To do so, enter in the field:
htp.formOpen(owa_util.get_owa_service_path||'<PORTAL_SCHEMA>.wwa_app_ module.link?p_arg_names=_moduleid&p_arg_values=<EventFormID>&p_arg_names=_ sessionid&p_arg_values=&p_arg_names=EVENT_START_DATE&p_arg_ values=%23sysdate&p_arg_names=_event_start_date_cond&p_arg_values=%3D&p_arg_ names=_show_header&p_arg_values=YES'); htp.formSubmit(null, 'New Appointment'); htp.formClose;
Notes:
Replace EventFormID
with the module ID of <YourName>_EVENT_FORM that you noted down in Section 2.4.5.
Copy the code in the calendar column in the `... after displaying the header' field.
If you get an error running this code, ensure you have entered quotes, usually straight quotes ('
), that your browser can recognize.
The event now displays in the calendar.
You can add the finished calendar directly to your intranet portal.
Tip: To add the calendar, ensure that the Casebook30_Application has been exposed as a portlet provider. In the Navigator, click Grant Access next to the application. Ensure the Expose as Portlet Provider check box is selected, then click Apply.
You must also ensure that the calendar can be published as a portlet. In the Navigator, click Manage next to your calendar. On the Access tab, make sure the Publish to Portal check box is selected, then click Apply.
The calendar now displays as a portlet in the right-hand region of your page.
Currently, the only users who can view your portal are the DBA and yourself. To make your portal useful to others, you should grant other users access to the portal.
Tip: To access the Navigator, click in the shortcut bar.
Congratulations! You have created an intranet portal and added different types of portlets to it. You now know how to:
For more information about creating a portal and using portlets, see the Oracle Portal Online Help.
|
Copyright © 2001 Oracle Corporation. All Rights Reserved. |
|