50
OAF Oracle Applications Framework Oracle Applications Framework

OA Framework

Embed Size (px)

Citation preview

Page 1: OA Framework

OAF

Oracle Applications FrameworkOracle Applications Framework

Page 2: OA Framework

OAF

AgendaAgenda

■ Understanding MVC Design Patterns

■ Understanding OA Framework and it's Architecture

■ Understanding the Basics of the Model

■ Understanding the Basics of the View

■ Understanding the Basics of the Controller

■ Demo

♦ Setting Up Your Development Environment

♦ Implementing First Page

♦ Implementing a Search

■ Other Concepts

Page 3: OA Framework

OAF

PrerequisitesPrerequisites

■ OOPS – Must

■ Java – Must

■ JSP – Good To Have

■ Knowledge of frameworks based on MVC (Eg: Sturts) – Cake walk

Page 4: OA Framework

OAF

Web Programming OverviewWeb Programming Overview

Page 5: OA Framework

OAF

Web Programming with Java OverviewWeb Programming with Java Overview

■ HTTP (Hyper Text Transfer Protocol)

■ HTML

■ Request/Response

■ Element

■ Form

■ GET/POST

■ Cookie

■ Session

■ Servlet

■ JSP

Page 6: OA Framework

OAF

Browser – Server CommunicationBrowser – Server Communication

Page 7: OA Framework

OAF

Standard RequestStandard Request

Page 8: OA Framework

OAF

JSP SendRedirectJSP SendRedirect

Page 9: OA Framework

OAF

JSP – Forward JSP – Forward

Page 10: OA Framework

OAF

JSP – ForwardJSP – Forward

Page 11: OA Framework

OAF

MVC Architecture OverviewMVC Architecture Overview

Page 12: OA Framework

OAF

MVC Design PatternMVC Design Pattern

■ MVC stands for Model-View-Controller

■ The Model is the actual internal representation

■ The View is a way of looking at or displaying the model

■ The Controller provides for user input and modification

Page 13: OA Framework

OAF

MVC Design PatternMVC Design Pattern

Model

View

Controller

Page 14: OA Framework

OAF

ModelModel

■ The Model is the part that does the work

■ The Model should be independent of the GUI

■ Independence gives flexibility, robustness

Page 15: OA Framework

OAF

ViewView

■ View components present information to the user

■ Different views present the same model information in different ways

Page 16: OA Framework

OAF

ControllerController

■ Controller accepts user inputs as events.

■ Events are translated into requests for the model or the associated view

■ Controllers should never include any kind of business logic

Page 17: OA Framework

OAF

MVC with JSP: MVC1MVC with JSP: MVC1

Page 18: OA Framework

OAF

MVC with JSP: MVC2MVC with JSP: MVC2

Page 19: OA Framework

OAF

OA FrameworkOA Framework

Page 20: OA Framework

OAF

What is OA Framework?What is OA Framework?

The Oracle Applications Framework (OA Framework) is the Oracle Applications development and deployment platform for HTML-based business applications.

Page 21: OA Framework

OAF

OA Framework PhilosophyOA Framework Philosophy

■ End User Productivity

■ Enterprise-grade Performance and Scalability

■ Developer Productivity

■ Application Customizability

■ Open Standards

Page 22: OA Framework

OAF

OA Framework ArchitectureOA Framework Architecture

ApplicationsProducts

OA Framework

UIX/BC4J

IAS 1.0.2.2Apache/JServ

Browser Database

■ 3-Tier Architecture

Application Server

Page 23: OA Framework

OAF

OA Framework Architecture – MVC PatternOA Framework Architecture – MVC Pattern

Page 24: OA Framework

OAF

Components of MVC ArchitectureComponents of MVC Architecture

■ Model: Implemented using Oracle Business Components for Java (BC4J).

■ View: Implemented using UI XML (UIX).

■ Controller: pure Java class

Page 25: OA Framework

OAF

The ModelThe Model

■ The model encapsulates the underlying data and business logic of the application.

Model Consist of

♦ BC4J Components► Entity Objects (EO) ( and Association Objects)

► View Objects (VOs) (and View Links)

► Application Module (AM)

♦ OADBTransaction

Page 26: OA Framework

OAF

The Model - Entity Objects (EO)The Model - Entity Objects (EO)■ BC4J Entity Objects are defined on table or views or synonyms or

snapshots

■ There is a one-to-one mapping between a table and an Entity Object.

■ Entity objects should include all columns in their associated tables.

■ Entity objects encapsulate the business rules associated with a row in a database table.

■ Entity Objects are subclasses of oracle.apps.fnd.framework.server.OAEntityImpl

■ PL/SQL EOs are used to call database procedures

■ Association Objects

♦ Enables to create relation ships between Eos

♦ Two types of Associations► Composition

► Reference

Page 27: OA Framework

OAF

EO Creation - DemoEO Creation - Demo

Page 28: OA Framework

OAF

The Model - View Objects (VO)The Model - View Objects (VO)■ BC4J view object encapsulates a database query

■ View Object can be defined

♦ Simple SQL statement

♦ Map to Entity Object

♦ Map to Entity Objects and SQL

■ VO Uses

♦ Present data that is optimized for a particular user interface – Use EO

♦ Create simple queries for pop lists, lists of values and other supporting UI components – Use simple SQL Query

♦ Create efficient "validation queries" that can be used in your business logic – Use simple SQL Query

