Oracle9i Application Server Portal Building Advanced Portals
Release 3.0.9

Part Number A90098-01
Go To Documentation Library
Library
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Go to previous page Go to next page

2
Creating an intranet portal and adding simple portlets

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. 

Section 2.1, "Create a page" 

Create an HTML portlet that contains your own customized HTML content. 

Section 2.2, "Add customized HTML code as a portlet" 

Add and modify a Favorites portlet. 

Section 2.3, "Add and customize 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. 

Section 2.5, "Displaying the portal to others" 

2.1 Create a page

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.

  1. Log into Oracle Portal.

    Note: If you do not have a user name and password, contact your portal administrator.

  2. On the Portal Home page, click Navigator.

  3. In the Navigator, click the Pages tab.

  4. Next to My Pages, under Actions, click Create.

    The Page Properties tab of the Page Wizard displays.

  5. In the Name field, enter <YourName>_Main_Page_Page.

  6. In the Display Name field, enter <YourName> Main Page.

  7. Click Next.

  8. From the Layout list, choose Two Column Layout.

  9. From the Style list, choose Healthy Living Page Style.

    A preview of the style displays below the list.

  10. Click Next.

  11. Click Next.

  12. Select the Publish As Portlet check box.

  13. Click Finish.

    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.

  14. The Main page now displays in your browser. It should look something like this:

2.2 Add customized HTML code as a portlet

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.

  1. In the Navigator, click the Pages tab.

  2. Click My Pages.

  3. Navigate to the <YourName> Main page.

  4. Next to the page, click Edit.

  5. On the Portlets tab, click .

  6. On the Add Portlets page, click Seeded Providers.

  7. Click Oracle Portal.

  8. Under Building Tools, click HTML Portlet.

    It should now appear in the Selected Portlets list.

  9. Click OK.

    The Add Portlet page closes.

  10. In the HTML portlet banner, click Edit Defaults.

  11. In the Display Name field, enter Healthy Living Company News.

  12. In the Content field, enter the following HTML:

    <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>
    
  13. Click OK.

  14. Click Close.

  15. Scroll down the Pages tab to <YourName>_Main_Page.

  16. Click <YourName>_Main_Page.

Your portal should now look something like this:

2.3 Add and customize a Favorites portlet

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.

2.3.1 Add the Favorites portlet

  1. In the Navigator, click Edit next to <YourName>_Main_Page.

  2. Click the Portlets tab. You should see the portlet divided into two regions

  3. Click in the right region of the portlet.

  4. Click Seeded Providers, then Oracle Portal.

    Note: You may already be on this page. You can verify your location at the bottom of the page.

  5. Under Personal Content, click Favorites.

    Favorites now displays in the Selected Portlets list.

  6. Click OK.

  7. Click Close.

2.3.2 Add a new favorite link

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.

  1. In the Navigator, click <YourName>_Main_Page.

  2. In the Favorites portlet, click Customize.

  3. Click Add or Edit Favorites.

    The Navigate Favorites page displays.

  4. Click Create Favorite.

  5. In the Name field, enter Oracle Technology Network.

  6. In the URL field, enter http://technet.oracle.com.

  7. Click Create.

    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.

  8. Click Close.

    The new Oracle Technology Network favorite now displays on the Navigate Favorites page.

  9. Click Close.

  10. Click OK.

    The Oracle Technology Network link should now display in the Favorites portlet.

2.4 Create an event calendar and add it as a 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.

2.4.1 Create an event calendar using the Calendar Wizard

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.

  1. In the shortcut bar on the Oracle Portal Home page, click .

  2. Click the Applications tab.

  3. Make sure the Path looks like this: Path: Applications. If you do not see this exact path, click Applications to access the root folder.

  4. Under Name, click Casebook30_Application.

    You should now see the following path:
    Path: Applications, Casebook30_Application.

  5. Next to Create New, click Calendar.

    The Calendar Wizard displays.

  6. In the Calendar Name field, enter <YourName>_EVENT_CAL.

  7. In the Display Name field, enter <YourName> Event Calendar.

  8. In the Application list, choose Casebook30_Application.

  9. Click Next.

  10. On step 2 of the Create Calendar Wizard, enter the following SQL query in the SQL Query field:

    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. 
    
    
  11. Click Finish.

    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.

  12. The Manage Component tabbed pages for the new calendar displays.

  13. Click the Access tab.

  14. Select the Publish to Portal check box.

  15. Click Apply.

  16. Click the Develop tab, then click Run.

