Sie sind auf Seite 1von 14

We Are Trying To Create A Simple Web Application To Add Records To A Database. [ID 470714.

1] Modified 13-FEB-2008 Type HOWTO Status PUBLISHED In this Document


Goal Solution Steps

Applies to:
Oracle JDeveloper - Version: 10.1.3 Information in this document applies to any platform.

Goal
How to create a simple ADF application that will create records and insert into database.

Solution
Here are steps on how to create an ADF input form and submit data to database. It involves:

Creating a ADF table to show all data. Adding a Create button to the same page. Creating an ADF form to insert a new record.

These steps are using the default schema scott/tiger that comes with Oracle database. The whole application (JDeveloper 10.1.3.3) can be downloaded here.

Steps
1. Create Application and create business components

Create a new application workspace o Application Name field: CreateRecord o Select the template Web Application [JSF, ADF BC] In the Model project create a business components project based upon the scott/tiger schema. o Select the DEPT table.

o o

Updateable View Objects screen (step 2): move the object (i.e. DeptView) to the Selected area. Press [Finish]

2. Configure faces-config.xml

In the ViewController project open faces-config.xml in Design editor. From Component Palette drag JSF Page onto diagram. Change the default label to /ShowDeptRecords.jspx. From Component Palette drag JSF Page onto diagram. Change the default label to /CreateDept.jspx. In Component Palette select JSF Navigation Case and create a link from /ShowDeptRecords.jspx to /CreateDept.jspx. Change the default label from success to create. In Component Palette select JSF Navigation Case and create a link from /CreateDept.jspx to /ShowDeptRecords.jspx. Accept default label success.

3. Create JSPX pages


Double-click ShowDeptRecords.jspx to create JSPX page. In the Create JSF JSP Wizard accept all defaults and press [Finish]. Back in the faces-config.xml Design editor, double-click CreateDept.jspx to create JSPX page. In the Create JSF JSP Wizard accept all default and press [Finish].

4. Create 'Show all Records' page


Go to the Design editor for ShowDeptRecords.jspx. In the Data Control Palette select the view object (i.e. DeptView1) and drag it onto JSP page. In the Create pop-up list select Table | ADF Read-Only Table. Edit Table Columns dialog: press [OK].

In Component Palette, under ADF Faces Core select CommandButton and drag beneath the table. Select the new button just created. In the Property Inspector change the properties for the new button:o Text field: change to "Create Record" o Action field: select "create"

5. Create Record Page


Go to the Design editor for CreateDept.jspx. In the Data Control Palette select the view object (i.e. DeptView1) and drag it onto JSP page. In the Create pop-up list select Forms | ADF Creation Form. Edit Table Columns dialog: select option 'Include Submit Button' and press [OK]. In the Data Control Palette expand the Operation node (beneath the Application Module). Select Commit and drag it next to the Submit button. In the Create dialog select 'ADF Command Button'. With the Commit button selected go to the Property Inspector and change the following properties:o Text field: change to "Submit Record". o Action field: select "success". o Disabled field: change to "false". In the Design editor delete the button Submit.

6. Run application

Right-click ShowDeptRecords.jspx and select Run. When application is invoked, a list of records in a table is displayed (as shown below).

To create a new record press button [Create Record].

In the form, enter data like the following and press [Submit Record].

The new record will be displayed (as shown below).

Attachments CreateRecord.zip (4,092.93 KB) bc4j-appnav.jpg (11.39 KB) createrecord.jpg (36.21 KB) facesdiagram.jpg (13.93 KB) run-createrecord.jpg (6.79 KB) run-showrecords1.jpg (11.88 KB) run-showrecords2.jpg (12.76 KB) showallrecords.jpg (35.51 KB) Related Products

Middleware > Developer Tools > Java Development > Oracle JDeveloper

Keywords ADF; DESIGN EDITOR; JDEVELOPER; JSP PAGE; SUBMIT DATA; VIEW OBJECT Back to top

FAQ for Integration of Oracle E-Business Suite and Oracle Application Development Framework (ADF) Applications [ID 1296491.1] Modified 30-APR-2011 Type FAQ Status PUBLISHED This document covers Frequently Asked Questions for the combination of Oracle Application Development Framework (ADF) with Oracle E-Business Suite (EBS).

