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

# 5
Creating a Human Resources portal with security

This chapter describes how to use Oracle Portal to build a portal for a Human Resources department in a fictitious company (Healthy Living Wholesalers), and how to customize the pages of the portal for different types of users. Here, you will create pages and components, then implement different levels of security and access privileges for these objects. If you are unfamiliar with creating basic pages and components, try building the samples in Chapter 3, "Creating an intranet portal and adding simple portlets" and Chapter 4, "Creating a line of business page for your intranet portal".

In this chapter, you will create three pages for the Human Resources portal, one for all employees (Human Resources), one just for Healthy Living managers (Managers), and one just for Human Resources representatives (HR Reps). You will use the built-in security features to display a different page for each of three types of users: public (all employees), Managers (all company managers), and HR Representatives (all Healthy Living Human Resources representatives). For more information on planning a page, see Chapter 2, "Planning Your Web Content". For information on creating the types of users, contact your portal administrator.

You will use information from an existing content area to enable users to access existing department information via the portal. You can either use the content area we've provided, called the Inside Healthy Living Repository, or create a new one by following the steps in Chapter 6, "Creating an information repository".

You will combine simple components to create complex applications that provide each type of user with a customized workplace. For example, you will create forms, a report, and a calendar that display related information. On the Human Resources tab, an employee can use a public form to submit a vacation request, a report on the Managers' tab displays how much vacation time she has left, as well as a calendar displays the duration of the requested vacation on the manager's page. A link on the calendar takes the manager to an approval form, where she can accept or reject the vacation request.

The following figure illustrates the various parts of the Inside Healthy Living portal, which contains the three tabs of the Human Resources portal.

- The Human Resources page, which contains the public folder of the Human Resources content area (see Chapter 6, "Creating an information repository"), a general job vacancy report, a vacation request form, and an employee search form will look something like the following:

- The Managers page, which contains the Managers' folder of the Human Resources content area, a salary chart, and a tabbed portlet that displays a calendar showing requested vacation time and a form to approve the requests will look something like the following: The HR Representatives page, which contains the HR Representatives' folder of the Human Resources content area, a staff vacation balance report, and a tabbed portlet that displays the job vacancy report and a form to post or close vacancies will look something like the following:

To build the Inside Healthy Living Human Resources portal, you will use the Customize Page wizard to add tabs to an existing page (or the Create Page wizard to create a page if you haven't completed Chapter 3 or 4), the Create Hierarchy wizard to create a company organization chart, and the Create Forms and Create Reports wizards to create forms and reports that relate to one another. You will also use the Grant Access tabs of the Manage Component dialog to implement security at the component level.

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 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 tabs for a portal and apply security to each. | Section 5.1, "Create three tabs for your intranet portal"
Use the Create Hierarchy wizard to build a team organization chart, then link to it from an employee lookup form. | Section 5.2, "Create an employee search form that links to an organization chart"
Use the Create From based on Tables or Views wizard to create a job vacancy lookup form and a job posting form, create dynamic and static lists of values, and use the Create Report from SQL Query wizard to create a job vacancies report. | Section 5.3, "Create components to display and post job vacancies"
Create a database sequence, then create two forms: one to request and one to approve a vacation. Also use the Create Calendar wizard to build a calendar that displays requested vacation time, and a report that display remaining vacation time for each employee. | Section 5.4, "Create a vacation request and approval system"
Use the Grant Access tab of the Manage Component dialog to apply security at the component level. | Section 5.5, "Implement security to control display of components"
Use the Customize Page wizard to design the three tabs of the portal and leverage information from an existing content area in the portal. | Section 5.6, "Design the tabs of the HR portal"

## 5.1 Create three tabs for your intranet portal

In this section, you will add three tabs to the Inside Healthy Living Human Resources portal that pertain only to the Human Resources department. You will create one each for public users, Managers within the company, and HR Representatives. If you did not follow the steps in Chapter 4, "Creating a line of business page for your intranet portal", you must first create a page called "<YourName> Inside Healthy Living," then add three tabs to the page. For more information on creating pages, refer to Section 3.1, "Create a page".

After you create the tabs, you will specify access privileges for each tab. Any user can view the Human Resources tab, only company managers can view the Managers tab, and only HR representatives can view the HR Representatives tab. This way, when a user logs onto Oracle Portal, only one or two of these tabs will display, depending on the type of user. To implement these access privileges, you need access to the two groups we have provided: HR_MANAGERS and HR_REPRESENTATIVES. If you do not have access to these groups, contact your portal administrator.

Note: All portal administrator tasks are detailed in Appendix A, "Oracle Portal Administrator Tasks".

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. In Oracle Portal, navigate to the Pages tab.

2. Click My Pages and find the page called <YourName> Inside Healthy Living.

   Note: You will only see this page if you have followed the steps in Chapter 4, "Creating a line of business page for your intranet portal". If you have not completed Chapter 4, create a page called "<YourName> Inside Healthy Living", then continue with this section. Unlike the illustrations in this chapter, you will not have a Main and Sales page in your portal.

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

4. On the Portlets tab, next to the Sales tab, click .

5. Next to the new tab, click again.

6. Repeat step 5.

7. Name the first tab you created Human Resources.

   Note: If you're not sure how to edit the tabs, see Section 4.1, "Create a tabbed page and add a page as a portlet".

8. Click the Advanced Options tab.

9. Choose the Specify Access Settings radio button.

10. Make sure the Display Tab to Public Users check box is selected.

11. Click Apply.

12. Click Close.

13. Name second tab Managers.

14. Click the Advanced Options tab.

15. Choose the Specify Access Settings radio button.

16. Make sure the Display Tab to Public Users check box is clear.

17. In the Grantee field, enter HR_MANAGERS.

    Note: The name you enter here is the group name for the Managers of the Healthy Living Wholesalers company. If you do not see the HR_MANAGERS group, see your portal administrator. Your portal administrator can either import the groups necessary for this chapter, or create them himself. For more information, see Section A.5, "Create three groups for the Human Resources portal" in Appendix A.

18. From the Privileges list, choose Manage.

    The MANAGE privilege enables all members of the HR_MANAGERS group to modify or delete the page, as well as to grant other groups privileges to the page.

    For more information: Visit the Oracle Portal Online Help. From the Categories list, choose Concepts and click Go. In the right pane, click Who can access a page.

19. Click Add.

    Note: By granting access to a specific group of users, only members of the specified group can view the page.

20. Click Apply.

21. Click Close.

22. Name the third tab HR Representatives.

23. Click the Advanced Options tab.

24. Choose the Specify Access Settings radio button.

25. Make sure the Display Tab to Public Users check box is clear.

26. In the Grantee field, enter HR_REPRESENTATIVES.

27. From the Privileges list, choose Manage.

28. Click Add.

29. Click Apply.

30. Click Close.

31. Click Close.

You have now added three more tabs to the Inside Healthy Living portal you created in Chapter 4, "Creating a line of business page for your intranet portal". The Human Resources tab displays to all users who are logged into Oracle Portal; the Managers tab only displays to users who have been added to the HR_Managers group; the HR Representatives tab only displays to users who have been added to the HR_Representatives group.

Note: Your portal administrator can create a user for each group. To test whether your pages display properly for each type of user, contact your portal administrator.

The tabs of the portal should now look something like this:

## 5.2 Create an employee search form that links to an organization chart

The steps in this section show you how to use the Create Hierarchy wizard to build a company organization chart. You will then create a form that enables users to look up a specific employee within the company database, by employee number, employee name, job title, or department. Then, you will create a link from the form to the team organization chart.

### 5.2.1 Create a team organization chart

In this section, you will create a hierarchy that displays the structure of the Healthy Living Wholesalers departments. The form you create in Section 5.2.2, "Create an employee search form that links to the team organization chart" will link to this hierarchy, so that when users access the form on the portal, they can click the link to display the hierarchy.

For more information: Visit the Oracle Portal Online Help. From the Categories list, choose Concepts and click Go. In the right pane, under Component Types,click What are hierarchies?

1. In the Navigator, go to Casebook30_Application.

   Note: If you do not see this application, contact your portal administrator. If you are not sure how to use the Navigator, try going through the steps in Chapter 3, "Creating an intranet portal and adding simple portlets".

2. On the Applications tab, next to Create New, click Hierarchy.

3. Name the hierarchy <YourName>_GROUPLIST and make sure Casebook30_Application is chosen from the Application list.

4. Base the hierarchy on the <DEMO_SCHEMA>.HLW_STAFF table.

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

5. On the Table or View Column tab, from the Primary Key Column list, choose HLW_STAFF.EMPLOYEE_ID.

6. From the Parent Key Column list, choose HLW_STAFF.MANAGER_ID.

7. From the Start With Column list, choose HLW_STAFF.MANAGER_ID.

8. In the Display Column Expression field, enter HLW_STAFF.NAME.

9. In the Default Start With Value field, enter 1140.

10. Under Drill Up/Down Options, next to Drill Up, from the Type list, choose Text.

11. From the Value Type list, choose Column.

12. In the Value field, enter nvl(job, '(No Title)').

    Note: Entering this value concatenates the job position from the HLW_STAFF table to the employee name. If no job title exists for the employee, "No Title" displays under the employee's name in the hierarchy.

13. Under Full Page Options, find Font Face.

14. Next to Font Size, from the Parent list, choose 10pt.

15. From the Child list, choose 10pt.

16. From the Grandchild list, choose 8pt.

17. On the Hierarchy and Customization Form text tab, in the Display Name field, enter Team Structure.

18. In the Header Text field, enter:

        <b><font face="Arial"><font color="#002299"><font size=+2> The HLW Group
        </font></font></font></b>

19. In the Footer Text field, enter:

        <div align=center>
        <form>
        <font size=+0>
        <input type=button value="Go Back" onClick="javascript:history.go(-1);">

    Note: This footer text adds a "Back" button to the hierarchy so that you can return to the portal once you've clicked on the hierarchy.

20. Finish the wizard and publish the hierarchy to the portal.

    Tip: To publish a component to the portal, go to the Manage Component dialog and click the Access tab. Select the Publish to Portal check box, then click Apply.

When you run the hierarchy, a new browser should display a department's organization that looks something like this:

#### 5.2.1.1 Create a company-wide organization chart

If you want to create an organization chart for your entire company, follow these steps. We do not include this hierarchy in the Inside Healthy Living portal.

1. Create a hierarchy in Casebook30_Application.

2. Name the hierarchy <YourName>_ALLGROUPLIST and make sure Casebook30_Application is chosen from the Application list.

3. Follow steps 4 through 8 in Section 5.2.1, "Create a team organization chart".

4. In the Default Start With Value field, enter 30.

5. Follow steps 10 through 16 in Section 5.2.1, "Create a team organization chart".

6. In the Display Name field, enter Company Structure.

7. Follow steps 18 through 20 in Section 5.2.1, "Create a team organization chart", then click Finish.

You have created a hierarchy component that displays a company's organization.

### 5.2.2 Create an employee search form that links to the team organization chart

The steps in this section show you how to create a form to search for specific employees in the Healthy Living Company. You will also create a link that, when clicked, displays the hierarchy you created in Section 5.2.1, "Create a team organization chart".

#### 5.2.2.1 Create JOB_LIST dynamic list of values

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. Make sure Casebook30_Application is chosen in the Owner drop-down list.

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

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

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

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

       select distinct job
       from <DEMO_SCHEMA>.hlw_staff
       order by job

       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.

10. Click OK.

#### 5.2.2.2 Create the employee search form

1. In Casebook30_Application, create a form based on a table or view.

   Note: If you do not see this application, contact your portal administrator. The steps in Appendix A, "Oracle Portal Administrator Tasks" assist in obtaining the application we have created for you. For more information on creating a form based on a table or view, see Section 4.6.3, "Create a customer entry form".

2. Name the form <YourName>_EMPSEARCH and make sure Casebook30_Application is chosen from the Application list.

3. Base the form on the <DEMO_SCHEMA>.HLW_STAFF table.

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

4. Choose a Tabular Form layout.

5. On the Formatting and Validation Options tab, in the left pane, delete all the buttons except:

   - QUERY_TOP

   - RESET_TOP

6. In the left pane, under TOP_SECTION, delete all columns in the table, except:

   - EMPLOYEE_ID

   - NAME

   - JOB

   - DEPARTMENT_NO

7. Make the following changes to the Form Level Options:

   - Box Background Color = Wheat

   - Box Background Image = Dude

   - Box Border = Thick Border

   - Order by NAME, Ascending

8. Change the font, font color, and font size for all fields to:

   - Font Face = Arial

   - Font Color = Black

   - Font Size = 10pt

9. Change the label for QUERY_TOP to Search.

10. Change the label for EMPLOYEE_ID to Employee#.

11. In the left pane, click JOB.

12. From the Item Type list, choose Combobox.

13. In the Label field, enter Position.

14. From the List of Values list, choose <YourName>_JOB_LIST.

15. Make sure the Default Value field is empty, and that Default Value Type is No Selection.

16. In the left pane, click DEPARTMENT_NO.

17. From the Item Type list, choose Combobox.

18. In the Label field, enter Department.

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

    Note: This is the LOV you created in Section 4.5.3.1, "Create DEPARTMENT_LOV static list of values". If you did not create this LOV, use HLW_DEPT_LOV, which we have provided. If you do not see HLW_DEPT_LOV, contact your portal administrator.

20. Make sure the Default Value field is empty, and that Default Value Type is No Selection.

    Note: If you do not want to link the employee search form to the team organization chart, you can jump to step 25.

21. Next to FORM, click .

    A dialog displays.

22. In the Name field, enter Contact Employee.

23. Click OK.

24. Make the following changes to the Item Level Options for Contact Employee.

    - Item Type = Label Only

    - Label = The HLW Group Organization

    - Link = <DEMO_SCHEMA>.<YourName>_GROUPLIST.show.

      Note: This URL is for the hierarchy you created in Section 5.2.1, "Create a team organization chart". DEMO SCHEMA is the name of the schema where the demo schema objects are installed. See your portal administrator for more information.

    - Font Face = Arial

    - Font Color = Red

    - Font Size = 12pt

25. Finish the form and publish it to the portal.

When you run the employee search form with a link to the hierarchy, it should look something like this:

## 5.3 Create components to display and post job vacancies

The steps in this section show you how to create a report and two forms. One form enables a public user to look up a particular vacancy in the database to determine whether it has been filled. The second form enables an HR representative to post or close a job vacancy. The report displays all current job vacancies.

### 5.3.1 Create a form to look up a specific job vacancy

In this section, you will create a form that will be connected to the job vacancy report. After you create this form, you will create the report, then link to this form from the report.

1. In Casebook30_Application, create a form based on tables or views.

   Note: For more information on creating a form based on a table or view, see Section 5.2.2, "Create an employee search form that links to the team organization chart". If you do not have access to Casebook30_Application, contact your portal administrator.

2. Name the form <YourName>_VACANCYLOOKUP and make sure Casebook30_Application is chosen from the Application list.

3. Base the form on <DEMO_SCHEMA>.HLW_VACANCIES.

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

4. On the Formatting and Validation Options tab, remove the following columns from the form:

   - DEPARTMENT_NO

   - REGION_ID

   - HIRING_MANAGER

   - HR_CONTACT

   - VACANCY_STATUS

5. Remove all buttons except NEXT and PREVIOUS.

6. Change the following Form Level Options:

   - Box Background Color = Wheat

   - Box Background Image = Dude

   - Box Border = Thick Border

   - Order By = VACANCY_ID and VACANCY_TITLE

7. Choose VACANCY_ID in the left pane, then change its Label to Vacancy#.

8. Choose VACANCY_TITLE in the left pane, then change its label to Position.

9. Change the font and font color for the following fields to Arial, Black.

   - VACANCY_ID

   - VACANCY_TITLE

   - RESPONSIBILITIES

   - QUALIFICATIONS

10. On the Form Text tab, in the Header Text field, enter:

        <b><font face="Arial"><font color="#002299"><font size=+0> Look Up a Vacancy
        </font></font></font></b>

11. In the Footer Text field, enter:

        <div align=center><form><font size=+0><input type=button value="Go Back"
        onClick = "javascript:history.go(-1);">

        Note: This footer text adds a "Back" button to the form so that you can return to the
        portal after entering information in the form.

12. Finish the form and publish it to the portal.

When you run the job vacancy lookup form, it should look something like this:

### 5.3.2 Create a form to post or close a job vacancy

The steps in this section show you how to create three LOVs and a form that enables a Human Resources representative to post or close a job vacancy.

#### 5.3.2.1 Create a database sequence for the form

In this section, you will create a database sequence that the job posting form will use when entering records into the database. This sequence will attach an ID number to each record.

1. In the demo schema, create a database sequence for this form.

   Note: For more information on creating a database sequence, see Section 3.4.4, "Create a database sequence for the form".

2. Name the database sequence <YourName>_Vacancy_Seq and make sure the demo schema owns the sequence.

3. On the Start and Increment Values tab, in the Increment By field, enter 1.

4. In the Start With field, enter 10.

5. Finish the wizard and grant the public ALTER access to the sequence.

   Tip: After you've finished the wizard, you'll see the new sequence in the Navigator. Next to the sequence name, click Grant Access. Add the public as a user with ALTER access privileges.

#### 5.3.2.2 Create three LOVs

##### 5.3.2.2.1 Create the Manager dynamic list of values

This list of values will display all employees with the job titles "Manager" or "Administrator" in the Healthy Living company.

1. In Casebook30_Application, create a dynamic list of values.

2. Note: For more information, you can follow the steps in Section 5.2.2.1, "Create JOB_LIST dynamic list of values".

3. Name the list of values <YourName>_MGRLOV.

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 job like '%Manager%'
       or    job like '%Administrator%'
       and   department_no = :depno

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

7. Click OK.

##### 5.3.2.2.2 Create the HR_CONTACTLOV dynamic list of values

This list of values will display all employees in the Human Resources department of the Healthy Living Company. These employees are the HR Representatives.

1. In Casebook30_Application, create a dynamic list of values called <YourName>_HRCONTACTLOV.

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

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

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

       select name, employee_id from <DEMO_SCHEMA>.hlw_staff where department_no =
       70

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

5. Click OK.

##### 5.3.2.2.3 Create the Vacancy_Status static list of values

This static list of values will enable a user to select whether the job vacancy is open or closed.

1. In Casebook30_Application, create a static list of values called <YourName>_VACANCYSTATUS.

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

3. From the Show Null Value list, choose No.

4. In the first row, under Display Value, enter Open.

5. Under Return Value, enter O.

6. Under Display Order, enter 1.

7. In the second row, under Display Value, enter Closed.

8. Under Return Value, enter C.

9. Under Display Order, enter 2.

10. Click OK.

#### 5.3.2.3 Create the form to post or close job vacancies

In this section, you will create a form (which you will later secure so that only HR Representatives can use) that enables a user to post a new job vacancy and update or close an existing one.

1. In Casebook30_Application, create a form based on a table or view.

   Note: For more information on creating a Form based on a table or view, see Section 5.3.1, "Create a form to look up a specific job vacancy". If you do not have access to Casebook30_Application, contact your portal administrator.

2. Name the form <YourName>_VACANCYFORM and make sure Casebook30_Application is chosen from the Application list.

3. Base the form on the <DEMO_SCHEMA>.HLW_VACANCIES table.

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

4. On the Formatting and Validation Options tab, delete the REGION_ID field.

5. Change the following Form Level Options:

   - Box Background Color = Wheat

   - Box Background Image = Dude

   - Box Border = Thick Border

6. In the left pane, click VACANCY_ID and change its label to Vacancy#.

7. In the Default Value field, enter #<DEMO_SCHEMA>.<YourName>_vacancy_seq.nextval.

   Note: DEMO SCHEMA is the name of the schema that owns the database sequence you created in Section 5.3.2.1, "Create a database sequence for the form".

8. From the Form Level Validation list, choose isNumber.

9. Change the label for VACANCY_TITLE to Position.

10. In the left pane, click DEPARTMENT_NO.

11. From the Item Type list, choose Combobox.

12. In the Label field, enter Department.

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

    Note: This is the LOV you created in Section 4.5.3.1, "Create DEPARTMENT_LOV static list of values". If you did not create this LOV, use HLW_DEPT_LOV, which we have provided. If you do not see HLW_DEPT_LOV, contact your portal administrator.

14. Make sure the field Default Value is empty and Default Value Type is No Selection.

15. In the left pane, click HIRING_MANAGER.

16. From the Item Type list, choose Combobox.

17. In the Label field, enter Hiring Manager.

18. From the List of Values list, choose <YourName>_MGRLOV.

    Note: This is the LOV you created in Section 5.3.2.2.1, "Create the Manager dynamic list of values".

19. From the Set the binding(s) for the bind variable(s) defined in the LOV depno list, choose DEPARTMENT_NO.

    Note: For more information on using bind variable LOVs, see Section 4.5.3, "Create two LOVs for the commission search form".

20. Make sure the field Default Value is empty and Default Value Type is No Selection.

21. In the left pane, click HR_CONTACT.

22. From the Item Type list, choose Combobox.

23. In the Label field, enter HR Contact.

24. From the List of Values list, choose <YourName>_HRCONTACTLOV.

    Note: This is the LOV you created in Section 5.3.2.2.2, "Create the HR_CONTACTLOV dynamic list of values".

25. Make sure the field Default Value is empty and Default Value Type is No Selection.

26. In the left pane, click VACANCY_STATUS.

27. From the Item Type list, choose Combobox.

28. In the Label field, enter Status.

29. From the List of Values list, choose <YourName>_VACANCYSTATUS.

    Note: This is the LOV you created in Section 5.3.2.2.3, "Create the Vacancy_Status static list of values".

30. Make sure the field Default Value is empty and Default Value Type is No Selection.

31. In the left pane, delete all buttons except:

    - CREATE_TOP

    - QUERY_TOP

    - RESET_TOP

    - NEXT

    - PREVIOUS

32. Change the font face, font color, and font size for all fields to:

    - Font Face = Arial

    - Font Color = Black

    - Font Size = 10pt

33. On the Form Text tab, in the Display Name field, enter Advertise or Close a Vacancy.

34. In the Header Text field, enter:

        <b><font face="Arial"><font color="#002299"><font size=+0> Advertise a
        Vacancy
        </font></font></font></b>

35. In the Footer Text field, enter:

        <div align=center>
        <form>
        <font size=+0>
        <input type=button value="Go Back" onClick="javascript:history.go(-1);">

    Note: This footer text adds a "Back" button to the form so that you can return to the portal after entering information in the form.

36. Finish the form and publish it to the portal.

When you run the form to post or close job vacancies, it should look something like this:

### 5.3.3 Create a link to connect the vacancy report with the lookup form

1. In Casebook30_Application, create a link.

   Note: For more information on creating a link, see Section 3.4.5, "Create a link between the form and the calendar".

2. Name the link <YourName>_VacancyLink and make sure Casebook30_Application is chosen from the Application list.

3. On the Link Target Type and Name tab, select the Oracle Portal Component radio button.

4. In the Target Component or URL field, enter Casebook30_Application.<YourName>_VACANCYLOOKUP.

   Tip: Enter the name of the form you created in Section 5.3.1, "Create a form to look up a specific job vacancy".

5. Click Finish.

### 5.3.4 Create a report that displays all current job vacancies

1. In Casebook30_Application, create a report from SQL query.

   Note: For more information on creating a report from a SQL query, see the online help.

2. Name the report <YourName>_VACANCIESREPORT and make sure Casebook30_Application is chosen from the Application list.

3. On the SQL Query tab, in the SQL Query box, enter:

       select vacancy_id VacID,
              vacancy_title  Position,
              decode (vacancy_status,'O','Open','C','Closed') status
       from   <demo_schema>.hlw_vacancies
       where  vacancy_status = 'O'

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

4. On the Report Layout tab, choose a Tabular layout.

5. On the Column Formatting tab, next to VACID, enter Vacancy#.

6. From the Align list, choose Right.

7. From the Link list, choose <YourName>_VacancyLink.

   Note: Choose the link you created in Section 5.3.3, "Create a link to connect the vacancy report with the lookup form".

8. Edit the link.

9. In the Set Link Parameters dialog, for VACANCY_ID, choose = from the Condition list, and VACID from the Column Name list.

10. Click Apply.

11. Click Close.

12. Next to Position, make sure the Column Heading Text is Position.

13. Next to Status, make sure the Column Heading Text is Status.

14. On the Display Options tab, under Full Page Options, change the options for Row Text to the following:

    - Type Face = Tahoma

    - Font Size = 10pt

    - Border - Thin Border

    - Font Color = Black

    - Heading Background Color = Green, Pale

    - Table Row Color = White

15. Under Portlet Options, change the options for Row Text to the following:

    - Border = Thin Border

    - Heading Background Color = Green, Pale

    - Table Row Color = White

16. Under Row Order Options, next to Order by 1., choose VACID from the list.

17. On the Report and Customization Form tab, in the Footer Text field, enter:

        <b><font face="Arial"><font color="#002299"><font size=-1> Click on a link
        for position details.</font></font></font></b>

18. Finish the report and publish it to the portal.

When you run the job vacancies report, it should look something like this:

## 5.4 Create a vacation request and approval system

The steps in this section show you how to create a form for employees (public users) to request a vacation, a report that displays employees' vacation balances (for managers and HR representatives), and a calendar that displays all employees' vacations with a link to a form where managers can approve the vacation requests.

### 5.4.1 Create a vacation request form

The steps in this section show you how to create a form where employees can request vacation time. The time requested will then display on a vacation calendar.

#### 5.4.1.1 Create a database sequence for the form

In this section, you will create a database sequence that the job posting form will use when entering records into the database. This sequence will attach an ID number to each record.

1. In the demo schema, create a database sequence for this form.

   Note: For more information on creating a database sequence, see Section 3.4.4, "Create a database sequence for the form".

2. Name the database sequence <YourName>_Vacation_Seq and make sure the demo schema owns the sequence.

3. On the Start and Increment values tab, in the Increment By field, enter 1.

4. In the Start With field, enter 10.

5. Finish the wizard and grant the public ALTER access to the sequence.

   Tip: After you've finished the wizard, you'll see the new sequence in the Navigator. Next to the sequence name, click Grant Access. Add the public as a user with ALTER access privileges.

#### 5.4.1.2 Create EMP_LIST LOV

The steps in this section show you how to create an LOV that will then display as pop-up list in the Vacation Request form you'll create in the next section.

1. In Casebook30_Application, create a dynamic list of values called <YourName>_EMP_LIST.

2. From the Default format list, choose Pop up.

3. From the Show Null Value list, choose %.

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

       select NAME ,
              employee_id
       from   <DEMO_SCHEMA>.hlw_staff
       order  by name

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

5. Click OK.

#### 5.4.1.3 Create the Vacation Request form

The steps in this section show you how to create a form where employees can request vacation time.

You will also use the database sequence you used in Section 5.4.1.1, "Create a database sequence for the form".

1. In Casebook30_Application, create a form based on tables or views.

2. Name the form <YourName>_VACATION_REQUEST and make sure Casebook30_Application is chosen from the Application list.

3. Base the form on the <DEMO_SCHEMA>.HLW_VACATIONS table and choose a Tabular layout.

4. On the Formatting and Validation Options tab, change the following Form Level Options:

   - Box Background Color = Wheat

   - Box Background Image = Dude

   - Box Border = Thick Border

   - Order By = VACA_START_DATE

5. In the left pane, click VACA_ID and change its label to Vacation ID.

6. In the Default Value field, enter #<DEMO_SCHEMA>.<YourName>_Vacation_Seq.nextval.

   Note: DEMO SCHEMA is the name of the schema where the demo schema objects are installed. <YourName>_Vacation_Seq is the name of the database sequence you created in Section 5.4.1.1, "Create a database sequence for the form".

7. In the left pane, click EMPLOYEE_ID.

8. From the Item Type list, choose Popup.

9. In the Label field, enter Employee.

10. From the List of Values list, choose <YourName>_EMP_LIST.

    Note: This is the LOV you created in Section 5.4.1.2, "Create EMP_LIST LOV".

11. Change the following item labels:

    - VACA_START_DATE = Start Date

    - VACA_END_DATE = End Date.

    - VACA_LENGTH = Duration.

12. Change the font, font color, and font size for all fields to:

    - Font Face = Arial

    - Font Color = Black

    - Font Size = 10pt

13. Under BOTTOM_SECTION, delete all the buttons except:

    - PREVIOUS

    - NEXT

14. On the Form Text tab, in the Display Name field, enter Vacation Request.

15. In the Header Text field, enter:

        <b><font face="Arial"><font color="#002299"><font size=+0> Apply for a
        Vacation</font></font></font></b>

16. In the Footer Text field, enter:

        <div align=center>
        <form>
        <font size=+0>
        <input type=button value="Go Back" onClick="javascript:history.go(-1);">

        Note: This footer text adds a "Back" button to the form so that you can return to the
        portal after entering information in the form.

17. Finish the form and publish it to the portal.

When you run the vacation request form, it should look something like this:

### 5.4.2 Create a vacation approval form

The steps in this section show you how to create a form that enables a manager to approve an employee's vacation request.

1. In Casebook30_Application, create a Form based on Tables or Views.

2. Name the form <YourName>_APPROVE_VACATION and make sure Casebook30_Application is chosen from the Application list.

3. Base the form on the <DEMO_SCHEMA>.HLW_VACATIONS table.

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

4. On the Formatting and Validations tab, change the following Form Level Options:

   - Box Background Color = Wheat

   - Box Background Image = Dude

   - Box Border = Thick Border

   - Order By = VACA_START_DATE

5. In the left pane, delete all buttons except:

   - DELETE_TOP

   - RESET_TOP

   - PREVIOUS

   - NEXT

6. Change the following item labels:

   - DELETE_TOP = Reject Request

   - VACA_ID = Vacation ID

   - EMPLOYEE_ID = Employee ID

   - VACA_START_DATE = Start Date

   - VACA_END_DATE = End Date

   - VACA_LENGTH = Duration.

7. Change the font, font color, and font size for all fields to:

   - Font Face = Arial

   - Font Color = Black

   - Font Size = 10pt

8. On the Form Text tab, in the Display Name field, enter Approve Vacation.

9. Finish the form and publish it to the portal.

When you run the vacation approval form, it should look something like this:

### 5.4.3 Create a calendar that displays requested vacation dates

The steps in this section show you how to create a calendar that displays the requested vacation time. You will use an embedded link to enable a manager can click on a link in the calendar to display the approval form you created in Section 5.4.2, "Create a vacation approval form".

Note: Before you perform the following steps, you need to note down the module id of the Vacation Request form you created in Section 5.4.1, "Create a vacation request form". You can find this value by displaying the Manage Component dialog for the form. See your portal administrator for more details.

1. In Casebook30_Application, create a calendar.

   Note: For more information on creating a calendar, see Section 3.4, "Create an event calendar and add it as a portlet".

2. Name the calendar <YourName>_VacationCalendar, and make sure Casebook30_Application is chosen from the Application list.

3. On the SQL Query tab, in the SQL Query field, enter:

       select
           v.vaca_start_date the_date,
           E.name      the_name,
           null               the_date_link,
        '<PORTAL_SCHEMA>.wwa_app_module.link?p_arg_names=_moduleid&p_arg_
       values=<REQUEST_FORM_MODULE_ID>&p_arg_names=_sessionid&p_arg_values=&p_arg_
       names=_employee_id_cond&p_arg_values=%3D&p_arg_names=_show_header&p_arg_
       values=YES'||v.employee_ID||' '       the_name_link,
           null               the_target
       from <DEMO_SCHEMA>.hlw_vacations v
           ,<DEMO_SCHEMA>.hlw_staff e
       where e.employee_id = v.employee_id
       order by 1

   Note: Do not copy and paste the code directly from this text. You should change the text from PORTAL_SCHEMA to the name of the schema in which Oracle Portal is installed, and DEMO SCHEMA name of the schema in which the demo objects are installed. Also, replace "REQUEST_FORM_MODULE_ID" with the module ID of the Vacation Request form that you noted down earlier.

4. On the Display Options tab, in the Link Icon field, enter wgen.gif.

5. On the Calendar and Customization Form tab, in the Footer Text field, enter:

       <b><font face="Arial><font color="#002299"><font size=-1> My Team's Calendar
       </font></font></font></b>

6. Finish the calendar and publish it to the portal.

When you run the calendar that displays requested vacation time, it should look something like this:

Note: You may need to use the Vacation Request form that you created in Section 5.4.1, "Create a vacation request form" to submit data to your database so that the calendar displays.

### 5.4.4 Create a vacation balance report

The steps in this section show you how to create a simple report that displays the remaining vacation balances for all employees. The data in this report changes according to what vacation time has been approved by the manager.

1. In Casebook30_Application, create a report from SQL query.

   Note: For more information on creating a report from a SQL query, see Section 5.3.4, "Create a report that displays all current job vacancies".

2. Name the report <YourName>_VACATION_BALANCE and make sure Casebook30_Application is chosen from the Application list.

3. On the SQL Query tab, in the SQL Query field, enter:

       select e.name   name
             ,e.employee_id  empno
             ,e.vacation_days  vacdays
             ,v.vaca_length vaclen
       from  hlw_staff e
             ,hlw_vacations v
       where e.employee_id = v.employee_id

4. On the Report Layout tab, choose Tabular.

5. On the Column Formatting tab, change the Column Heading Text for the following columns:

   - NAME = Name

   - EMPNO = Employee ID

   - VACDAYS = Accumulated

   - VACLEN = Taken

6. On the Display Options tab, make the following changes to the Full Page Options and Portlet Options:

   - Type Face = Tahoma

   - Font Size = 10pt

   - Border = Thin Border

   - Font Color = Black

   - Heading Background Color = Green, Pale

   - Table Row Color(s) = White

7. Make the following changes to the Row Order Options:

   - Order By = NAME

8. On the Customization Form Display Options tab, in the Display Name field, enter Staff Vacation Time.

9. In the Footer Text field, enter:

       <b><font face="Arial"><font color="#002299"><font size=-1> Current Vacation
       Balances
       </font></font></font></b>

10. Finish the report and publish it to the portal.

When you run the report that displays employees' vacation balances, it should look something like this:

## 5.5 Implement security to control display of components

The steps in this section show you how to manage the security of the components which will not be accessible by the public. Only implement security for objects that will be used by a select group of people. The security we implement here is based on two existing groups: HR Managers and HR Representatives.

For more information: Visit the Oracle Portal Online Help. From the Categories list, choose Application Tasks and click Go. In the right pane, under Building Components, click Granting component access privileges.

In this section, we will enable HR Managers to view any public components and the following:

##### Table 5-1 HR Managers Components

Component | To build this component:
--- | ---
Vacation calendar | See Section 5.4.3, "Create a calendar that displays requested vacation dates"
Vacation Approval form | See Section 5.4.2, "Create a vacation approval form".
Vacation Balances report | See Section 5.4.4, "Create a vacation balance report".

In addition to the public components, we will enable HR Representatives to view:

##### Table 5-2 HR Representatives Components

Component | To build this component:
--- | ---
Advertise a Job Vacancy form | See Section 5.3.2, "Create a form to post or close a job vacancy".
Vacation Balances report | See Section 5.4.4, "Create a vacation balance report".

Contact your portal administrator if you have any questions about the HR Representatives and HR Managers groups.

#### 5.5.0.1 Apply security to the Vacation Calendar

1. In the Navigator, open Casebook30_Application.

2. Next to <YourName>_Vacation_Calendar, click Grant Access.

3. Clear the Inherit Privileges from Application check box.

4. Click Apply.

5. Under Grant Access, in the Grantee field, enter HR_MANAGERS.

6. From the Privileges list, select Customize.

   Note: Choosing Customize enables the members of the HR_MANAGERS group to use the Customize link displayed on the portlets. Clicking the Customize link in the portlet runs the associated Customization Form, where users can change the parameters of the component.

7. Click Add.

   The group displays under Change Access.

8. Click Apply.

9. Click Close.

You can now add the Vacation Calendar to the Manager tab of the Inside Healthy Living portal. For more information, see Section 5.6, "Design the tabs of the HR portal".

#### 5.5.0.2 Apply security to the Vacation Approval Form

1. In the Navigator, open Casebook30_Application.

2. Next to <YourName>_Approve_Vacation, click Grant Access.

3. Follow steps 3 through 9 in Section 5.5.0.1, "Apply security to the Vacation Calendar".

You can now add the Vacation Approval form to the Manager tab of the Inside Healthy Living portal. For more information, see Section 5.6, "Design the tabs of the HR portal".

#### 5.5.0.3 Apply security to the Vacation Balance Report

1. In the Navigator, open Casebook30_Application.

2. Next to <YourName>_Vacation_Balance, click Grant Access.

3. Clear the Inherit Privileges from Application check box.

4. Click Apply.

5. Under Grant Access, in the Grantee field, enter HR_MANAGERS.

6. From the Privileges list, select Customize.

7. Click Add.

   The group displays under Change Access.

8. Under Grant Access, in the Grantee field, enter HR_REPRESENTATIVES.

9. From the Privileges list, select Customize.

10. Click Add.

11. Click Apply.

12. Click Close.

You can now add the Vacation Balance Report to the Manager tab and HR Representatives tab of the Inside Healthy Living portal. For more information, see Section 5.6, "Design the tabs of the HR portal".

#### 5.5.0.4 Apply security to the Advertise Vacancy form

1. In the Navigator, open Casebook30_Application.

2. Next to <YourName>_VacancyForm, click Grant Access.

3. Clear the Inherit Privileges from Application check box.

4. Click Apply.

5. Under Grant Access, in the Grantee field, enter HR_REPRESENTATIVES.

6. From the Privileges list, select Customize.

7. Click Add.

   The group displays under Change Access.

8. Click Apply.

9. Click Close.

You can now add the Advertise Vacancy form to the HR Representatives tab of the Inside Healthy Living portal. For more information, see Section 5.6, "Design the tabs of the HR portal".

## 5.6 Design the tabs of the HR portal

The steps in this section show you how to organize the portlets on your pages so that the appropriate component displays on the relevant page. For example, since only managers can approve vacations, the vacation calendar and the relevant approval form display only on the Managers tab.

You will also leverage the folders in an existing content area called the Inside Healthy Living Repository. For more information on creating this content area, see Chapter 6, "Creating an information repository".

### 5.6.1 Add portlets to the Human Resources tab

The steps in this section show you how to build the main Human Resources page, which is viewable by the public.

1. In the Navigator, next to your Inside Healthy Living page, click Edit.

2. Click the Human Resources tab.

3. Add a column, then add a row to the left region, and a row to the right region.

   Note: If you are not sure how to add columns, rows, or regions to a tab, see Chapter 3, "Creating an intranet portal and adding simple portlets".

4. In the top left region, add a portlet.

5. In the Add Portlets dialog, find Healthy Living Repository.

6. Add the Human Resources folder.

7. Click OK.

8. In the bottom left region, add <YourName>_Vacation_Request.

   Note: This is the form you created in Section 5.4.1, "Create a vacation request form".

9. In the top right region, add <YourName>_VACANCIESREPORT as a portlet.

   Note: This is the report you created in Section 5.3.4, "Create a report that displays all current job vacancies".

10. In the bottom right region, add <YourName>_Employee_Search as a portlet.

    Note: This is the report you created in Section 5.2.2, "Create an employee search form that links to the team organization chart".

11. Click Close.

12. On the Pages tab of the Navigator, click <YourName> Inside Healthy Living to view the portal. Click the Human Resources tab if it's not already highlighted.

The Human Resources tab should look something like this:

### 5.6.2 Build the Managers tab

The steps in this section show you how to design the Managers tab of the Inside Healthy Living portal.

1. In the Navigator, next to <YourName> Inside Healthy Living, click Edit.

2. On the Add Portlets page, click the Managers tab.

3. Add a column, then add a row to the left region.

   Note: If you are not sure how to add columns, rows, or regions to a tab, see Chapter 3, "Creating an intranet portal and adding simple portlets".

4. In the top left region, add the Manager perspective from the Healthy Living Repository (content area).

   Tip: This portlet is under the Inside Healthy Living Repository provider.

5. In the bottom left region, add the View Salary by Department chart from the Tutorial30 Application.

   Note: If you do not see this chart, contact your portal administrator. Or, you can omit this chart from the tab.

6. In the right region, create a two-tabbed portlet.

7. Name the first tab Vacation Calendar.

8. Name the second tab Staff Vacation Balance Report.

9. Add <YourName>_Vacation_Calendar to the first tab.

   Note: This is the component you built in Section 5.4.3, "Create a calendar that displays requested vacation dates".

10. Add <YourName>_Vacation_Balance to the second tab.

    Note: This is the component you built in Section 5.4.4, "Create a vacation balance report".

11. Click Close.

12. On the Pages tab of the Navigator, click <YourName> Inside Healthy Living to view the portal. Click the Managers tab if it's not already highlighted.

The Managers tab should look something like this:

### 5.6.3 Build the HR Representatives tab

The steps in this section show you how to design the HR Representatives tab of the Inside Healthy Living portal.

1. In the Navigator, next to <YourName> Inside Healthy Living, click Edit.

2. On the Add Portlets page, click the HR Representatives tab.

3. Add a column, then add two rows to the left region.

   Note: If you are not sure how to add columns, rows, or regions to a tab, see Chapter 3, "Creating an intranet portal and adding simple portlets".

4. Add one row to the right region.

5. In the top left region, add the HR Rep perspective from the Healthy Living Repository (content area).

   Tip: This portlet is under the Inside Healthy Living Repository provider.

6. In the middle left region, add <YourName>_Vacation_Balance.

   Note: This is the component you built in Section 5.4.4, "Create a vacation balance report".

7. In the bottom left region, add the Update Employee Details form from the Tutorial30 Application.

   Note: If you do not see this chart, contact your portal administrator. Or, you can omit this chart from the tab.

8. In the top right region, create a two-tabbed portlet.

9. Name the first tab Current Job Vacancies.

10. Name the second tab Post or Close a Job Vacancy.

11. Add <YourName>_VACANCIESREPORT to the first tab.

    Note: This is the component you built in Section 5.3.4, "Create a report that displays all current job vacancies".

12. Add <YourName>_VacancyForm to the second tab.

    Note: This is the component you built in Section 5.3.2, "Create a form to post or close a job vacancy".

13. In the bottom right region, add HLW_COMM_REG_CHART from the Casebook30 Application.

14. Click Close.

15. On the Pages tab of the Navigator, click <YourName> Inside Healthy Living to view the portal. Click the HR Reps tab if it's not already highlighted.

The HR Representatives tab should look something like this:

## 5.7 Summary

Congratulations! You have created an intranet portal specific to a department that uses different levels of security to customize the portal. You now know how to:

- Create tabs for a portal and implement security on each tab

- Create a job vacancy portlet where different types of users can either view or post job vacancies

- Create a vacation portlet where employees can request a vacation, then managers can approve them based on a report of vacation balances

- Create an team organization chart using the Create Hierarchy wizard

- Create reports based on SQL queries

- Implement security at the component level and page level

- Leverage content areas in a portal

- Design your portal to demonstrate different functions for each type of employee in your organization

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

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