Oracle Portal Building Portals Release 3.0.8 Part Number A87570-01 |
Library | Service | Contents | Index

# 4
Creating a line of business page for your intranet portal

This chapter describes how to use Oracle Portal to build a portal for a Sales department within the Healthy Living Company intranet. You will create components and pages to make it easy for Healthy Living salespeople to access their customer database, quickly peruse product information, and update their own sales information. They will also be able to view their monthly quotas and commission standings relative to the other salespeople in the company.

You will create a tabbed page for the Healthy Living intranet portal, then add the page you created in Chapter 3, "Creating an intranet portal and adding simple portlets". If you did not complete Chapter 3, you can simply create a new portal in this chapter. You will learn how to build somewhat more advanced applications than you learned in Chapter 3. You will learn how to create different views of your data using the Create Report, Create Chart, and Create Form wizards, and display these three views in the same portlet. You will also learn how to tailor your applications to serve a particular line of business.

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 components in this chapter. If you do not have these privileges, contact your portal administrator.

The following figure illustrates the various parts of the Sales Department 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:

Feature | Location
--- | ---
Create a page with tabs using the Create Page Wizard and add an existing page as a portlet. | Section 4.1, "Create a tabbed page and add a page as a portlet"
Create a folder portlet. | Section 4.2, "Add an existing folder as a portlet"
Use the Create Report from SQL Query Wizard to create a sales report portlet, then use the Create Links and Create Chart from Query Wizards to create a chart with links to the sales report. | Section 4.3, "Create a sales chart portlet that links to a report"
Create two charts, then add them to the same portlet. | Section 4.4, "Create a multi-tabbed region containing two charts"
Create a chart using the Create Chart from SQL Query Wizard, a report using the Report from Query Wizard, and a search form, then add them to a single portlet. | Section 4.5, "Create a multi-tabbed region containing a form, report, and chart"
Create a dynamic LOV that depends on a static LOV and add both to an existing form. Then, arrange the applications you created in the tutorial into a single portlet to provide two views of the same data. | Section 4.5.3, "Create two LOVs for the commission search form"
Use the Create Forms on Tables Wizard to create a customer entry form. | Section 4.6, "Create a customer entry form"
Use the Create Report from Query Wizard to create a product report. | Section 4.7, "Create a product report"
Use the Create Links and Create Menu Wizards to create a menu with links to the customer entry form and product report. | Section 4.8, "Create a menu containing links"

## 4.1 Create a tabbed page and add a page as a portlet

In this section, you will create the layout for the Sales page of the Inside Healthy Living portal. You will also create tabs on the page and add the Main page from Chapter 3 as a portlet.

Note: In order to add the Main page as a portlet, you must select the Publish as Portlet check box on the Access tab of the Customize Main Page dialog.

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 ID and password, contact your portal administrator.

2. In the Navigator, click the Pages tab.

   Note: Next to Path, make sure it reads: Path: Pages.

3. Next to My Pages, click Create.

4. In the Name field, enter <YourName>InsideHLW.

5. In the Display Name field, enter <Your Name> Inside Healthy Living.

6. Click Next.

7. From the Layout Template list, choose Plain Layout.

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

9. Click Next.

10. Click to add a tab to the page.

11. Next to your new tab, called "New Tab," click to add another tab to the page.

12. On the first new tab, click to edit the tab name.

13. In the Display Name field, enter Main.

14. Click Apply.

15. Click Close.

16. On the tab called "New Tab," click to edit the tab name.

17. In the Display Name field, enter Sales.

18. Click Apply.

19. Click Close.

20. Make sure the Main tab is active.

21. Click to add a portlet.

22. Click Other Providers.

23. Click Oracle Portal Pages.

24. Under General, next to <YourName> Main, click to add the page as a portlet.

    Note: If you did not complete Chapter 3, add HLW Main Page as a portlet. This is the page we've created for you to add.

25. Click OK.

    You should now see the layout for the Main page display on the Main tab of your portal.

26. Click Finish.

    Note: You can change the graphic in the banner by clicking on the Edit Defaults link in the banner located on the Portlets tab of the Customize Page dialog. Under Banner Logo Settings, enter the filename of the logo you want to use.

You have created a page containing tabs, and added a page as a portlet. Your portal should look something like this:

## 4.2 Add an existing folder as a portlet

The steps in this section help you to add an existing folder as a portlet. When you add items to a content area, you must organize them into folders so that others can access the items via a portal. Once you've created these folders, you can expose them as portlets. Note that you cannot expose an item as a portlet.

For more information: Visit the Oracle Portal Online Help. From the Categories list, choose Content Area Tasks and click Go. In the right pane, click Working With Folders.

You can also follow these steps to add a content area as a portlet (just select a content area instead of a folder), but only the information in the root folder and the sub-folders will display in the portlet.

1. In the Navigator, click the Pages tab.

2. Navigate to the <YourName> Inside Healthy Living page.

3. Click Edit.

4. Click the Portlets tab.

5. Click the Sales tab.

6. Click .

7. Click Other Providers.

