3. Creating a Hello World Page in OAF

 

Step-by-Step Guide: Creating a Hello World Page in Oracle Application Framework (OAF)

Introduction

Creating your first OAF page is an exciting milestone in Oracle E-Business Suite development. This guide walks you through the complete process of building a "Hello World" page using Oracle JDeveloper. By following these steps, you will learn how to create a workspace, set up a project, build an Application Module, and create your first OAF page—all essential building blocks for more complex OAF development.


Prerequisites

Before you begin, ensure the following:

  • Oracle JDeveloper is installed and configured (see the JDev Installation guide)

  • Runtime Connection to Oracle E-Business Suite is established

  • Database Connection is configured

  • You have an EBS user account with appropriate responsibilities


Step 1: Create a New Workspace

The workspace serves as the top-level container for all your projects and related files.

  1. Start the Workspace Wizard:

    • Right-click on Applications in the Application Navigator

    • Select New OA Workspace

  2. Name the Workspace:

    • Enter the workspace name: RohitHelloWorldPage

    • Click OK

  3. Project Wizard:

    • The Project Wizard will open automatically

    • Click Next to proceed

  4. Configure Project Details:

    • Project Name: RohitHelloWorldPage

    • Default Package: rohit.oracle.apps.fnd.RohitHelloWorldPage

Important: The package name determines the directory structure where Java class files and other project-related files are stored. The oracle.apps.fnd portion is mandatory for OAF development. The fnd abbreviation represents the Oracle Application short name (you can use other application short names like ak as appropriate).

  1. Enter Runtime Connection Details:

    • Provide your Oracle E-Business Suite Username and Password

    • These are the same credentials you configured during JDev installation

  2. Complete the Wizard:

    • The workspace and project are now created and ready for development


Step 2: Create an Application Module

The Application Module (AM) is a mandatory container that manages access to the BC4J model objects. Without an AM, your OAF page cannot function.

  1. Open the New Gallery:

    • Right-click on the project RohitHelloWorldPage

    • Select New

  2. Select Application Module:

    • In the New Gallery, navigate to Business Tier → ADF Business Components

    • Select Application Module

    • Click OK

  3. Application Module Wizard:

    • Click Next to proceed

  4. Configure the Application Module:

    • Application Module Name: RohitHelloWorldPageAM

    • Default Package: rohit.oracle.apps.fnd.RohitHelloWorldPage.server

Note: Application Modules are always created under the server directory of the project, following OAF standards. This separates server-side logic from client-side presentation.

  1. Complete the Wizard:

    • Click Next, then click Finish

    • The Application Module is now created


Step 3: Create the OAF Page

The page is the user interface component that users will interact with.

  1. Open the New Gallery:

    • Right-click on the project RohitHelloWorldPage

    • Select New

  2. Select Page:

    • In the New Gallery, navigate to Web Tier → JSF/Faces (or Web Tier → Oracle ADF Faces)

    • Select Page

    • Click OK

  3. Configure the Page:

    • Page Name: RohitHelloWorldPagePG

    • Default Package: rohit.oracle.apps.fnd.RohitHelloWorldPage.webui

Note: Pages are always created under the webui directory of the project, following OAF standards. This separates the user interface components from the server-side logic.

  1. Complete the Page Creation:

    • Click OK to create the page


Understanding the Directory Structure

After completing these steps, your project will have the following structure:

text
RohitHelloWorldPage/
├── server/
│   └── RohitHelloWorldPageAM.xml (Application Module)
├── webui/
│   └── RohitHelloWorldPagePG.xml (OAF Page)
└── RohitHelloWorldPage.jpr (Project file)
DirectoryPurposeContents
serverServer-side business logicApplication Modules, Entity Objects, View Objects
webuiUser interface componentsPages, Regions, Controllers

Key Concepts Explained

Workspace

A Workspace is the top-level container that holds one or more projects. It maintains the relationships between projects and provides a unified development environment.

Project

A Project is a collection of related files and directories that make up your application. It organizes your code into logical units and manages dependencies.

Package Naming Convention

The package name follows a specific structure:

text
<company>.<product>.<application>.<project_name>
ComponentExampleDescription
CompanyrohitYour organization or identifier
ProductoracleOracle product suite
Applicationapps.fndOracle Applications Foundation
Project NameRohitHelloWorldPageYour specific project

Application Module (AM)

The Application Module is the root container for all model objects. It:

  • Manages database transactions

  • Provides access to View Objects

  • Maintains the state of the application

  • Is mandatory for every OAF page

OAF Page

The OAF Page is the user interface component. It:

  • Defines the layout and appearance

  • Contains regions, items, and buttons

  • Interacts with the Application Module

  • Is controlled by the Controller


Next Steps

Now that you have created your workspace, project, Application Module, and page, you are ready to:

  1. Design the Page Layout: Add regions, items, and buttons to your page

  2. Create a Controller: Implement the Process Request and Process Form Request logic

  3. Bind the Page to the AM: Connect your page to the Application Module

  4. Run and Test: Deploy and test your Hello World page


Best Practices

PracticeDescription
Follow Naming ConventionsUse consistent naming (AM for Application Modules, PG for Pages)
Use Proper Package StructureAlways include oracle.apps.<app_short_name> in your package
Separate ConcernsKeep server-side logic in server and UI in webui
Document Your CodeAdd comments to explain business logic
Test IncrementallyTest each component before moving to the next

Troubleshooting Common Issues

IssuePossible CauseSolution
Cannot create workspaceJDeveloper not configuredVerify JDEV_USER_HOME is set correctly
Project wizard doesn't appearRuntime connection not setConfigure Runtime Connection first
Application Module creation failsInvalid package nameEnsure oracle.apps.fnd is included
Page doesn't appear in projectWrong directory selectedVerify page is created under webui
Cannot run the pageRuntime connection errorCheck EBS credentials and DBC file

Summary

Creating a Hello World page in OAF involves four essential steps:

  1. Create a Workspace: The top-level container for your projects

  2. Create a Project: Organized with proper package naming conventions

  3. Create an Application Module: The mandatory container for model objects

  4. Create an OAF Page: The user interface component

By following these steps, you have established the foundation for OAF development. The Application Module serves as the backbone of your page, while the page itself provides the user interface. Together with a Controller (which you'll create next), these components form the core of any OAF application.

This Hello World exercise provides the fundamental building blocks you'll use in every OAF project, setting you on the path to creating sophisticated, enterprise-grade web applications within Oracle E-Business Suite.


References

  • Oracle E-Business Suite Documentation: OA Framework Developer's Guide

  • Oracle JDeveloper Documentation: Available in the jdevdoc folder

  • My Oracle Support: OAF Development Best Practices

  • Oracle Application Framework: Official Oracle documentation

No comments:

Post a Comment