Chapter 10: Advanced Oracle Application Server Portal Components

In the previous chapter, we looked as some of the basic Oracle Application Server Portal components. These components provide a solid foundation for developers to create Oracle Application Server Portal pages that end users can use to interact with data stored within your organization. Those components, however, only make up a small percentage of what is available to you as an Oracle Application Server Portal administrator, developer, or content owner. There are more components that you can use to provide greater functionality to your end users, and content management features that allow you to place items that don t fit into traditional programming constructs such as forms or reports onto your portal. An example of content might be a Microsoft Word document or an Adobe Portable Document Format (PDF) file and, as we will see later in his chapter, content administrators have great flexibility as to how these content items are published (made available) on your web pages. The first half of this chapter will deal with the advanced Oracle Application Server Portal components, and the second half is devoted to other advanced topics such as Oracle Application Server Portal page design and Oracle Application Server Portal content.

Oracle Application Server Portal Advanced Components

In the previous chapter, we looked at the basic Oracle Application Server Portal components that can be built out of the box using the wizards provided for developers, including Oracle Application Server Portal Forms, Reports, Charts , Dynamic Pages, and list-of-values (LOVs). This chapter section will focus on the Oracle Application Server Portal advanced components:

  • Oracle Application Server Portal Calendars

  • Oracle Application Server Portal Hierarchies

  • Oracle Application Server Portal Menus

  • Oracle Application Server Portal URLs

  • Oracle Application Server Portal Links

  • Oracle Application Server Portal Data Components

Oracle Application Server Portal Calendars

A calendar is a graphical object that can be used to display links that reference specific records in your database. By default, the record must have a date field, or a field that can be converted into a date field by way of the TO_DATE SQL function if you intend to use it with an Oracle Application Server Portal Calendar. The calendar then displays with corresponding links in the calendar, which end users can drill down to get more information. As we will see, the trickiest part of building a calendar for use in our portal will be constructing the appropriate query to return data that will drive the calendar. This query is similar to the query we constructed when building the Oracle Application Server Portal Chart component in the previous chapter.

Figure 10-1 shows the first step of the Oracle Application Server Portal Calendar Wizard. Like the first pages of the other wizards we have seen up to this point, the developer is prompted for the name of the Oracle Application Server Portal Calendar object (which is stored internally, and has no spaces or special characters), the display name (what is displayed in the Oracle Application Server Portal Navigator, and can contain spaces and special characters ), a free-form comment field, and which Oracle Application Server Portal provider this component is associated with. The next screen (Figure 10-2) is Step 3 in the wizard (as was the case with some of the wizards we explored in the previous chapter, there is no Step 2).

click to expand
Figure 10-1: The first step of the Calendar Wizard
click to expand
Figure 10-2: The third step of the Oracle Application Server Portal Calendar Wizard

If you worked through the examples in the previous chapter, and the Oracle Application Server Portal Chart example in particular, this page should look familiar to you. On this page, we will need to construct a query in a specific format that the Oracle Application Server Portal engine will use to display the calendar when it is called. By default, the following query appears:

 select     EMP.HIREDATE the_date,     EMP.ENAME    the_name,     null         the_name_link,     null         the_date_link,     null         the_target,     null         the_intermedia from SCOTT.EMP order by EMP.HIREDATE 

This serves as a template for how the query is expected to look for this component. There are six aliases in the query. Only the first two fields (the_date and the_name) are required; the others can be ignored (null in the above query), but must still be aliased in the query:

  • the_date This field is what the calendar uses to determine where to display the data. Normally, it s queried directly from a DATE column in the database, but this field can be modified with the TO_DATE SQL function to convert the field into a DATE.

Using the TO_DATE function can be very handy when dealing with Oracle 9i and 10g s external table function. External tables are defined as tables that do not reside in the database, and can be in any format for which an access driver is provided. This feature gives developers the ability to treat any data source (including text files) as if it were part of an Oracle database. If, for example, you wanted to reference a text file that looked like this:

 101,Gregg Petri,Senior Consultant,31-AUG-2001 102,Robin Fingerson,Technical Management Consultant,01-FEB-2001 103,Gillian Kofal,Senior Consultant,30-NOV-2000 104,Shaun OBrien,Technical Management Consultant,15-JUL-2000 105,Brad Gibson,Technical Management Consultant,01-JAN-2000 

you could write a query like this to reference the data in an Oracle Application Server Portal Calendar:

 select to_date(REVIEW_DATE,DD-MON-YYYY) the_date, EMP_NAME     the_name, null         the_name_link, null         the_date_link, null         the_target, null         the_intermedia from external_tab 
  • the_name This field displays cell text from this table or view column according to the dates in the_date column.

  • the_name_link This field specifies a link from the values in the_name column to another component or URL.

    Note  

    We have not discussed links yet (they are covered later in this chapter in the section Oracle Application Server Portal Links) but for now, understand that links are a way of linking two different Oracle Application Server Portal components together. When an Oracle Application Server Portal component is displayed that has a link on it, data on the component is displayed as an HTML link. The user can click on the link to be taken from the current component to another Oracle Application Server Portal component (form, report, etc.).

  • the_date_link This field specifies a link from the values in the_date column to another component or URL.

  • the_target This field specifies the URL of a frame in a web page. Enter this column if you want to link to a specific frame in a URL.

    Tip  

    While it is possible to use frames in Oracle Application Server Portal by way of Frame Drivers, they are difficult to use and tedious to program. In general, it is much easier to use the various Page Layout features of Oracle Application Server Portal (discussed later in this chapter in the section Oracle Application Server Portal Page Design) to format your page than it is to use Frame Drivers. As such, Frame Drivers are not discussed in this chapter.

  • the_intermedia This field displays intermedia from this table or view column according to the dates in the_date column.

    Tip  

    For more information on Oracle interMedia, see the Oracle interMedia User s Guide (Oracle Part number A88786-01, http://download-west.oracle.com/docs/cd/A91202_01/901_doc/appdev.901/a88786.pdf).

Some of the fields in the above query are database columns and some are Oracle Application Server Portal objects, which often confuses beginning Oracle Application Server Portal developers. The following fields must be columns in the database objects specified in the FROM clause:

  • the_date

  • the_name

  • the_intermedia

The following fields must be Oracle Application Server Portal objects and are not found in any of the database objects referenced in the FROM clause of the query:

  • the_name_link

  • the_date_link

  • the_target

 select     HIREDATE             the_date,     ENAME - 


Oracle Application Server 10g Web Development
Oracle Application Server 10g Web Development (Oracle Press)
ISBN: 0072255110
EAN: 2147483647
Year: 2004
Pages: 192

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net