8. Scroll down until you see Inside Healthy Living Repository.

9. Next to Our Company, click to add the folder as a portlet.

   Note: If you do not see the folder in the list of providers, contact your portal administrator.

10. Click OK.

11. Click Close.

    Your portal, containing the folder, should look something like this:

## 4.3 Create a sales chart portlet that links to a report

The steps in this section help you create a report using the Query Wizard. Here, you will link a chart to the report, then display the chart as portlet. This way, users can view the chart, then drill down to the report for more information.

If you have not created an application, follow the steps in Section 3.4.1, "Create an event calendar using the Create Calendar Wizard" to create an application under your name. When you create the application, make sure you select the Expose as Provider check box on the Access tab for the applications.

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.

### 4.3.1 Create the report

To create a chart that links to a report, you must first create the report that displays information related to that displayed in the chart. You will create the chart in Section 4.3.4, "Create a sales chart".

1. In the Navigator, click the Applications tab.

2. Click Casebook30_Application.

   Note: If you do not see this application, contact your portal administrator. Make sure you choose the <DEMO SCHEMA> schema, where DEMO SCHEMA is the schema where the demo schema objects are installed. If you do not have access to this schema, contact your database administrator or refer to Appendix A.

3. Next to Create New, click Report.

4. Click Reports From Query Wizard.

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

6. In the Display Name field, enter <YourName> Regional Sales Report.

7. Make sure Casebook30_Application is chosen from the Application list.

8. Click Next.

9. Next to the Tables or Views field, click .

10. In the search field, enter <DEMO SCHEMA>.HLW_SALES_VIEW and click Find.

    Note: The name of the view should be prefixed by the schema that was installed by your portal administrator. If you do not see the view, or if you're not sure what the schema name is, contact your portal administrator.

11. When the view displays, click it.

    The Search window closes, and the view name now displays in the T able or Views field.

12. Click Add.

    The view name displays under Selected Tables/Views.

13. Click Next.

14. On the Table or View Columns tab, click to move all the columns to the Selected Columns list.

15. Use and to reorder the columns, so that they display like this:

    SALES_VIEW.REGION

    SALES_VIEW.ID

    SALES_VIEW.CUSTOMER

    SALES_VIEW.AMOUNT

16. Click Next.

17. On the Column Conditions tab, click Next.

18. On the Report Layout tab, make sure Tabular is selected.

19. Click Next.

20. On the Column Formatting tab, next to HLW_SALES_VIEW.ID, change the Column Heading to Order#.

21. Next to SALES_VIEW.ID, under Align, choose Left.

22. Click Next.

23. On the Formatting Conditions tab, make the following changes to the first row:

    1. From the Column list: choose NO CONDITION.

    2. From the Row/Col list: choose <DEMO_SCHEMA>_SALES_VIEW.AMOUNT.

    3. From the Background Color list: choose Green, Pale.

24. Click Next.

25. On the Display options tab, under Full Page Options, choose Thin Border from the Border list.

26. From the Heading Background color list, choose Green, Pale.

27. From the Table Row Color(s) list, choose Gray, Light.

28. Under Portlet Options, make the same changes to the Border, Heading Background, and Table Row Color.

29. Under Break Options, choose Left Break from the Break Style list.

30. From the First Break Column list, choose HLW_SALES_VIEW.REGION.

31. Under Row Order options, choose HLW_SALES_VIEW.REGION from the Order By list. Make sure Ascending is chosen.

32. From the first Then By list, choose HLW_SALES_VIEW.CUSTOMER, then make sure Ascending is chosen.

33. From the second Then By list, choose HLW_SALES_VIEW.ID, then make sure Ascending is chosen.

34. Click Next.

35. Under Customization Form Display Options, make the following changes to the first row:

    - Select the Value Required check box.

    - From the Column Name list, choose HLW_SALES_VIEW.REGION.

    - In the Prompt field, enter Region.

36. Under Formatting Options, clear all of the check boxes:

    - Output Format

    - Maximum Rows

    - Break Columns

    - Font Size

    - Order By

    - Layout format

    - Display Name

37. Click Finish.

38. Click the Access tab.

39. Select the Publish to Portal check box.

40. Click Apply, then click Close. Your report is now finished.

### 4.3.2 Testing the sales report

Before you create the chart, you should test the sales report to make sure it works.

1. Display the Develop tab of the Manage Component dialog for the <YourName>_REGIONAL_SALES_REPORT. This dialog should be displaying already if you are continuing from Section 4.3.1, "Create the report".

2. Click Run. Notice that the component displays in a new Web browser window.

   Note: You should get an error: Required field not set yet. This error occurs because you set the report's customization form to request a value.

3. Close the browser window and return to the Web browser window that currently displays the Manage Component dialog for the REGIONAL_SALES_REPORT.

4. In the Manage Component dialog, click Customize.

5. From the REGION drop-down list, choose =.

6. In the field, enter Southeast.

   Note: This field is case-sensitive.

7. Click Run Report.

   The report that displays should look something like this:

### 4.3.3 Create a link to your sales report

