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.
Start the Workspace Wizard:
Right-click on Applications in the Application Navigator
Select New OA Workspace
Name the Workspace:
Enter the workspace name: RohitHelloWorldPage
Click OK
Project Wizard:
The Project Wizard will open automatically
Click Next to proceed
Configure Project Details:
Project Name:
RohitHelloWorldPageDefault 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.fndportion is mandatory for OAF development. Thefndabbreviation represents the Oracle Application short name (you can use other application short names likeakas appropriate).
Enter Runtime Connection Details:
Provide your Oracle E-Business Suite Username and Password
These are the same credentials you configured during JDev installation
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.
Open the New Gallery:
Right-click on the project RohitHelloWorldPage
Select New
Select Application Module:
In the New Gallery, navigate to Business Tier → ADF Business Components
Select Application Module
Click OK
Application Module Wizard:
Click Next to proceed
Configure the Application Module:
Application Module Name:
RohitHelloWorldPageAMDefault 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.
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.
Open the New Gallery:
Right-click on the project RohitHelloWorldPage
Select New
Select Page:
In the New Gallery, navigate to Web Tier → JSF/Faces (or Web Tier → Oracle ADF Faces)
Select Page
Click OK
Configure the Page:
Page Name:
RohitHelloWorldPagePGDefault 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.
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:
RohitHelloWorldPage/ ├── server/ │ └── RohitHelloWorldPageAM.xml (Application Module) ├── webui/ │ └── RohitHelloWorldPagePG.xml (OAF Page) └── RohitHelloWorldPage.jpr (Project file)
| Directory | Purpose | Contents |
|---|---|---|
| server | Server-side business logic | Application Modules, Entity Objects, View Objects |
| webui | User interface components | Pages, 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:
<company>.<product>.<application>.<project_name>
| Component | Example | Description |
|---|---|---|
| Company | rohit | Your organization or identifier |
| Product | oracle | Oracle product suite |
| Application | apps.fnd | Oracle Applications Foundation |
| Project Name | RohitHelloWorldPage | Your 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:
Design the Page Layout: Add regions, items, and buttons to your page
Create a Controller: Implement the
Process RequestandProcess Form RequestlogicBind the Page to the AM: Connect your page to the Application Module
Run and Test: Deploy and test your Hello World page
Best Practices
| Practice | Description |
|---|---|
| Follow Naming Conventions | Use consistent naming (AM for Application Modules, PG for Pages) |
| Use Proper Package Structure | Always include oracle.apps.<app_short_name> in your package |
| Separate Concerns | Keep server-side logic in server and UI in webui |
| Document Your Code | Add comments to explain business logic |
| Test Incrementally | Test each component before moving to the next |
Troubleshooting Common Issues
| Issue | Possible Cause | Solution |
|---|---|---|
| Cannot create workspace | JDeveloper not configured | Verify JDEV_USER_HOME is set correctly |
| Project wizard doesn't appear | Runtime connection not set | Configure Runtime Connection first |
| Application Module creation fails | Invalid package name | Ensure oracle.apps.fnd is included |
| Page doesn't appear in project | Wrong directory selected | Verify page is created under webui |
| Cannot run the page | Runtime connection error | Check EBS credentials and DBC file |
Summary
Creating a Hello World page in OAF involves four essential steps:
Create a Workspace: The top-level container for your projects
Create a Project: Organized with proper package naming conventions
Create an Application Module: The mandatory container for model objects
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
jdevdocfolderMy Oracle Support: OAF Development Best Practices
Oracle Application Framework: Official Oracle documentation
No comments:
Post a Comment