In This Document
1. What types of integration between EBS and ADF applications can I do? 2. What is the Oracle E-Business Suite Software Development Kit for Java (EBS SDK for Java)? 3. Where is the Oracle E-Business Suite Software Development Kit for Java (EBS SDK for Java) documented? 4. What is the difference between the Oracle E-Business Suite Software Development Kit for Java (EBS SDK for Java), AOL/J-Lite, and fndext.jar? 5. Do I have to use AppsDataSource with my ADF application? Can I just connect directly to the APPS schema instead? 6. Does the AppsDataSource support only read-only access or am I allowed to update data too? 7. How do I launch an ADF application from the EBS Home Page? 8. How do I embed an ADF page or page fragment inside an OA Framework page in EBS? 9. Where do I find more documentation on developing ADF applications that integrate with EBS? 10. Can I get help debugging my ADF application integration with EBS? 11. Can I use the JAAS feature of the EBS SDK for Java with my ADF application? 12. Can I use ADF 10g with the EBS SDK for Java? 13. What configurations were tested with the EBS SDK for Java? The most current version of this document can be obtained in My Oracle Support Knowledge Document 1296491.1. There is a change log at the end of this document.

1. What types of integration between EBS and ADF applications can I do?
There are multiple ways that ADF external applications can be integrated with Oracle EBusiness Suite: 1. "Back-end-only integration" to Oracle E-Business Suite data and services. For example, this may include using the Oracle SOA Suite on the back end, with Oracle Application Development Framework 11g (ADF 11g) on the front end. There is no user interface integration at all (that is, a user cannot go back and forth between the ADF UI and the Oracle E-Business Suite OA Framework UI). This type of integration typically uses the AppsDataSource feature but no other parts of the Oracle E-Business Suite Software Development Kit for Java. 2. "Launch from Oracle E-Business Suite integration" may include back-end integration as above, but in this case, the Oracle ADF user interface is launched from the Oracle E-Business Suite home page. There is no further user interface interaction with Oracle E-Business Suite (users cannot return to the OA Framework home page, for example). See "How do I launch an ADF application from the EBS Home Page?" below.

3. "Full user interface and back-end integration" allows users to move back and forth between the ADF user interface and the Oracle E-Business Suite user interface. For example, a user could go to an ADF page from an OA Framework page and back again, or ADF components could be embedded into an OAF page. This requires some context being shared between OAF and ADF, as well as session management between the two systems. This third type of integration is not yet supported.

2. What is the Oracle E-Business Suite Software Development Kit for Java (EBS SDK for Java)?
The Oracle E-Business Suite Software Development Kit for Java (EBS SDK for Java) includes AppsDataSource, Java Authentication and Authorization Service, and Utilities for Oracle E-Business Suite. These features are meant for use with Java EE programs deployed in application servers on external nodes, that is, nodes other than those where the Oracle E-Business Suite is installed.

3. Where is the Oracle E-Business Suite Software Development Kit for Java (EBS SDK for Java) documented?
The Oracle E-Business Suite Software Development Kit for Java (EBS SDK for Java) is documented in My Oracle Support Document 974949.1.

4. What is the difference between the Oracle E-Business Suite Software Development Kit for Java (EBS SDK for Java), AOL/J-Lite, and fndext.jar?
These are all different names for the same feature. Oracle E-Business Suite Software Development Kit for Java is the official name of the feature, while fndext.jar is the name of the library file that contains the feature. AOL/J-Lite is an obsolete internal nickname for the feature.

5. Do I have to use AppsDataSource with my ADF application? Can I just connect directly to the APPS schema instead?
We strongly recommend using AppsDataSource with your ADF application instead of just connecting directly to the APPS schema from your ADF application. The AppsDataSource and similar AppsXADataSource standard data sources enable access to the Oracle E-Business Suite APPS database schema from external Java EE environments without requiring sharing of the password for the APPS schema (database user). Since the APPS database password is typically changed frequently, using these data sources insulates such programs from having to change their authentication information. Using these data sources also helps prevent wide exposure of the APPS password.

6. Does the AppsDataSource support only read-only access or am I allowed to update data too?
AppsDataSource supports all of the CRUD (create, read, update, delete) operations. Your ADF application can also access PL/SQL APIs available in the APPS schema and do other operations possible through a regular datasource connection.

7. How do I launch an ADF application from the EBS Home Page?