In this section, you create the link that connects the chart to the report. Doing so enables you to click on the returned values in the chart to drill down to more information on that value, based on the Regional Sales report you created in Section 4.3.1, "Create the report".

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. In the Navigator, click the Applications tab.

2. Click Casebook30_Application.

3. Next to Create New, click Link.

4. In the Link Name field, enter <YourName>_REGIONAL_SALES_REPORT_LINK.

5. From the Application field, make sure Casebook30_Application is chosen.

6. Click Next.

7. Make sure the Oracle Portal Component radio button is selected.

8. In the Target Component or URL field, enter CASEBOOK30_APPLICATION.<YourName>_REGIONAL_SALES_REPORT.

9. Click Finish.

### 4.3.4 Create a sales chart

The steps in this section help you create the chart that you will then link to the report you created in Section 4.3.1, "Create the report".

1. In the Navigator, click the Applications tab.

2. Click Casebook30_Application.

3. Next to Create New, click Chart.

4. Click Charts From Query Wizard.

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

6. In the Display Name field, enter <YourName> Total Sales Chart.

7. From the Application list, make sure Casebook30_Application is chosen.

8. Click Next.

9. In the Table/Views field, enter <DEMO_SCHEMA>.HLW_SALES_VIEW.

   Tip: If you get an error when trying to use this view, try using the Search window. If you do not see the <DEMO_SCHEMA> schema, contact your portal administrator.

10. Click Next.

11. On the Table or View Columns tab, from the Label list, choose REGION.

12. From the Link list, choose <YourName>_REGIONAL_SALES_REPORT_LINK (the link you just created in Section 4.3.3, "Create a link to your sales report").

13. Next to the Link list, click .

14. In the window that displays, from the Condition list, choose =.

15. From the first Column Name list, choose REGION.

16. Click OK.

17. From the Value list, choose AMOUNT.

18. From the Group Function list, choose SUM.

19. Click Next.

20. On the Column Conditions tab, click Next.

21. On the Display Options tab, under Common Options, choose ORDER BY VALUE from the Order By list.

22. Under Full Page Options, in the Value Format Mask field, enter $ in front of the numerals 999,999,999,999,999.

23. Click Finish.

24. In the Manage Component dialog, click Access.

25. Select the Publish to Portal check box.

26. Click Apply, then Close. Your chart is now finished.

### 4.3.5 Test the chart with links

Now that you've create the report, the link, and the chart, try testing the chart to make sure the links display the corresponding data in the report.

1. In the Manage Component dialog, on the Develop tab, click Run. You should see something like this:

2. Click Northeast. The following should display:

### 4.3.6 Display the chart as a portlet

After you've created the chart with links, you can now display it as a portlet. When you click the links in the chart, the corresponding field in the report will display.

1. In the Navigator, click the Pages tab.

2. Navigate to <YourName> Inside Healthy Living.

3. Click Edit.

4. Make sure the Sales tab is highlighted.

5. Click to add a new region.

   The Sales page should now be divided into two regions, with the folder portlet you added in Section 4.2, "Add an existing folder as a portlet" displaying in the left region.

6. On the Portlets tab, in the left pane, click .

7. In the Add Portlets dialog, click Other Providers.

8. Click Casebook30_Application.

9. Under Casebook30_Application, find the chart called <YourName> Total Sales Chart.

10. Next to the chart, click .

11. Click OK.

12. Click Close.

    The chart displays in your portal.

## 4.4 Create a multi-tabbed region containing two charts

The steps in this section help you create two different charts: one that displays the sales budget for the year, and one that displays the top revenue for each product. You will then display the two charts in a single portlet, along with the chart you created in Section 4.3, "Create a sales chart portlet that links to a report". Doing so enables the salespeople to easily reference each chart, as well as organize their information. You can also use multiple tabs in a region to easily display different views of the same data in the same region.

### 4.4.1 Use the available charts

For your convenience, we've created the two charts you will add to a single portlet. To access these charts, you must have Edit or higher schema access privileges. If you do not have these privileges (or do not know), contact your portal administrator.

Note: For the purposes of this exercise, you can use any charts that you have access to.

### 4.4.2 Add the charts to the same portlet

In this section, you will create a multi-tabbed portlet, then add a chart to each of the tabs.

1. In the Navigator, click the Pages tab.

2. Click My Pages.

3. Next to the Inside Healthy Living Page, click Edit.

4. On the Portlets tab, make sure the Sales tab is highlighted.

5. In the right-hand column, click to add a row to your new column.

6. In the top region of the right-hand column, click to add a tab to the region.

7. Repeat step 7 so that two tabs display in the same region.

   The layout should now look something like this:

8. Next to the first new tab, click .

9. In the Display Name field, enter Sales Budget by Region.

10. Click Apply.

11. Click Close.

12. Follow steps 10 - 12 for the second tab and name it Top Revenues.

13. Click the Sales Budget by Region tab.

14. Click .

15. In the Add Portlets dialog, click Other Providers.

16. Click Casebook30_Application.

17. Next to the chart named Budget Region Chart, click .

18. Click OK.

19. Click the Top Revenues tab.