The calendar displays in a new browser window, and should look something like this:

2.4.2 Create a form to update 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.

  1. In the Navigator, click the Applications tab.

  2. Click Casebook30_Application.

  3. Next to Create New, click Form.

  4. On the Form page, click Forms based on table or view.

    The Form from Table or View Wizard displays.

  5. In the Name field, enter <YourName>_EVENT_FORM.

  6. In the Display Name field, enter <YourName> Event Form.

  7. From the Application list, choose Casebook30_Application.

  8. Click Next.

  9. In the Table or View field, enter <DEMO_SCHEMA>.HLW_EVENTS.

    Note: <DEMO_SCHEMA> is the name of the schema where the objects for the demos in this book are installed.

  10. Click Next.

  11. On the Form Layout tab, make sure Tabular is selected.

  12. Click Next.

  13. In the left pane, make sure FORM is highlighted.

  14. In the right pane, scroll down until you see the PL/SQL text box.

  15. In the text box, enter something like this:

    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.

  16. Click Finish.

    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.

  17. When you click Finish, the Manage Component page for your new form displays.

  18. Click the Access tab.

  19. Select the Publish to Portal check box.

    Note: Selecting this check box enables you to display the form as a portlet.

  20. Click Apply.

  21. Click the Develop tab.

  22. Click Run.

The new form displays in a separate browser window.

2.4.3 Change the appearance of the form

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.

  1. On the Applications tab, next to <YourName>_EVENT_FORM, click Edit.

  2. On the Formatting and Validation Options page, make sure FORM is highlighted.

  3. Under Form Level Options, choose Wheat from the Box Background Color list.

  4. Choose Dude from the Box Background Image list.

  5. Choose Thick Border from the Box Border list.

  6. Order the query by EVENT_START_DATE.

  7. From the list, choose Ascending.

  8. In the left pane, if the FORM item list is collapsed, click .

  9. Click INSERT_TOP.

  10. In the right-hand pane, in the Label field, enter Save.

  11. In the left-hand pane, click INSERT_BOTTOM.

  12. In the right-hand pane, in the Label field, enter Save. Completing steps 9-13 changes the button label to Save in the form.

  13. In the left-hand pane, click EVENT_ID.

  14. In the right-hand pane, in the Label field, enter Event ID#.

  15. In the left-hand pane, click EMPLOYEE_ID.

  16. In the right-hand pane, in the Label field, enter Employee ID#.

  17. In the left-hand pane, click DEPARTMENT_NO.

  18. In the right-hand pane, in the Label field, enter Department#.

  19. In the left-hand pane, click EVENT_START_DATE.

  20. In the right-hand pane, in the Label field, enter Start Date (DD-MON-YY).

  21. In the left-hand pane, click EVENT_END_DATE.

  22. In the right-hand pane, in the Label field, enter End Date (DD-MON-YY).

  23. In the left-hand pane, click START_TIME.

  24. In the right-hand pane, in the Label field, enter Start Time.

  25. In the left-hand pane, click END_TIME.

  26. In the right-hand pane, in the Label field, enter End Time.

  27. In the left-hand pane, click EVENT_TITLE.

  28. In the right-hand pane, in the Label field, enter Title.

  29. In the left-hand pane, click EVENT_DESCRIPTION.

  30. In the right-hand pane, in the Label field, enter Description.

  31. In the left-hand pane, click EVENT_NOTE.

  32. In the right-hand pane, in the Label field, enter Note.

  33. In the left-hand pane, click EVENT_COMPLETED.

  34. In the right-hand pane, in the Label field, enter Completed?.

  35. Click OK.

  36. In the Manage Component tabbed pages, click Run.

The form now displays in a new browser window with the new colors and label names.

