Logging in to Oracle Application Server Portal for the First Time

When Oracle Application Server 10 g is installed with either the Portal and Wireless or Business Intelligence and Forms options, Oracle Application Server Portal is installed also. Before we can access the Oracle Application Server Portal environment, the necessary components must be up and running. Use the dcmctl tool (in the $ORACLE_HOME/dcm/bin directory) to see if the Oracle Application Server Portal Oracle Application Server Containers for J2EE (OC4J) container is running:

 C:\AS_HOME\dcm\bin>dcmctl getstate -v Current State for Instance:AS_HOME.xpas10  g  Component               Type          Up Status     In Sync Status ====================================================================== 1   HTTP_Server             HTTP_Server   Up            True 2   OC4J_BI_Forms           OC4J          Up            True 3   OC4J_Portal             OC4J          Up            True 4   OC4J_Wireless           OC4J          Up            True 5   home                    OC4J          Up            True 

If you are running on a server that has both the infrastructure and middle tier on the same machine, make sure you run this command from the ORACLE_HOME location of the middle tier . If the OC4J_Portal component is not running for any reason, you can start it by executing the following command:

 dcmctl start -co OC4J_Portal -v 

Oracle Application Server Portal also depends on the security functions built into Oracle Application Server 10 g . To check to make sure that the security piece is up and running, cd to the ORACLE_HOME of your infrastructure, then to the dcm\bin directory. Execute the following command:

 C:\IS_HOME\dcm\bin>dcmctl start -v Current State for Instance:IS_HOME.xpas10  g  Component               Type          Up Status     In Sync Status ====================================================================== 1   HTTP_Server             HTTP_Server   Up            True 2   OC4J_SECURITY           OC4J          Up            True 3   home                    OC4J          Down          True(Disabled) 

If the OC4J_SECURITY component is not running for any reason, start it with the following command:

 dcmctl start -co OC4J_SECURITY -v 

To access Oracle Application Server Portal for the first time, enter the URL in your web browser from the following template:

http://<server>:<port>/pls/portal

The machine I used for the examples in this chapter is called xpas10 g and the middle tier was installed on port 7778, so to access Oracle Application Server Portal on this server:

 http://xpas10g:7778/pls/portal 
Tip  

During installation, Oracle will attempt to use port 7777 for your Oracle Application Server 10g instance. If, for whatever reason, port 7777 is not available, Oracle will try 7778, then 7779, and so on. If your middle tier and infrastructure installations are on separate machines, then both will use 7777 (unless some other application is using that port). If you chose to install both the infrastructure and middle tier on the same machine, then, most likely, the infrastructure will use 7777 and the middle tier will use 7778. Oracle Application Server Portal lives in the middle tier, so use the middle tier port number to access it. It is important to note that while Oracle Application Server s Portal Page Engine (PPE) lives in the middle tier, it is dependant on both the middle-tier and the infrastructure for both meta-data and identity management.

If all of the necessary components are up and running, you should see a page similar to Figure 8-1.

click to expand
Figure 8-1: The initial Oracle Application Server Portal page

As with virtually every Oracle Application Server Portal page you will work with, a lot of information is displayed. This page serves as both a welcome to the Oracle Application Server Portal environment and as an example of a typical Oracle Application Server Portal page. As you work with Oracle Application Server Portal, you will become comfortable with the basic layout of an Oracle Application Server Portal page (although, as a developer, you have great flexibility to make your Oracle Application Server Portal pages look like whatever they want) and this welcome page contains all of the basic Oracle Application Server Portal page elements.

Along the top of the page (above the first horizontal line) there is a page region called the banner. Although your portal pages do not have to contain a banner, it is included in all Oracle Application Server Portal templates when it comes time to build and deploy your Oracle Application Server Portal pages. There is an image on the left, a title (Portal Builder), and links on the right. Below the links on the right is a tab that says Welcome. Tabs are like banners ”they are not required, but are included as standard page elements in Oracle Application Server Portal. Below the Welcome tab is the main part of the page.

A key concept to understand when working with Oracle Application Server Portal and the various Oracle Application Server Portal elements is the one-to-many relationship. Oracle used this concept many times when constructing the Oracle Application Server Portal environment. A one-to-many relationship describes one where there is one parent record and one or more child records. Child records cannot exist without a parent record, but a parent record may exist without any child records. As an example, say one of us walks into our local bookstore and purchases some books. The invoice might look like this:

 Order # 12345 Customer: 67890     Ostrowski, Chris                   215 Union Blvd                Lakewood, CO 80228 Quantity     Title 1          Oracle Application Server 10  g  Web Development, Ostrowski/Brown, Oracle Press 1          Oracle9  i  Performance Tuning Tips & Techniques, Niemiec, Oracle Press 1          Oracle PL/SQL Tips and Techniques, Trezzo, Oracle Press Total:      179.97 Tax:        10.80 Total:      190.77 Payment Method: Mastercard xxxx-xxxx-xxxx-1234 Exp: 01/05 

If the database used to store this information is normalized, there would be a database record that stores information about the order (Order id = 12345) and a line-items table that stores the line items that constitute this order (the three books). In this case, the order record is the parent and the line items are the children. The parent (the order) consists of one or more children (the line items). Line items cannot exist independent of an order. It is also possible to split the payment due on the order. Perhaps Chris has a gift certificate for $100. The payment to satisfy this order might constitute the $100 gift certificate and $90.77 charged to his credit card. Anticipating this possibility, the database is also designed with a one-to-many relationship between the orders and payments tables.