20. Click .

21. In the Add Portlets dialog, click Other Providers.

22. Click Casebook30_Application.

23. Next to the chart named Top Revenue Chart, click .

24. Click OK.

25. Click Close.

    The tabbed portlet displays on the Sales tab of the portal. The resulting page should look something like this:

## 4.5 Create a multi-tabbed region containing a form, report, and chart

The steps in this section help you create a chart, a report, and a search form that lets you access all sales commission information. You will then display these three components in a single region. Doing so will make it easy for salespeople to view their department's commission information in three different ways.

### 4.5.1 Create a sales commission chart

In this section, you use the Charts from SQL Query Wizard. Creating a chart based on a SQL query is powerful because you can create your own SQL statement. If you want to add a link to this chart, you can also add the link's SQL statement to the SQL statement in the chart.

1. In the Navigator, click the Applications tab.

2. Click Casebook30_Application.

3. Next to Create New, click Chart.

4. Click Charts From SQL Query.

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

6. In the Display Name field, enter <YourName> Sales Commission Chart.

7. Make sure Casebook30_Application is chosen from the Application list.

8. Click Next.

9. In the SQL Query field, enter something like this:

       select
           null     the_link,
           r.region_name Region,
           sum(e.commission) Commission
       from <DEMO_SCHEMA>.hlw_staff e, <DEMO_SCHEMA>.hlw_regions r
       where r.region_id = e.region_id
       group by region_name
       order by 1

       Note: Do not copy and paste the code directly from this text. You must change the
       name of the table according to the name of the schema where the demo schema objects
       are installed.

10. Click Next.

    Note: If you receive an error at this point, you may have entered the SQL query incorrectly. Verify that your SQL statement is accurate. If the statement is correct and you still receive an error, check with your portal administrator to verify that you have access to the <DEMO_SCHEMA> schema.

11. In the Value Format Mask field, enter $ in front of the 999,999,999,999,999.

12. Click Next.

13. On the Customization Form Display Options tab, click Next.

14. In the Header Text field, enter Total Commission for Each Region.

15. Click Finish.

16. In the Manage Component dialog, click Access.

17. Select the Publish to Portal check box.

18. Click Apply.

19. Click Develop.

20. Click Run to test the new chart. The chart should look something like this:

### 4.5.2 Create a sales commission report

In this section, you use the Reports from Query Wizard to create a report that will display on one of the tabs in the multi-tabbed portlet.

1. In the Navigator, click the Applications tab.

2. Click Casebook30_Application.

3. Next to Create New, click Report.

4. Click Reports From Query Wizard.

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

6. In the Display Name field, enter <YourName> Sales Commission Report.

7. Make sure Casebook30_Application is chosen from the Application list.

8. Click Next.

9. Add the two following tables:

   <DEMO_SCHEMA>.HLW_STAFF

   <DEMO_SCHEMA>.HLW_REGIONS

   Note: DEMO_SCHEMA is the name of the schema in which the demo schema objects are installed. To add the tables, enter each table name in the field, then click Add. Once you've added the tables, the table names display below the field.

10. Click Next.

11. On the Join Conditions tab, you should see a default join display:

        HLW_REGIONS.REGION_ID = HLW_STAFF.REGION_ID

    If this default conditions displays, leave it and go to the next step. If this default condition does not display, create the join by choosing the appropriate columns from the lists.

12. Click Next.

13. Select the following columns by clicking on each in the Columns list, then clicking to move the column to the Selected Columns list:

    HLW_REGIONS.REGION_NAME

    HLW_STAFF.EMPLOYEE_ID

    HLW_STAFF.NAME

    HLW_STAFF.COMMISSION

14. Click Next.

15. In the first row, from the Column Name list, choose HLW_STAFF.COMMISSION.

16. From the Condition list, choose not null.

17. Click Next.

18. Make sure Tabular Layout is chosen.

19. Click Next.

20. Under Column Heading, change Region Name to Region.

21. Change Employee Id to Employee#.

22. Next to HLW_STAFF.COMMISSION, under Format Mask, enter $999,999.

23. Click Next.

24. On the Formatting Conditions tab, click Next.

25. Under Full Page Options, choose Thick Border from the Border list.

26. From the Heading Background Color list, choose Green, Pale.

27. Under Portlet Options, change the Border to Thick Border and the Heading Background Color to Green, Pale.

28. Under Break Options, make sure Left Break is chosen.

29. From the First Break Column list, choose HLW_REGIONS.REGION_NAME.

30. Under Row Order Options, choose HLW_REGIONS.REGION_NAME from the Order By list, then choose Ascending.

31. In the next row, choose HLW_STAFF.COMMISSION from the Order By list, then choose Descending.

32. Click Next.

33. On the Customization Form Display Options tab, click Next.

34. On the Report and Customization Form Text tab, in the Header Text field, enter:

         <H4>Report on all Employees and their Commissions by Region</H4>.

35. Click Finish.

36. In the Manage Component dialog, click Access.

37. Select the Publish to Portal check box.

38. Click Apply.

39. Click Develop.