Release 12.1.3 and Up Only: Regardless of how or if an Oracle ADF 11g application integrates with Oracle E-Business Suite data on the back end, launching an Oracle ADF 11g application from the OA Framework home page in Oracle E-Business Suite is simple with the addition of new features in Oracle E-Business Suite Applications Technology Release 12.1.3, including Oracle Application Framework and Oracle Application Object Library. Note that this mechanism is only for launching ADF; it does not provide session management or other features that would allow a user to navigate back to the Oracle EBusiness Suite UI from the ADF UI. 1. The ADF application must be located on a separate application tier server machine from the Oracle E-Business Suite application server. 2. The ADF application is deployed using Oracle WebLogic Server 11g or another appropriate application server. 3. In the Oracle E-Business Suite, set the value of the FND_EXTERNAL_ADF_URL profile option to the context root of the URL for the application, such as http://www.myhost.com:7001/my-context-root. The profile option may be set at whatever level is appropriate (site, responsibility, and so on). See Oracle E-Business Suite System Administrator's Guide - Maintenance for further information on setting profile options. 4. Create a new Oracle E-Business Suite function using the ADFX function type. Set the HTML Call as: GWY.jsp?targetPage=faces/ For example: GWY.jsp? targetPage=faces/MyADFShoppingAppDashboard 5. Incorporate the new function into Oracle E-Business Suite function security by adding it onto a menu and creating appropriate roles, responsibilities, and grants. See Oracle E-Business Suite System Administrator's Guide - Security for further information on setting up function security. 6. Select the new link from the Oracle E-Business Suite home page to go to the ADF application. 7. You may also call your function from within OA Framework pages the same way you call other registered functions.

8. How do I embed an ADF page or page fragment inside an OA Framework page in EBS?
Create an ADFX function as above in " How do I launch an ADF application from the EBS Home Page?". In your OA Framework page, create a rich container object. Call your function from the rich container. Currently, this should only be an ADF page that does

not require session management of the EBS session. For example, a display-only graph is an ideal object for this type of embedding.

9. Where do I find more documentation on developing ADF applications that integrate with EBS?
Oracle University offers courses in developing applications with ADF, and the online documentation for ADF development is excellent. For information specific to integrating ADF applications with EBS, this document is currently the only document specifically on this topic. The My Oracle Support Document 974949.1 mentions ADF integration only in the context of whether particular Oracle E-Business Suite SDK for Java features can be used with ADF.

10. Can I get help debugging my ADF application integration with EBS?
Extensions built using the Oracle E-Business Suite SDK for Java with Oracle E-Business Suite and ADF applications are considered customizations. Please see My Oracle Support Document 122452.1, "Global Customer Services Policy Regarding Customizations" (Note 122452.1) for further information on support for customizations. Oracle will provide patches for reproducible issues with published EBS APIs or the EBS SDK.

11. Can I use the JAAS feature of the EBS SDK for Java with my ADF application?
No, you cannot use the JAAS feature of the EBS SDK for Java with your ADF application. This feature is not intended for use with Oracle ADF applications, because ADF applications use an ADF-specific JAAS-compliant security setup.

12. Can I use ADF 10g with the EBS SDK for Java?
The Oracle E-Business Suite SDK for Java has been tested with ADF 11g 11.1.1.3.0. Unpredictable results may occur if using the SDK with ADF 10g. Oracle will issue patches only for issues that can be reproduced with ADF 11g 11.1.1.3.0 or higher.

13. What configurations were tested with the EBS SDK for Java?
The Oracle E-Business Suite SDK for Java was tested with EBS 12.1.3 and ADF 11g 11.1.1.3.0. Unpredictable results may occur if using the SDK with other configurations. Oracle will issue patches only for issues that can be reproduced with those minimum releases or higher.

Change Log
Date Description

18 Feb. 2011 Published document 30 Apr. 2011 Added questions 11-13 My Oracle Support Knowledge Document 1296491.1 by Oracle E-Business Suite Development Copyright 2011, Oracle. All rights reserved.

References
NOTE:122452.1 - Global Customer Services Policy Regarding Customizations NOTE:974949.1 - Oracle E-Business Suite Software Development Kit for Java (includes AppsDataSource, Java Authentication and Authorization Service) Readme - Patch 9863609 Related Products

Oracle E-Business Suite > Applications Technology > Oracle E-Business Suite > Middleware > Developer Tools > Java Development > Oracle JDeveloper

Keywords ADF; E-BUSINESS; EBS; OA FRAMEWORK; WEBLOGIC Back to top

----------------------------------------Different files created in JDeveloper:--------

Jdeveloper version usedin this post is:=10.1.3 When you create a component in ADF , whether its Entity object or a view object in the model layer, or drag and drop view object on the jsf page, there are many xml files and other files which are created by Jdeveloper. And developers gets crazy as, why so many files are created and what are they for. Specially beginners/ADF newbies gets confused with so many xml files which getting created, and that gives them one reason to run way from learning ADF. In