Note  

Normalized and Normalization are fancy words for structuring your database so that there is as little redundancy as possible. The objective is to increase capacity by eliminating wasted storage.

For DBA-minded types out there, another example of the one-to-many relationship is the one between tablespaces and datafiles in an Oracle database. A tablespace (the parent) consists of one or more datafiles (children). A datafile cannot exist independent of a tablespace.

In Oracle Application Server Portal, developers will visit this one-to-many relationship many times, and here is the first example of it. Every Oracle Application Server Portal page, including the Welcome page in Figure 8-1, is made up of regions. A region is nothing more than a section of a page. Many aspects of content display are defined at the region level, such as the width of the region or whether to display borders around the portlets in a portlet region. Regions can also include one or more tabs. A region can be defined to hold portlets, items, subpage links, and tabs, or it can exist as undefined (undefined regions become defined when an Oracle Application Server Portal object first gets placed on them). You cannot add portlets to an item region, nor can you add items to a portlet region. You cannot add anything to a subpage links region; these regions automatically populate with links to subpages of the current page. You cannot add anything to a tab region; although you can configure the tab to include, for example, rollover images. There is a one-to-many relationship between pages and regions. In regions defined as portlet regions, there is also a many-to-many relationship between regions and portlets. These relationships are shown in Figure 8-2.

click to expand
Figure 8-2: One-to-many relationship between pages, regions, and portlets
Note  

Another way to think about regions is to picture each Oracle Application Server Portal page divided into a section of web real estate. Each region exposes an Oracle Application Server Portal object such as portlet or an item and can be seen as a container. Every Oracle Application Server Portal page is comprised of one or more regions.

The many-to-many relationship is slightly different than the one-to-many relationship discussed earlier. In this example, one region may have many portlets placed on it, but a portlet may be placed on one or many different regions on different pages. Item regions have the same many-to-many relationship: an item region may contain many items and a single item may be placed on more than one region.

Note  

What, exactly, are items? To fully understand items, we must take a step back and look at the definition of a portal. In the most general sense, a portal is a highly trafficked web site with a wide range of content, services, and vendor links. It acts as a middleman by selecting the content sources and assembling them in a simple-to-navigate, customizable interface for presentation to the end user . Based on this definition, there are many pieces that constitute a typical portal that don t fit into traditional programming constructs like forms or reports . A good example might be a company s internal portal site that delivers private company information to its employees . Some of these portal elements may be things like Microsoft Word documents or Adobe Portable Document Format (PDF) files that outline company policies. The designers of Oracle Application Server Portal were smart enough to know that some (if not most) information included in a typical portal would be nonstructured data like the aforementioned Word documents or PDF files. Item regions hold these nonstructured items and are discussed in detail in Chapter 10.

One of the many benefits of developing in Oracle Application Server Portal is the ability to display pages with certain elements shown and others hidden based on the privileges of the user signing in to your portal. These changes are handled by Oracle Application Server Portal automatically and require no additional programming from the developer. As an example, let s log in to Oracle Application Server Portal as if we were going to begin our Oracle Application Server Portal development work. You can log in by either clicking the small Login link on the top right of the page, or by clicking the Login link under the Login to OracleAS Portal portlet on the top left of the page. By default, a couple of Oracle Application Server Portal logins are created for you automatically when you install Oracle Application Server Portal. In the login screen, login with the username of portal (without the quotes). The password will be the same as the password given when you or your administrator installed the Oracle Application Server 10 g Application Server middle tier.

Note  

The portal user in Oracle Application Server Portal is similar to the sys user in the database. It has every privilege within Oracle Application Server Portal and should be used very sparingly. Just like the sys user in the database, you should never create Oracle Application Server Portal objects as the portal user. The portal user should be used for system administration purposes only.

After a successful login, you should see a page similar to Figure 8-3.

click to expand
Figure 8-3: The Oracle Application Server Portal welcome page after a successful login

The page looks similar to Figure 8-1 and, in fact, the URL is exactly the same. But if you look closely, you ll notice that there are many new elements on the page. On the top right of the page there are many more links. Previously, only Home, Builder, Help, and Logon were displayed. Now, Navigator, Edit, Customize, and Account Info are displayed and the Login link has been replaced with the Logout link. We also have three tabs along the top right: Welcome, Build, and Administer. Finally, the login portlet on the top left of the page has been replaced with a Quick Tips portlet. This is an example of how your Oracle Application Server Portal pages can be designed to behave differently depending on who is looking at them, with no additional programming whatsoever. When we first viewed the Welcome page, we had not authenticated ourselves to Oracle Application Server Portal (authenticated is a fancy word for logging in). After we logged in, we became part of an Oracle Application Server group called the Authenticated Users group. As a member of that group , we saw a different version of the page. Our user login portal also gave us privileges to see other aspects of the page.

A Quick Tour of Oracle Application Server Portal Pages

There are so many pages and tabs available to developers after they log in to Oracle Application Server Portal, it is easy to become quickly overwhelmed. This section will walk through the basic Oracle Application Server Portal pages and give a brief explanation of each so that later on, we can easily navigate among them as we visit them in detail.