40. Click Run to test the report. The report should look something like this:

### 4.5.3 Create two LOVs for the commission search form

In this section you will create two lists of values (LOVs) that you will then use in Section 4.5.4, "Create a commission search form". One of these LOVs will depend on the items you choose in another LOV.

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 Building Lists of Values.

#### 4.5.3.1 Create DEPARTMENT_LOV static list of values

This LOV will control the items that display in the LOV you will create in Section 4.5.3.2, "Create EMP_LOV dynamic list of values with a bind variable". When you choose a department number from this LOV, the employees of that department will display in the Employee LOV.

1. In the Navigator, click the Applications tab.

2. Click Casebook30_Application.

3. Next to Create New, click List of Values.

4. Click Static List of Values.

5. Make sure Casebook30_Application is chosen in the Owner drop-down list.

6. In the Name field, enter <YourName>_DEPARTMENT_LOV.

7. From the Default format list, choose Combo box.

8. From the Show Null Value list, choose Yes.

9. In the first row, in the Display Value field, enter Head Office.

10. In the Return Value field, enter 10.

11. In the Display Order field, enter 1.

12. Add the following values:

    ##### Table 4-1 Department Static List of Values

    Manufacturing | 20 | 2
    Development | 30 | 3
    Sales | 40 | 4
    Shipping | 50 | 5
    Operations | 60 | 6
    Human Resources | 70 | 7

    Note: Click More to add more rows.

13. Click OK.

#### 4.5.3.2 Create EMP_LOV dynamic list of values with a bind variable

This LOV will change depending on the item chosen from the Department List of Values. When you choose a department number from the DEPARTMENT_LOV, the employees of that department will display in this LOV. To create an LOV that depends on another, you must use a bind variable in its SQL query.

1. Follow steps 1 through 3 from Section 4.5.3.1, "Create DEPARTMENT_LOV static list of values".

2. Click Dynamic List of Values.

3. In the Name field, enter <YourName>_EMP_LOV.

4. From the Default format list, choose Combo box.

5. From the Show Null Value list, choose Yes.

6. In the SQL Query field, enter something like this:

       select NAME, employee_id
       from <DEMO_SCHEMA>.hlw_staff
       where department_no = :deptno
       order by name

       Note: Do not directly copy and paste the SQL from this text. You must replace the
       schema name with the name of the schema where the demo schema objects are
       installed.

7. Click OK.

### 4.5.4 Create a commission search form

Before you can complete this section, you must create the lists of values (see Section 4.5.3, "Create two LOVs for the commission search form"). If you do not want to create the lists of values first, you can always edit this form later.

1. In the Navigator, click the Applications tab.

2. Click Casebook30_Application.

3. Next to Create New, click Form.

4. Click Forms based on table or view.

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

6. In the Display Name field, enter <YourName> Sales Commission Lookup.

7. Make sure Casebook30_Application is chosen from the Application list.

8. Click Next.

9. Add the <DEMO_SCHEMA>.HLW_STAFF table.

   Note: DEMO_SCHEMA is the name of the schema where the demo schema objects are installed. To add a table, enter the table name in the Table or View field.

10. Click Next.

11. Make sure Tabular is selected.

12. Click Next.

13. In the left pane, display the items below FORM.

    Note: If you do not see any items listed below FORM in the left pane, click next to FORM.

14. Here, we'll delete the fields and buttons that we do not need for this form. If you're just creating this form for learning purposes, you can skip this step.

    Next to each of the following items, click to remove the item from the form, then click OK to accept the dialog:

    - INSERT_TOP

    - UPDATE_TOP

    - DELETE_TOP

    - NAME

    - JOB

    - REGION_ID

    - EMPLOYEE_GENDER

    - MARITAL_STATUS

    - USER_ID

    - EMAIL_ID

    - HIRE_DATE

    - ANNUAL_SALARY

    - MANAGER_ID

    - BUDGET

    - VACATION_DAYS

    - EMPLOYEE_ADDRESS

    - EMPLOYEE_CITY

    - EMPLOYEE_ZIP

    - EMPLOYEE_STATE

    - EMPLOYEE_PHONE

    - INSERT_BOTTOM

    - UPDATE_BOTTOM

    - DELETE_BOTTOM

    - QUERY_BOTTOM

    - RESET_BOTTOM

15. In the left pane, click FORM. The form's properties display in the right pane.

16. From the Box Background Image list, choose Dude.

17. From the Box Border list, choose Thick Border.

18. Clear the Show Timing check box.

19. Next to Order By, choose EMPLOYEE_ID from the list, and make sure Ascending is chosen.

20. In the left pane, next to DEPARTMENT_NO, click until DEPARTMENT_NO displays above EMPLOYEE_ID.

21. In the left pane, click QUERY_TOP.

22. In the Label field, enter Search.

23. In the left pane, click DEPARTMENT_NO.

24. From the Item Type list, choose Combobox.

25. In the Label field, enter Department.

26. From the List of Values list, choose <YourName>_DEPARTMENT_LOV.

    Tip: Choose the LOV you created in Section 4.5.3.1, "Create DEPARTMENT_LOV static list of values".