2.4.4 Create a database sequence for the form

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.

  1. In the shortcut bar, click .

  2. In the Navigator, click the Database Objects tab.

  3. Next to Path, make sure it says Path: Database Schemas, <DEMO_SCHEMA>. If you do not see this, click Database Schemas to navigate to the root of the directory. Then, find <DEMO SCHEMA> in the list. Click <DEMO SCHEMA> to access the schema.

  4. Next to Create New, click Sequence.

  5. On step 1 of the Create Sequence Wizard, leave the Schema name as <DEMO_SCHEMA>.

  6. In Sequence Name, enter <YourName>_EVENT_SEQ.

  7. Click Next.

  8. On step 2, in the Increment By field, enter 10.

  9. In the Start With field, enter 1000.

  10. Click Next.

  11. On step 3, click Finish

    <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.

  12. In the Database Objects Navigator, next to <YourName>_EVENT_SEQ, click Grant Access.

  13. In the User/Role field, enter PUBLIC.

    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.

  14. From the list, choose SELECT.

  15. Make sure the with Grant Option check box is not selected.

    Note: If you select the with Grant Option check box, you will enable the public to grant other users privileges to the database sequence.

  16. Click Add to List.

  17. Click Close.

  18. Click the Applications tab.

  19. Click CASEBOOK30_APPLICATION. Note that the path should display: Path: Applications, Casebook30_Application

  20. In CASEBOOK30_APPLICATION, find <YourName>_EVENT_FORM. .

  21. Next to <YourName>_EVENT_FORM, click Edit.

  22. On the Formatting and Validation Options page, in the left-hand pane, find the EVENT_ID column. You may have to click next to FORM to display all the columns.

  23. Click EVENT_ID.

  24. In the right-hand pane, find the Validation Options section.

  25. In the Default Value field, enter:

    #<DEMO_SCHEMA>.<YourName>_EVENT_SEQ.nextval
    
    
  26. Click OK.

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.

2.4.5 Create a link between the form and the calendar

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.

  1. On the Applications tab, next to Create New, click Link.

  2. On step 1 of the Link Wizard, in the Link Name field, enter
    <YourName>_EVENT_LINK.

  3. In the Application list, choose Casebook30_Application.

  4. Click Next.

  5. On step 2 of the Links Wizard, select Oracle Portal Component.

  6. In the Target Component or URL field, enter Casebook30_Application.<YourName>_EVENT_FORM.

  7. Click Finish.

    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.

  8. In the Navigator, click the Application tab and navigate to <Your Name> EVENT CAL.

  9. Click Edit.

    The SQL Query for your event calendar displays.

  10. In your SQL query, add your link to the the_name_link column of the query. To do so, edit the SQL query so that it looks something like this:

    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.

  11. Click OK. The calendar displays in the Manage Component page.

    You have now finished creating links for your calendar.

2.4.6 Create a button on the calendar to access the form

You next create a button on the calendar that enables users to access the form.

  1. On the Application tab of the Navigator, next to <YourName>_EVENT_CAL, click Edit.

  2. Click to display the Additional PL/SQL Code tab.

  3. In the Calendar column, find the ...after displaying the header field.

  4. Enter Javascript to create a button called New Appointment that, when clicked, executes the form you created in Section 2.4.3, "Change the appearance of 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.

  5. Click OK.

  6. In the Manage Component page, click Run.

  7. Click New Appointment.

  8. In the form, enter required information in fields displayed in red.

  9. Click Save.

  10. Click your browser's Back button to return to the calendar.

  11. Click your browser's Reload or Refresh button.

    The event now displays in the calendar.

2.4.7 Add the calendar as a portlet

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.

  1. In the shortcut bar on the Portal Home page, click .

  2. Click the Pages tab.

  3. Click My Pages.

  4. Next to <YourName>_Main_Page, click Edit.

  5. In the right region, click to add a row.

  6. In the new column, click to add a portlet.

  7. Click Casebook30_Application.

  8. Click <YourName>_EVENT_CAL.

  9. Click OK.

  10. Click Close.

The calendar now displays as a portlet in the right-hand region of your page.

2.5 Displaying the portal to others

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.

  1. In the Navigator, click the Applications tab.

    Tip: To access the Navigator, click in the shortcut bar.

  2. Navigate to the path: Applications

  3. In the list, next to Casebook30_Application, click Grant Access.

  4. In the Grantee field, type Public.

  5. From the list, select EXECUTE.

  6. Click Add. Public now displays in the Change Access list.

  7. Click OK.

  8. Test the user's privileges by exiting Oracle Portal, then logging in as the user. When you display the Main portal (in the Navigator, click the Pages tab, then find the Main page you created), you should see all the applications you built in Chapter 1.

2.6 Summary

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.


Go to previous page Go to next page
Oracle
Copyright © 2001 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Library
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index