this post I will try to explain these xml and other files which you should know as a developer when you do development using ADF. When you create an application in Jdeveloper with JSF , ADF BC as template, two project gets created Model and ViewController. And a file 1) .jws which is used for storing the projects added in the workspace(check your workspace on disk). Under the Model and ViewController projects two files gets created as Model.jpr and ViewController.jpr. 2) .jpr file is used to store the project related information like java files created in the project etc. Once you start creating the Entity or View object under the Model, one more file gets created under the Model/src/Model.jpx. 3) Model.jpx file contains all the application modules defined in your Model project. And other configuration details such as database connection used in model layer. Some times during development, if you get JBO 30003 or database error, then check the _NamedConnection parameter in the same file, if it is pointing to the correct database connection name. Entity object is the Java object representation of the database table row from which it is created. Once your create an Entity object(say EmpEO), two files which gets created. 4)EntityName.xml (for EmpEO, it is EmpEO.xml):- This file contains the name of the database table from which the entity object is created, name and data type of each attribute in eneity object, and the corresponding column to which that attribute represents. For example in the following figure, attribute EmployeeId is driven from the column name Employee_ID, with type as number and other attributes such as primary key etc:-

5) EntityNameImpl.java(for EmpEO, it is EmpEoImpl.java):- though it is not required to generate this file, as default option it is created. It has getter and setter methods for the entity object attributes. This file can be used to add custom code, such as in the setter method of commission of the employee, commission can be first calculated based on the employee salary, hire date or other conditions. View object fetch the result set from the database based on the query on which it is based. Once you create view object whether entity based or read only,two files are created:6) ViewObjectName.xml(for EmpVO, it is EmpVO.xml):-which specifies the entity object on which this view object is dependent, query of the view object which will fetch the desired resultset and the attributes which are there in view object.View object is created at run time based on this .xml file. 7)ViewObjectNameImpl.java(For EmpVO, it is EmpVOImpl.java):- When ever you create a new row in the view object, and you want to provide some custom behavior when a new row is created, you can overwrite create() method in same class. Similarly remove() and other methods. An Application module which acts a container for view objects and take care of transaction handling. When you create an application module, two files are create:8) ApplicationModuleName .xml(for EmpAM, its EmpAM.xml):It has name of the application module, the application module class path, and all view objects which are added in

the application module. This information is used to create the view objects at runtime. 9)ApplicationModuleName Impl.java(For EmpAM, its EmpAMImpl.java):- In this java class you will write methods like: iterating two or more view objects result set added in same application module to perform some business logic. calling a pl/sql code. writing a method and later on exposing it by adding it in client interface, so that it can be called from view layer. 10) Bc4j.xcfg:- it has different configuration properties of the application module, as such , the name of the database connection, type of DB connection etc. Once you create your jspx page with drag and drop any view object from data control palette, page definition file and DataBindings.cpx file gets created. 11) DataBindings.cpx:- This file is created for the first time and only once when you drag and drop any view object or method from data control palette to the jspx page. This page contains information about page definition file corresponding to your jspx page, the data controls used by your application. Ya ya, I know you are now thinking of what is data control and data bindings. Thats actually what I am thinking of my next blog post topic :). Check the following figure, it shows the contents of the DataBindings.cpx file, when I drag and dropped the EmpVO from the data control palette to ViewEmpDetails.jspx page as ADF read only table. It shows how ViewEmpDetails.jspx file is linked to its page definition file ViewEmpDetailsPageDef.xml:-

Created DataBindings.cpx file is created under the view controller project Application Sources view . 12) PageDef.xml(for ViewEmpDetails.jspx, its ViewEmpDetailsPageDef.xml):- Page definition file created

for each jspx page,when you drop a particular component from data control palette to your jspx page. This is the file which actually wries your UI components to the corresponding attributes in the view object. This file mainly contains following elements(tags):12.1 ) executables:- which defines various result sets(specified as iterator tag) to be executed when the page is loaded. Or defines the methods exposed from application module in client tier(specified as methodIterator tag) to be executed. 12.2) bindings:- it specifies the attributes which will be contained in the result set pointed by the iterator tag. Or the details of method to be executed pointed by the methodIterator tag. Check the following figure, in which iterator EmpVO1Iterator specifies the employee details to be fetched when page is loaded. And under bindings it specifies all attributes which will be available in the result set to be shown in UI.

If you check the source of the ViewEmpDetails.jspx page, it will be clear to you that how it is wired to the elements present in the page definition. And at last two files which are created by Jdeveloper itself under web-inf folder in ViewController project once you have create an application with JSF , ADF BC as template are:13)faces-config.xml:- which acts as a controller by storing the navigations rules. And in addition to that it stores the configuration details about managed beans.

14)Web.xml :- which is the standard j2ee deployment description file and provide application level configuration details.

Das könnte Ihnen auch gefallen