27. In the left pane, click EMPLOYEE_ID.

28. From the Item Type list, choose Combobox.

29. In the Label field, enter Employee.

30. From the Font Color list, choose Black.

31. From the List of Values list, choose <YourName>_EMP_LOV.

    Tip: Choose the LOV you created in Section 4.5.3.2, "Create EMP_LOV dynamic list of values with a bind variable".

32. From the Set binding(s) for the bind variable(s) defined in the lov deptno list, choose DEPARTMENT_NO.

33. Click Next.

34. In the Header Text field, enter Search for Employee Commission.

35. Click Finish.

36. In the Manage Component dialog, click Access.

37. Select the Publish to Portal check box.

38. Click Apply.

39. Click Develop.

40. Click Run to test the form. The form should look something like this:

    Note: You should be able to choose a department name and an employee name from each of the two drop-down lists. These drop-down lists are based on the two LOVs you created in Section 4.5.3, "Create two LOVs for the commission search form".

### 4.5.5 Add the chart, report, and form to the same portlet

In this section, you will add all the components you created to the same portlet.

1. In the Navigator, click the Pages tab.

2. Click My Pages.

3. Next to <YourName> Inside Healthy Living, click Edit.

4. Follow the steps in Section 4.4.2, "Add the charts to the same portlet"and create three tabs with the following names in the bottom right region:

   - Commission Chart

   - Commission Report

   - Commission Lookup

     Note: Remember to click Apply when you change the name of the tab.

5. Add the chart, <YourName> Sales Commission Chart, to the Commission Chart tab.

6. Add the report, <YourName> Sales Commission Report, to the Commission Report tab.

7. Add the form, <YourName> Sales Commission Lookup, to the Commission Lookup tab.

8. Close the Customize Page dialog. The portlet should look something like this (the tab containing the commission form is currently active):

## 4.6 Create a customer entry form

The steps in this section help you create an entry form in which salespeople can add, update, and remove customer information from the database. You can create forms in Oracle Portal that display as portlets, to enable users to easily update and access information in the database.

### 4.6.1 Create a database sequence

In this section, you create a database sequence that the form uses to assign each customer record a unique ID.

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 Navigator, click Database Objects.

   Note: You must have MANAGE ALL SCHEMAS global privilege or Manage privileges on the <DEMO_SCHEMA> schema to create database objects.

2. Under Name, click <DEMO_SCHEMA>.

3. Next to Create New, click Sequence.

4. In the Sequence Name field, enter <YourName>_NEW_CUSTOMER.

   Tip: It's always a good idea to give your database objects (or any component) a meaningful name, particularly when you share your applications with other users.

5. In the Schema list, make sure <DEMO_SCHEMA> is chosen.

6. Click Next.

7. In the Increment By field, enter 1.

8. In the Start With field, enter 1000.

   Note: Setting the two fields with these values causes the customer entries in the database to begin with the number 1000. Every following record will increment by 1, such that the second customer record will have the ID of 1001.

9. Click Finish.

10. In the Navigator, find the new database sequence (<YourName>_NEW_CUSTOMER) on the Database Objects tab.

    Note: You can use the Find field to search for a specific database object.

11. Next to the sequence, click Grant Access.

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

13. Click SELECT in the list.

14. Click Add to List.

15. Click Close.

You have now created a database sequence number that can be used by the form you create in the next section.

### 4.6.2 Create a REGION LOV for the form

1. In the Navigator, click the Applications tab.

2. Click Casebook30_Application.

3. Next to Create New, click List of Values.

4. Click Dynamic List of Values.

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

6. From the Default format list, choose Combo box.

7. From the Show Null Value list, choose Yes.

8. In the SQL Query field, enter something like this:

       select region_name, region_id
       from <DEMO_SCHEMA>.HLW_REGIONS

   Note: Do not directly copy and paste the SQL from this text. You must replace the schema name with the name of the schema where the demo schema objects are installed.

9. Click OK.

### 4.6.3 Create a customer entry form

In this section, you will create a form where salespeople within the Healthy Living company can enter new customers, or update existing customers' information.

1. In the Navigator, click the Applications tab. The objects for Casebook30_Application should display.

   Note: If Casebook30_Application does not display, navigate to it using the links at the top of the page.

2. Next to Create New, click Form.

3. Click Forms based on tables or views.

4. In the Name field, enter <YourName>_CUSTOMER_ENTRY_FORM.

5. In the Display Name field, enter <YourName> Customer Entry Form.

6. In the Application field, make sure Casebook30_Application is chosen.

7. Click Next.

8. In the Table or View field, enter <DEMO_SCHEMA>.HLW_CUSTOMERS.

   Note: DEMO_SCHEMA is the name of the schema where the demo schema objects are installed.

9. Click Next.

10. Select the Tabular radio button.

11. Click Next.

12. In the left pane, under FORM, you should see a list of table columns. If you do not see anything listed under FORM, click , next to FORM.