Like most Oracle development tools, Oracle Application Server Portal provides developers with many ways of performing the basic tasks of Oracle Application Server Portal development and administration. None of these methods are the right way of doing things ”they are simply different techniques for accomplishing your development goals that give developers the ability to choose which methods are suitable for them. Some of the methods require more steps than others, so after exploring the different methods , we will ( generally ) use those techniques requiring the fewest number of steps.

As the portal user, you have all privileges in Oracle Application Server Portal. As we have already discussed, Oracle Application Server Portal pages display different elements based on privileges granted to the user logging in, so many of these pages will look subtlety different if you should log on as a different user. Clicking the Build tab in the top right will display a page similar to the one in Figure 8-4.

click to expand
Figure 8-4: The Build tab displayed in Oracle Application Server Portal

On this page, there are three portlets ”a Recent Objects portlet that allows us to quickly jump to one of the last five Oracle Application Server Portal objects we ve edited, a Developer News portlet with a link to Oracle s Portal Development site (http://portalcenter.oracle.com), and a portlet that allows developers to work with Page Groups ”along with the banner page element discussed earlier. Page Groups are at the top of the hierarchy in Figure 8-2. Pages are children of Page Groups and cannot, therefore, exist without them. Every Page Group has a default root page and any attribute defined for a Page Group automatically cascades down to its Pages (although many attributes can be overridden at the Page level).

The two portlets on the left-hand side of the page ”Recent Objects and Developer News ”give an example of Oracle Application Server Portal s security mechanism. Both have a Customize link in their title bars. These Customize links allow end users to change certain characteristics of the portlet. Depending on the privileges granted to a particular user, the Customize links will appear or be hidden. Any changes made to the portlet will be made for that user only. For example, if the portal user chooses to customize the Recent Objects portlet to limit the list to only the three most recent objects (Figure 8-5), another user logging in will still see the five most recent objects in that portlet.

click to expand
Figure 8-5: The Customize Recent Objects portlet screen

The third tab in Figure 8-4, Administer, is where Oracle Application Server Portal administrators will spend most of their time. It has three subtabs along the left-hand side: Portal, Portlets, and Database. The Portal subtab (see Figure 8-6) has portlets that allow administrators to change the basic functionality of the Oracle Application Server Portal as a whole. The Portlets subtab (see Figure 8-7) has portlets that allow administrators to display the Portlet Repository and to define remote providers. The portlets on these two subtabs will be discussed in

click to expand
Figure 8-6: The Portal subtab in the Administer tab
click to expand
Figure 8-7: The Portlets subtab in the Administer tab
Note  

A provider can be thought of as a way of grouping portlets together. Any attribute assigned to the provider will cascade down to the portlets in that provider (unless it s overridden by the portlet). In addition, providers are also members of provider groups, which can also define attributes. This is yet another example of the one-to-many relationships that you will find throughout the Oracle Application Server Portal product. The provider is the parent, and the Oracle Application Server Portal components (forms, reports, graphs, etc.) that can eventually become portlets are the children.

The last subtab, Database (see Figure 8-8), allows administrators to create and modify both database objects and rows within a table. This functionality is limited to the infrastructure database.

click to expand
Figure 8-8: The Database subtab in the Administer tab

Here is another example of Oracle Application Server Portal s security mechanism: Out of the box, Oracle Application Server Portal defines Groups that have various privileges within Oracle Application Server Portal (the portal user, of course, has all privileges). Becoming a member of any Oracle Application Server Portal group automatically grants all privileges to that user. Three of the basic groups defined during the install of Oracle Application Server Portal are: PORTAL_ADMINISTRATORS, PORTAL_DEVELOPERS, and PORTLET_PUBLISHERS. The Oracle Application Server Portal elements on each of the tabs displayed along the top of the page will differ depending on what groups the Oracle Application Server Portal user is assigned to. As an example, if a user is only a member of the PORTAL_DEVELOPERS group, nothing will be displayed in the Database subtab of the Administer tab. In general, these default groups were set up with the following privileges and for the following reasons:

  • PORTAL_DEVELOPERS Users in this group can create portlets, but cannot place them on a page. In general, users in this group are usually more concerned with the functionality of the various portlets that will make up an Oracle Application Server Portal site and less concerned with the look and feel of a site.

  • PORTLET_PUBLISHERS Users in this group can take developed portlets and place them on a page, and can construct pages and page templates but cannot create new portlets. In general, users in this group are generally more concerned with the aesthetics of a portal site and less concerned with the code that makes up the various portlets to be placed on a site.

  • PORTLET_ADMINISTRATORS Users in this group have responsibilities across all facets of the site, including creation and deletion of users and groups, design and code modifications, and overall Oracle Application Server Portal functionality. In general, users in this group have control over all aspects of the Oracle Application Server Portal site.

You are not limited to these groups as you can create other groups that have distinct privileges and assign users to these groups. At some sites, there may be a group of portlet users that are in charge of both designing portlets and placing them on pages. In this case, a new group with the privileges of both PORTAL_DEVELOPERS and PORTLET_PUBLISHERS can be created and users can be assigned to that (or, users can just be assigned to both groups). If you have a really small amount of administrators and developers at your Oracle Application Server Portal site, you may not even need groups at all, as you can assign these privileges directly to Oracle Application Server Portal users.

The Navigator

Up until this point, we have seen pages where developers can create users and groups, page groups, register providers, and change Oracle Application Server Portal settings and database objects among other things. What we haven t seen is the ability to design pages or create Oracle Application Server portlets such as forms and reports. To do those things, we ll need to explore another major piece of Oracle Application Server Portal: the Oracle Application Server Portal Navigator.

The Oracle Application Server Portal Navigator (see Figure 8-9) is where developers will spend most of their time. Its three tabs, Page Groups, Providers, and Database Objects, allow developers to create, modify, and delete all of the Oracle Application Server Portal objects that make up a portal. Again, only certain tabs and certain options within those tabs will be available to the Oracle Application Server Portal developer based on their privileges. You can exit the Navigator at any time by clicking the Builder link in the top right of the page.

click to expand
Figure 8-9: The Page Groups tab of the Portal Navigator

The Page Groups Tab

The Page Groups tab allows the creation of all page elements. On this tab, developers can perform the following actions:

Create a new Page Group

This action, which automatically creates the root page of that group, is used to define a group that will incorporate pages that make up your portal or a section of your portal. As an example, an organization may have a set of Oracle Application Server Portal pages with a certain look for a corporate office, another set for external suppliers, and other sets of pages for various satellite locations. Any attributes applied at the Page Group level cascade down to all subpages (unless they re overridden at the subpage level).

Edit properties of the Page Group

This action allows developers to define attributes of the Page Group such as the total amount of disk space used for items placed on pages within this page group, whether privileged users can alter the pages within the Page Group, what types of pages can exist within the Page Group, how items are to be displayed and versioned, if language translations are to be made available, and which users can perform which actions against pages in the page group.

Create new subpages

Every page group has a root page; other pages can be created as subpages to the root page. A breadcrumb menu, showing where the user is in the hierarchy of pages, is generated automatically.

Edit the root page or any of the subpages

This is where developers (or, more accurately, those users in the PORTLET_PUBLISHERS group) will design pages and place portlets and items on them.

Create, modify and apply Templates

These are used for enforcing a particular layout, style, set of privileges, and content for multiple pages

Create and modify Categories

The purpose of categories is to enable users to quickly display a listing of a particular type of content. Categories answer the question, What is this item or page? and are used to classify content. For every item or page that you create, you can assign it to one category

Create and modify Navigation Pages

A navigation page is a special type of page that can be included on other pages to provide a consistent set of navigational elements. A typical navigation page might contain a logo, the page title, a login link, and a link to the home page. Navigation pages differ from other pages in that they are excluded from searches and bulk actions performed on pages in the page group. Additionally, they have their own node in the Navigator (Navigation Pages). Although you can add any item or portlet to a navigation page, and even divide your navigation page into several regions, you should bear in mind that the idea is to add navigation pages to other pages.

Create and modify Perspectives

The purpose of perspectives is to enable users to quickly display a listing of content that is pertinent to them. Perspectives often answer the question, Who will be interested in this item or page? and are used to further classify content by a cross-category grouping. When an item is added to a page to the page group, it can be assigned to multiple perspectives. To find all of the available content, other users can then search on this perspective to see a listing of the pages and items that are part of it. Since perspectives have the potential to be large, developers can also create a hierarchy of perspectives.

Create and modify Styles

A style controls the colors and fonts used by pages and all the tabs, portlets, and items displayed within them.

Create and modify Attributes

There are two types of attributes:

  • Content attributes These are associated with item types and page types, and store information about an item or page. Administrators can create their own item types and page types and specify what information they want users to supply by choosing which attributes to include. In addition, page group administrators can create their own attributes for containing extra information. The following table lists built-in content attributes:

    Table 8-1: Content Attributes

    Attribute

    Description

    Author

    The name of the author of the item.

    Category

    The name of the category to which the item or page belongs.

    Description

    A short text description of the item or page.

    Display Name

    The display name of the item or page.

    Display Option

    Information about how the item or portlet should be displayed:

    ” Item Displayed Directly In Page Area
    ” Link That Displays Item In Full Browser Window
    ” Link That Displays Item In New Browser Window

    Enable Item Check-Out

    Information about whether or not the item can be checked out and checked in. This provides document control, allowing groups of users to edit items and not overwrite each other s work. Users cannot edit items that are checked out by another user.

    Expiration Period

    Information about how long an item should be displayed on a page.

    Image

    The image associated with the item or page.

    Image Alignment

    Information about where the item image should appear in the page.

    Keywords

    Keywords that describe the content or purpose of the item or page. When a user performs a search, the user s search criteria are compared to the keywords to find a match.

    Perspectives

    The names of the perspectives associated with the item or page.

    Publish Date

    The date (in the format, DD-MON-YYYY HH12:MI PM) when the item should start being displayed to users.

    Rollover Image

    The second image associated with the item or page. This image is displayed whenever a user moves the mouse cursor over the original image on a navigation bar or tab.

  • Display attributes These are associated with regions, and display information about an item or portlet, such as the author, display name, and creation date. Page designers can choose which attributes to display in a region. Some content attributes, such as author and description, are also display attributes. The following table lists built-in display attributes:

    Table 8-2: Display Attributes

    Attribute

    Description

    Associated Functions

    Links to functions associated with the item if the item is of a custom item type that includes function calls.

    Author

    The name of the author of the item.

    Category

    The name of the category to which the item or portlet belongs.

    Create Date

    The date when the item or portlet was added to the page.

    Creator

    The user name of the user who added the item or portlet to the page.

    Date Updated

    The date when the item or portlet was last updated.

    Description

    The short text description of the item or portlet.

    Display Name

    The display name of the item or portlet.

    Display Name Link

    The display name of the item or portlet as a link pointing to the item or portlet content.

    Display Name And Image Link

    The display name and image of the item or portlet as links pointing to the item or portlet content. If the item has both a display name and an image, these will appear next to each other. If the item does not have an associated image, only the display name will appear.

    Document Size

    The size of the uploaded file.

    Expire Date

    The date (in the format, DD-MON-YYYY HH12:MI PM) when the item is due to expire.

    Gist

    The Gist icon () next to items. Users can click this icon to display an overview of the item created by Oracle Text.

    Help URL

    The help icon () next to the portlet item. Users can click this icon to display help for the portlet.

    Image

    The image associated with the item. If the item does not have an associated image, nothing is displayed.

    Image Link

    The image associated with the item as a link pointing to the item content. If the item does not have an associated image, nothing is displayed.

    Image Or Display Name Link

    The image associated with the item as a link pointing to the item content. If the item does not have an associated image, the display name is displayed instead.

    Image URL

    The image icon () next to the portlet item. Users can click this icon to display a preview of the portlet.

    Item Content

    The content of the item.

    Keywords

    The keywords associated with the item or portlet.

    Last Updated By

    The user name of the user who last updated the item or portlet.

    Mime Type Image

    The image associated with the mime type of the uploaded file.

    New Item Indicator

    The New icon () next to a new item or portlet. Users can click this icon to display a list of all new content in the page group.

    Perspectives

    The names of the perspectives associated with the item or portlet.

    Portlet Content

    The portlet itself if the Item Displayed Directly In Page Area display option is selected.

    Portlet ID

    The ID of the portlet.

    Portlet Name

    The name of the portlet.

    Property Sheet

    The Property Sheet icon () next to items and portlets. Users can click this icon to view the properties of an item or portlet.

    Provider ID

    The ID of the provider.

    Provider Name

    The name of the provider.

    Publish Date

    The date when the item is published on the page (i.e., when the item is visible to users in View mode).

    Subscribe

    The Subscribe () or Unsubscribe () icon next to items. Users can click this icon to subscribe to an item and be notified, via the Notifications portlet, when it is updated.

    Themes

    The Themes icon () next to items. Users can click this icon to display the nouns and verbs appearing most often within an item.

    Translations

    A list of the languages in which the item or portlet is available.

    Updated Item Indicator

    The Recently Updated icon () next to a recently updated item or portlet. Users can click this icon to display a list of all recently updated content in the page group.

    Versions

    The Versions icon () next to items that have multiple versions. Users can click this icon to view other versions of the item.

    View As HTML

    The View As HTML icon () next to items. Users can click this icon to view an HTML version of an item.

    View As HTML With Highlight

    The View As HTML With Highlight icon () next to items. Users can click this icon to view an HTML version of an item with search terms highlighted.

Create and modify Page Types

Page types define the contents of a page and the information that is stored about a page. The information stored about a page is determined by the attributes of the page type. There are five base page types included with Oracle Application Server Portal:

  • Standard Displays items and portlets

  • URL Displays the contents of a particular URL

  • Mobile Displays item and portlets in a hierarchical tree structure for viewing on a mobile device

  • PL/SQL Displays the results of executing PL/SQL code

  • JSP Displays the results of executing a Java Server Page (JSP)

In addition to these base page types, developers and page designers can also create custom page types:

Create and modify item types

Items are one of the basic components of a portal page. Items in Oracle application Server Portal are based on item types. Item types define the contents of an item and the information that is stored about an item. The information stored about an item is determined by the attributes of the item type. There are two types of item types:

  • Base item types

  • Extended item types

Base Item Types

Base items can broken down further into two subtypes :

  • Content item types These allow users to add content (for example, images, documents, or text) to a page. Base content item types are not available for users to add to pages. Oracle Application Server Portal provides extended item types (listed below) that are based on the base content items. The following are the base content item types provided by Oracle:

    • Base File Uploads a file and stores it in the page group.

    • Base Image Map Uploads an image and allows the contributor to identify areas within the image that users can click to go to different URLs.

    • Base Image Uploads an image and stores it in the page group.

    • Base PL/SQL Executes PL/SQL code and displays the results.

    • Base Page Link Links to another page in the page group.

    • Base Text Displays text (up to 32KB).

    • Base URL Links to another web page, web site, or document

  • Navigation item types These allow users to add navigational elements (for example, a login/logout link, basic search box, or list of objects) to a page. The following are the base navigation item types provided by Oracle:

    • Portal Smart Link Adds a smart link (and associated image) to the page. A smart link is a link that users can click to access areas of the Oracle Application Server Portal quickly, such as Account Information, Advanced Search, Contact Information, Help, and Home.

    • Login/Logout Link Adds links and/or icons to the page that users can click to log in or log out of the portal.

    • Basic Search Box Adds a basic search box (and associated image) to the page in which users can enter search criteria. Users can specify whether users of the search box can search all page groups or only the page group specified.

    • List of Objects Adds a list of objects (pages, categories, and perspectives) that users specify to the page. Users can choose to display this list as a drop-down list or as links (with or without associated images).

    • Portal Smart Text Adds smart text, such as the current date, current user, or current page to the page.

    • Object Map Link Adds a map of objects available in the portal.

    • Page Path Adds the page path to the page. Users can choose the number of levels for the path, and the character that separates the path levels.

    • Page Function Adds a page function to the page. If there are no page functions associated with the current page, this item type is not displayed.

Extended item types

These types are available to users to add to pages:

  • File and Simple File

  • Simple Image

  • Image and Simple Image Map

  • PL/SQL and Simple PL/SQL

  • Page Link and Simple Page Link

  • Text and Simple Text

  • URL and Simple URL

  • Zip File

The Providers Tab

As we mentioned earlier, a provider can be thought of as a way of grouping portlets together. On the Provider tab of the Navigator in Figure 8-10, you can see that there are three categories of providers available to you:

click to expand
Figure 8-10: The Providers tab of the Oracle Application Server Portal Navigator
  • Locally Built Providers This is where developers will define providers when they are ready to build Oracle Application Server Portal objects such as Oracle Application Server Portal forms, reports, and graphs.

  • Registered Providers This is where providers built outside of Oracle Application Server Portal are.

  • Provider Groups A provider group is a mechanism for organizing and simplifying the registration of providers. Provider groups often define a group of providers that share a common feature, such as belonging to the same organization, or providing similar content or functions.

The Database Objects Tab

The Database Objects tab allows Oracle Application Server Portal users with the necessary privileges to manipulate database objects in the infrastructure database (see Figure 8-11). Some of the actions that can be performed include:

click to expand
Figure 8-11: The Database Objects tab of the Oracle Application Server Portal Navigator
  • Creating new schemas

  • Creating and modifying these database objects: tables, views, procedures, functions, packages, sequences, synonyms, indexes, triggers, database links, Java objects, and scripts

  • Querying rows in tables and views

  • Modifying columns and column attributes

  • Modifying rows in tables and views

  • Viewing able constraints and column attributes

The Help System

Last, but certainly not least, is the Oracle Application Server Portal Help system (see Figure 8-12). Oracle has greatly improved the help system included with Oracle Application Server Portal, although it is important to note that it is not context-sensitive. Selecting the Help icon on any Oracle Application Server Portal screen will bring you to the window pictured in Figure 8-12. The Search tab on this page is invaluable, as it allows developers to search through all of the Oracle Application Server Portal documentation in one place.

click to expand
Figure 8-12: The Oracle Application Server Portal help system

Creating an Oracle Application Server Portal User

The first order of business we should take care of is the creation of a user to develop Oracle Application Server Portal objects. The creation of initial users is one of the main reasons you would ever log in to your portal as the portal user. Assuming you are still logged in as the portal user, click the Administer tab on the top right of the Welcome page. Make sure the Portal subtab is selected on the top left of the page and click the Create New Users link on the top right of the page. After selecting that link, your browser will be directed to a long URL that starts something like this:

http://<infrastructure server>:<infrastructure port>/oiddas/ui/oracle/ldap/das/user/
AppCreateUserInfoAdmin

The examples in the chapter have been taken from a server named xpas10 g with both the infrastructure (port 7777) and the middle tier (port 7778) installed on it. On this machine, the re-directed URL begins like this:

http://xpas10g:7777/oiddas/ui/oracle/ldap/das/user/AppCreateUserInfoAdmin

It is important to note this for the following reason: when we re creating Oracle Application Server Portal users, we re creating users in Oracle s implementation of the Lightweight Directory Access Protocol (LDAP) standard, Oracle Internet Directory. Creating an Oracle Application Server Portal user does not create a user in the Infrastructure database.

LDAP stands Lightweight Directory Access Protocol, and it is a set of protocols for accessing information directories. LDAP is based on the standards contained within the X.500 standard, but is significantly simpler. And unlike X.500, LDAP supports TCP/IP, which is necessary for any type of Internet access. LDAP makes it possible for almost any application running on virtually any computer platform to obtain directory information, such as e-mail addresses and public keys. Because LDAP is an open protocol, applications need not worry about the type of server hosting the directory.

Note  

You can also create and edit Oracle Internet Directory users at any time by going to http://<infrastructure server>:<infrastructure port>/oiddas. The root user for Oracle Internet Directory is orcladmin and the password will be the same one assigned to the infrastructure instance during installation of the infrastructure.

We will now create users to handle the various tasks associated with development and administration of our portal. After selecting the Create New Users link, you should see a page similar to the one in Figure 8-13. On this page, you will create a new user and assign privileges that will allow that user to create Oracle Application Server Portal components. Fill in the required fields for a user you will use for Oracle Application Server Portal development and click the Roles Assignment link (see Figure 8-14).

click to expand
Figure 8-13: The Create User page of the Oracle Internet Directory
click to expand
Figure 8-14: The Roles Assignment section of the Create User page

Figure 8-14 lists the default roles that are provided when Oracle Application Server Portal is installed. You are not limited to these default roles; you can create your own. For now, pay attention to the roles listed earlier in this chapter, namely PORTAL_DEVELOPERS, PORTLET_PUBLISHERS, and PORTLET_ADMINISTRATORS. Click the check box next to PORTAL_DEVELOPERS, as in Figure 8-14. Click the Return to Top link, and then click the Submit link to create the new user. In another browser, log in to Oracle Application Server Portal with this new user s name and password.

Clicking the Administration tab and then the Database will not reveal any portlets since this user does not have administration privileges. This user does, however, have the ability to create Oracle Application Server Portal components. Click on the Navigator link on the top right of the page to be taken to the Oracle Application Server Portal Navigator. Since all Oracle Application Server Portal components must be associated with a provider, select the Providers tab, then select the Locally Built Providers link on that page. The Locally Built Providers page is displayed (see Figure 8-15), but it contains no links to create a new provider. This is one of the security features that frustrate many new Oracle Application Server Portal developers. Instead of presenting a link or option that brings you to a page or screen explaining the fact that the Oracle Application Server Portal user does not have sufficient privileges to perform an action, the link or option simply is not displayed on the screen. The user we have created has been granted the privileges in the PORTAL_DEVELOPERS group, which gives us the ability to create Oracle Application Server Portal components, but not Oracle Application Server Providers. Why?

click to expand
Figure 8-15: The Locally Built Providers page

As we will see in the next chapter, the Oracle Application Server Portal wizards that are used to generate forms, reports, and graphs (among other Oracle Application Server Portal components) are really sophisticated code generators. While you have the ability to embed JavaScript code with your Oracle Application Server Portal Forms and Reports, the majority of code that will drive your portal will be PL/SQL code. This PL/SQL code needs to be stored somewhere: it is stored in the infrastructure database. When we create an Oracle Application Server Portal Provider, one of the first things we will need to specify is a database schema that this provider is associated with. This database schema is the one that will be used to hold the generated PL/SQL code that makes up the various Oracle Application Server Portal objects that we generate from the wizards. In order to create an Oracle Application Server Provider, we must have access to the database to specify which schema we want to use. In most cases, you would not want to give that privilege to an Oracle Application Server Portal developer, which is why our user does not have the ability to create a new provider.

What if we want that user to have the ability to create a provider? There are a couple of ways to do it. We can either grant a provider privilege explicitly to that user or we can make that user a member of a group with the necessary provider privilege so that the user implicitly gets the necessary privilege. Let s look at explicitly granting the privilege first.

Log into Oracle Portal Provider Portal as a user with administration privileges (you can use the portal user we ve been using in this chapter). Click the Administer tab. On the right-hand side of the screen, you ll see four portlets: User, Portal User Profile, Group, and Portal Group Profile. To change the Oracle Application Server Portal privileges for a user, you might think you need to go into the User portlet, but you would be incorrect. The User portlet is only used for things like the Oracle Application Server Portal user s personal information (username, password, group memberships, etc.). To edit an Oracle Application Server Portal user s privileges, we will use the Portal User Profile portlet. Click the small icon between the Name: field and the Edit button to bring up a list of Oracle Application Server Portal users defined on your system. Select the user that was just created and click Select to close the selection window. Click the Edit button to bring up the Edit Portal User screen. Click the Privileges tab to display privileges for that user (see Figure 8-16).

click to expand
Figure 8-16: The Privileges tab of the Edit Portal User Profile screen

It looks like this user does not have any privileges to do anything in our portal, but remember that the user inherits the privileges of any group they are assigned to. In this case, no explicit privileges have been assigned to this user, but he has implicitly inherited the privileges from the PORTAL_DEVELOPERS group. Click the Builder link on the top right of the screen, then click the small icon between the Name: field and the Edit button in the Portal Group Profile portlet at the bottom of the page. Select the PORTAL_DEVELOPERS group, click the Edit, and select the Privileges page. As you can see in Figure 8-17, members of the PORTAL_DEVELOPERS group have the ability to Create Oracle Application Server Providers.

click to expand
Figure 8-17: The Privileges tab for the PORTAL_DEVELOPERS group

So what s going on here? We know that the user we have just created is a member of the PORTAL_DEVELOPERS group and that the PORTAL_DEVELOPERS group has the ability to create providers. Why doesn t the Create Provider link show up when we log in as that user? Remember we said that providers must be associated with a database schema so that the PL/SQL packages that are generated from the various Oracle Application Server Portal wizards can be stored? The Oracle Application Server Portal user must have privileges on those schemas so that these packages can be created. We must grant an additional privilege to this Oracle Application Server Portal user so that they may create providers. On the Administration tab and on the Portal subtab, type the name of your Oracle Application Server Portal user in the name field of the Portal User Profile portlet and click Edit. On the Privileges tab, select the drop-down box next to All Schemas. You ll see six options: Create, View Data, Insert Data, Modify Data, Manage, and None. The order in which they are listed is a little confusing: moving from the bottom of the list (Create) up, the privileges encompass more and more capabilities, except for the topmost selection (None), which revokes all privileges. It would seem to make more sense to put None at the bottom of the list, but it is at the top for all drop-down boxes on this page.

Create gives the Oracle Application Server Portal user the ability to create a new schema in the infrastructure database, but nothing else. View Data gives the Oracle Application Server Portal user the ability to create a schema and to query the data in that schema, but no privileges to add or insert data. Insert Data has all of the privileges of those below it, plus the ability to insert data into the schema. Granting our Oracle Application Server Portal user any of the three privileges we ve mentioned will not give the user the ability to create an Oracle Application Server Portal Provider. Providers not only need the ability to view and insert data as various elements of the Oracle Application Server Portal components are created, but also need the ability to modify data in that schema as Oracle Application Server Portal components are changed and updated. We need a privilege higher than Insert Data before our Oracle Application Server Portal user will have the ability to create providers. The last two options ”Modify Data, which has all of the privileges below it plus the ability to actually modify data in the schemas, and Manage, which has the ability to not only perform Data Manipulation Language (DML) statements like insert, update, etc., but also has the ability to perform Data Definition Language (DDL) statements like Create Index ”give the necessary privileges for our user to create Oracle Application Server Providers. For now, as an example, grant the user Modify Data and click OK. Log back in as the new Oracle Application Server Portal user, click Navigator, then the Providers tab, then the Locally Built Providers link. The page should look similar to before, except with the addition of the Create New Database Provider link at the top of the page (see Figure 8-18).

click to expand
Figure 8-18: The Locally Built Providers page of the Portal Navigator with the Create New Database Provider link available
Note  

There are two types of providers ”database providers and web providers ”in Oracle Application Server Portal. Database providers are those packages written as PL/SQL packages. They re used for creating PL/SQL portlets that reside in the database and are implemented as stored procedures and executed in the database. They can be written in PL/SQL or Java Stored Procedures wrapped in PL/SQL. You use PL/SQL portlets whenever your portlets require significant database interaction or when the development team has Oracle experience. web providers are those applications written as web applications. They are installed and hosted on a web server and are remote from the portal. A portlet exposed as a web provider can be developed in any web language. The portal communicates to the web provider using the HTTP protocol. There are several benefits when developing portlets and exposing them as web providers: You can leverage existing web application code to create portlets, manage outside of Oracle Application Server Portal, provide hosted servers for Oracle Application Server Portal users, and create portlets using any existing web language. Web providers use Simple Object Access Protocol (SOAP) to communicate with the Portal. Web providers, such as OC4J (along with the PDK) can also be installed locally on the Oracle Application Server.

The example we just discussed illustrates how tightly security is built into Oracle Application Server Portal. It also serves to demonstrate that it is not always intuitively obvious how and where to make the changes necessary to grant access to your Oracle Application Server Portal users.

Now that we have the ability to create providers, let s go ahead and create one to see what options are available to us. As the Oracle Application Server Portal user created in this chapter, click the Navigator link in the top right of the screen, then the Providers tab, then the Database Provider link on the top left of the screen. You should see a screen similar to the one in Figure 8-19.

click to expand
Figure 8-19: The Create Portal Database Provider screen

The first two fields are self-explanatory: the internal name of the application (which cannot contain any spaces or special characters) and the display name of the application (which can contain spaces and special characters and will be what is displayed in the Oracle Application Server Portal Navigator). The third field is more troublesome in this example. It requires us to specify which schema in the infrastructure database we will use to store our PL/SQL packages. As you can see in Figure 8-19, no schemas are available to us, preventing us from continuing. What s happening here?

When we were modifying this user earlier, we gave the Oracle Application Server Portal user the ability to Modify Data in any schema in our infrastructure database. When we use the Oracle Application Server Portal wizards to create forms, reports, graphs, etc., we will need the ability to create various database objects in the schema; granting Modify Data privileges doesn t give us the ability to actually create any new database objects, so no database schemas are available to us.

So the answer is simple, right? Go back and grant Execute privileges to our Oracle Application Server Portal development user. That will give the Oracle Application Server Portal developer the necessary privileges to create a provider, but that may not be such a great idea, either. By granting that privilege, an Oracle Application Server Portal developer can do anything to any of the schemas in the infrastructure database. The potential for disaster, unintentionally or on purpose, is great in this scenario. A better solution would be to define a schema to hold Oracle Application Server Portal-generated PL/SQL packages and grant privileges on that schema to the necessary Oracle Application Server Portal developer(s).

You can use Oracle Application Server Portal to create a schema in the database. Log in as a user with administration privileges and select the Navigator link. Select the Database Objects link and then the Create New Schema link. Fill in the necessary fields and make sure the Use this Schema for Portal Users check box is selected. Click Create. Back on the Navigator page, select the Grant Access link next to the schema you just created. You should see a page similar to the one in Figure 8-20. On this page, you can grant privileges to Oracle Application Server Portal user on the selected database schema. Similar to the privileges tab discussed earlier, the privileges you can select on this page (view, insert, modify, and manage) are in order from least powerful (view) to most powerful (manage). Granting view, insert, or modify will not grant enough privileges for the Oracle Application Server Portal user to use this schema to begin creating Oracle Application Server Portal components for a provider. You must grant the Manage privilege for your Oracle Application Server Portal developer to use this schema. Click the Add button before clicking the OK button, which closes the page.

click to expand
Figure 8-20: The Grant Access page

Logging back into Oracle Application Server Portal as the developer user, you can now create a new provider using the schema that has been granted the necessary privileges (see Figure 8-21).

click to expand
Figure 8-21: The Create Provider page with the available Chris schema

The granting of Manage privileges on the Chris schema in the preceding example is all the Oracle Application Server Portal developer user needs to create providers (along with, of course, the Create Provider privilege implicitly granted by being a member of the PORTAL_DEVELOPERS group). There is no need to grant the individual user the Modify Data privilege for all users that we performed earlier (just before Figure 8-18). To keep security tight in your database, it s best to go back and revoke that privilege.



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