■ VO should be based on EO when there is insert/update to DB.

■ View Objects are subclasses of oracle.apps.fnd.framework.server.OAViewObjectImpl

■ View Links

Page 29: OA Framework

OAF

VO Creation - DemoVO Creation - Demo

Page 30: OA Framework

OAF

The Model – Application ModuleThe Model – Application Module■ A BC4J application module is a container that manages and provides access to

BC4J objects.

■ Each OA Framework page has a "root" application module which is associated with the top-level page region.

■ The root application module provides transaction context and establishes a database connection.

♦ If multiple pages participate in the transaction, they should share the same root application module.

♦ If a page functions independently of any other, it should have its own application module.

■ The application module is an appropriate place

♦ Provides access to any associated BC4J objects

♦ Performs multiple server-side actions

♦ Returns server side values to the client

♦ Calls PL/SQL routines.

■ AMs are subclasses of oracle.apps.fnd.framework.server.OAApplicationModuleImpl

Page 31: OA Framework

OAF

AM Creation - DemoAM Creation - Demo

Page 32: OA Framework

OAF

The Model – OADBTransactionThe Model – OADBTransaction■ OADBTransaction encapsulates the JDBC connection/database session

associated with a root application module.

■ Owns any entity objects

■ OADBTransaction is used in code for

♦ Creating a callable statement for executing PL/SQL functions and procedures

♦ Accessing session-level Applications context information like the user's name, id, current responsibility

Page 33: OA Framework

OAF

The ModelThe Model

Page 34: OA Framework

OAF

The View - UIXThe View - UIX

■ UIX – User Interface XML

■ Creates UI Components hierarchy on the page

■ Coordinates browser and middle-tier

■ Uses BC4J to fetch and update data

■ Imported into MDS

■ Enables User Personalization & Extensions

■ View is implemented as Regions and Items

Page 35: OA Framework

OAF

The View - UIXThe View - UIX

Page 36: OA Framework

OAF

Page Creation - DemoPage Creation - Demo

Page 37: OA Framework

OAF

The ControllerThe Controller■ The controller responds to user actions and directs application flow

■ Controller is Coded to

♦ Manipulate/initialize the UI at runtime

♦ Intercept and handle user events like button presses

■ Controllers should never include any kind of business logic

■ Controller is a Subclass of oracle.apps.fnd.framework.webui.OAControllerImpl

■ Request Handling

♦ Check Out or Create AM

♦ Validate Session

♦ HTTP GET

► Creates web bean hierarchy

► Calls processRequest()

♦ HTTP POST

► Checks if web bean hierarchy exists in memory, if not creates the same

► Calls processFormRequest()

Page 38: OA Framework

OAF

Controller Creation - DemoController Creation - Demo

Page 39: OA Framework

OAF

OA Framework – MVCOA Framework – MVC

Page 40: OA Framework

OAF

MVC InteractionMVC Interaction

Page 41: OA Framework

OAF

Development EnvironmentDevelopment Environment

■ System Requirements

♦ Operating Systems: Windows 2000 or Windows XP.

♦ Preferred Web Browser: Internet Explorer 5.0 or later

♦ CPU Type and Speed: Pentium IV 1 GHz or greater

♦ Memory: 512 MB RAM

♦ Display: 65536 colors, set to at least 1024 X 768 resolution

♦ Disk Space: 570 MB

■ Patch 4045639 (download from metalink)

Page 42: OA Framework

OAF

Setting Up Development Environment - DemoSetting Up Development Environment - Demo

Page 43: OA Framework

OAF

Implementing Your First Page (Helloworld) - Implementing Your First Page (Helloworld) - DemoDemo

Page 44: OA Framework

OAF

Implementing a Search - DemoImplementing a Search - Demo

Page 45: OA Framework

OAF

OA Personalization & Extension - DemoOA Personalization & Extension - Demo

Page 46: OA Framework

OAF

DeploymentDeployment

■ ftp Files $OA_JAVA

■ Import pages into MDS

♦ <JDEV Installation Directory>\jdevbin\jdev\bin\import <JDEV Installation Directory>\jdevhome\jdev\myprojects\<client>\oracle\apps\....\webui -jdk13 -mmddir "<JDEV Installation Directory>\jdevhome\jdev\myhtml\OA_HTML\jrad" -username apps -password apps -rootdir D:\D\JDEV\p4045639\jdevhome\jdev\myprojects\ -validate -dbconnection "(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = appsnet.wipro.com)(PORT = 1523))) (CONNECT_DATA = (SID = VIS)))"

■ Import substitutions (if any) into MDS

♦ <JDEV Installation Directory>\jdevbin\jdev\bin\jpximport <JDEV Installation Directory>\jdevhome\jdev\myprojects\<jpxfilename>.jpx -username apps -password apps -dbconnection "(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = appsnet.wipro.com)(PORT = 1523))) (CONNECT_DATA = (SID = VIS)))"

■ Bounce Apache

Page 47: OA Framework

OAF

DeploymentDeployment■ Create AOL Function

♦ Type: SSWA jsp function

♦ HTML Call: OA.jsp?page=/<client>/oracle/apps/<module>/…./webui/<PageName>PG

■ Attach to Menu

■ Personalize (If any)

Page 48: OA Framework

OAF

Q & A

Page 49: OA Framework

OAF

What Next?

Page 50: OA Framework

OAF

Thank You