13. Next to each of the following items, click to remove the item from the form, then click OK to accept the dialog:

    - PASSWORD

    - GENDER

    - AGE

    - INCOME

    - CURRENCY

    - CREDIT_CARD_OWNER_NAME

    - CREDIT_CARD_TYPE

    - CREDIT_CARD_NUMBER

    - CREDIT_CARD EXPIRATION_DATE

    - ADDRESS_LINE2

    - INSERT_BOTTOM

    - UPDATE_BOTTOM

    - DELETE_BOTTOM

    - QUERY_BOTTOM

    - RESET_BOTTOM

14. At the top of the left pane, click FORM to display the Form-Level properties for the form.

15. In the right pane, under Form Level Options, choose World from the Box Background Image list.

16. From the Box Border list, choose Thick Border.

17. Clear the Show Timing check box.

18. From the Order by list, choose ID, then make sure Ascending is chosen.

19. In the left pane, click ID to display the Item Level Options for ID.

20. In the right pane, in the Label field, enter Customer ID.

21. Under Validation Options, in the Default Value field, enter #<DEMO_SCHEMA>.<YourName>_NEW_CUSTOMER.nextval.

    Note: DEMO_SCHEMA is the name of the schema where the schema objects are installed. Also, entering a default value tells this item to base the customer ID number on the database sequence you created in Section 4.6.1, "Create a database sequence".

22. In the left pane, click PHONE_NUMBER to display its properties.

23. In the right pane, in the Label field, enter Phone Number.

24. In the left pane, click EMAIL_ADDRESS to display its properties.

25. In the right pane, in the Label field, enter E-mail Address.

26. In the Input Width field, enter 25.

27. In the left pane, click ADDRESS_LINE1 to display its properties.

28. In the right pane, in the Label field, enter Address.

29. In the Input Width field, enter 40.

30. In the left pane, click CITY.

31. In the right pane, in the Input Width field, enter 25.

32. In the left pane, click POSTAL_CODE.

33. In the right pane, in the Label field, enter Postal Code.

34. In the left pane, click REGION_ID.

35. In the right pane, choose ComboBox from the Item type list.

36. In the Label field, enter Region.

37. In the List of Values field, choose <YourName>_REGION_LOV.

38. Click Finish. Since this form will be accessed via the menu you create in Section 4.8, "Create a menu containing links", you do not need to publish it to the portal.

    Note: You can always go back and change the Input Width for each of the fields, depending on the data you are using.

## 4.7 Create a product report

The steps in this section help you create a report that lists all the products contained in the database. In Section 4.8, "Create a menu containing links", you create a menu portlet that enables users to access this report via a link. You can skip this section if you've already created a report.

You will also use the customization form to allow users to customize the report. The details you specify on this form display when users click the Customize link in the portlet. This way, you can control the default data that displays on the portal page, but users can narrow the report results using the form you create.

1. In the Navigator, click the Applications tab.

2. Click Casebook30_Application.

3. Next to Create New, click Report.

4. Click Reports From Query Wizard.

5. In the Report Name field, enter <YourName>_PRODUCT_LISTINGS.

6. In the Display Name field, enter <YourName> Product Listings.

7. In the Application field, make sure Casebook30_Application is chosen.

8. Click Next.

9. In the Table or Views field, enter <DEMO_SCHEMA>.HLW_PRODUCTS.

   Note: DEMO_SCHEMA is the name of the schema where the demo schema objects are installed.

10. Click Add. The table displays in the Selected Tables/Views list.

11. Click Next.

12. In the Columns list, select the following columns (in Windows, you can press CTRL and click to select multiple columns):

    - HLW_PRODUCTS.ID

    - HLW_PRODUCTS.NAME

    - HLW_PRODUCTS.PRICE

    - HLW_PRODUCTS.DESCRIPTION

13. Click to move the selected columns to the Selected Columns list.

14. In the Selected Columns list, click HLW_PRODUCTS.PRICE.

15. Click to move this column to the end of the list.

16. Click Next.

17. On the Column Conditions tab, click Next.

18. On the Report Layout tab, make sure the Tabular Layout radio button is selected, then click Next.

19. Next to HLW_PRODUCTS.ID, change the Column Heading from Id to Product #.

20. Next to HLW_PRODUCTS.ID, from the Align list, choose Left.

21. Next to HLW_PRODUCTS.DESCRIPTION, from the Width Type list, choose Char.

22. Next to HLW_PRODUCTS.DESCRIPTION, in the Width field, enter 90.

23. Next to HLW_PRODUCTS.PRICE, in the Format Mask field, enter $999,999.99.

24. Click Next.

25. On the Formatting Conditions tab, click Next.

26. Under Full Page Options, choose Thin Border from the Border drop-down list,.

27. From the Heading Background Color list, choose Green, Pale.

28. Under Portlet Options, change the border to Thin Border and the Heading Background Color to Green, Pale.

29. Under Row Order Options, choose HLW_PRODUCTS.ID from the Order By list, then choose Ascending.

30. Click Next.

31. On the Customization Form Display Options tab, click Next.

32. In the Header Text field, enter <CENTER>.

33. In the Footer Text field, enter </CENTER>.

34. Click Finish.

35. In the Manage Components dialog, click Access.

36. Select the Publish to Portal check box.

37. Click Apply.

38. Click Develop.

39. Click Run. The report that displays should look something like this:

## 4.8 Create a menu containing links

In this section, you will create a menu that provides access to various components you've created, such as the Customer Entry Form. Creating menus provides a way of organizing components, folders, and HTML pages in Oracle Portal that users want to easily access from the portal.

### 4.8.1 Create two links for your menu

Before you create a menu, you must create the links that the menu will hold. When the user clicks these links, the corresponding component, page, or item will display.

1. In the Navigator, click the Applications tab.

2. Click Casebook30_Application.

3. Next to Create New, click Link.

4. In the Link Name field, enter <YourName>_PRODUCT_REPORT.

5. Click Next.

6. Select the Oracle Portal Component radio button.

7. In the Target Component or URL field, enter Casebook30_Application.PRODUCT_LISTINGS.

   Note: This field is case-sensitive.

8. Click Finish.

9. In the Manage Component dialog, click Access.

10. Make sure the Inherit Privileges from Application check box is selected.

11. Click Close.

12. Follow steps 3 through 11 to create a second link with the following details:

    - Name = <YOURNAME>_ADD_NEW_CUSTOMER

    - Target Component or URL = Casebook30_Application.CUSTOMER_ENTRY_FORM

    When you've finished, your links should display in the Navigator.

### 4.8.2 Create a menu

In this section, you will create two menu items that will link to the Product Report and Customer Entry Form you created in this chapter. These items rely on the links you created in Section 4.8.1, "Create two links for your menu".

1. In the Navigator, click the Applications tab.

2. Click Casebook30_Application.

3. Next to Create New, click Menu.

4. In the Menu Name field, enter <YourName>_SALES_MENU.

5. In the Display Name field, enter <YourName> Sales Menu.

6. In the Application field, make sure Casebook30_Application is chosen.

7. Click Next.

8. On the Menu Items and Submenus tab, make sure My Menu is highlighted in the left pane.

9. In the Name field, enter <YourName> Sales Menu.

10. Next to My Menu in the left pane, click .

    Note: The menu name updates when you click .

11. Make sure MENU_ITEM_1 is selected in the left pane.

12. In the Name field, enter Product List Report.

13. In the Bullet Icon field, enter sql.gif.

14. Next to the Link field, click .

15. In the Search window, find <YourName>_PRODUCT_LISTINGS (SHOW) (the first link you created in Section 4.8.1, "Create two links for your menu").

16. In the Description field, enter:

17. Check out the latest information from our product listing report. Here, you can view complete pricing information.

18. From the Font Face list, choose Arial.

19. In the left pane, next to Sales Menu, click .

20. In the Name field, enter Customer Entry Form.

21. In the Bullet Icon field, enter sql.gif.

22. In the Link field, click .

23. In the Search window, click <YourName>_CUSTOMER_ENTRY_FORM (SHOW) (the second link you created in Section 4.8.1, "Create two links for your menu"). The link should display in the Link field.

24. In the Description field, enter:

    If you have a new customer, you can enter his information into the database using this customer entry form.

25. From the Font Face list, choose Arial.

26. Click Finish.

27. In the Manage Component dialog, click Access.

28. Select the Publish to Portal check box.

29. Clear the Inherit Privileges from Application check box.

30. Click Apply.

31. Click Develop.

32. Click Edit.

33. Make sure Sales Menu is selected in the left pane.

34. Under Common Options (you may have to scroll down the right pane to find this heading), clear the following check boxes:

    - Show Timing

    - Show Find Option Button

    - Log Activity

35. In the left pane, click Product List Report.

36. Click OK.

37. In the Manage Component dialog, click Run. The menu displays like this:

Try clicking the links to make sure the Product Report and Customer Entry Form both display.

### 4.8.3 Add the menu as a portlet

1. In the Navigator, click the Pages tab.

2. Navigate to <YourName> Inside Healthy Living.

3. Click Edit.

4. Make sure the Sales tab is highlighted.

5. In the left region, click .

6. In the Portlet Repository list, find the Sales Menu and click to add it.

7. Click OK.

8. Click Close.

9. Display the page in your browser. The final portal should look something like this:

## 4.9 Summary

Congratulations! You have created an intranet portal specific to a line of business, and added different types of portlets to it. You now know how to:

- Create a page.

- Add a folder as a portlet.

- Create a report using the Report Based on a SQL Query.

- Create a chart containing links to a report

- Create a multi-tabbed portlet containing three charts

- Create a multi-tabbed portlet containing three views of the same data (report, chart, and form)

- Create a customer entry form containing:

  - static list of values

  - dynamic list of values

  - a dynamic list of values that depends on a static list of values

- Create a report using the Report from Query Wizard.

- Create a menu containing links

- Create a bind variable list of values

For more information about creating a portal and using portlets, see the Oracle Portal Online Help.

| Copyright © 2001 Oracle Corporation. All Rights Reserved. |
Library | Service | Contents | Index