This ADF JClient component demo illustrates the complete set of component bindings
available with ADF JClient. Oracle JDeveloper 10g helps you set ADF
JClient component bindings on standard Swing components to quickly assemble
databound applications.
Using ADF JClient in Oracle Jdeveloper 10g, Swing based applications
can easily be bound to datasources (Business Services) like ADF Business Components,
Enterprise Java Beans, Webservices, TopLink and Java Beans.
This Component Demo showcases how to declaratively bind Swing components like
JComboBox, JTable, JTree etc. to datasources to build enterprise class Java
applications.
Installing and Running the Demo
To create the schema for the demo:
Create a user if not reusing an existing account like HR:
Log in to the database administrator account using SQL*Plus:
SQL>create user_name identified by password;
SQL> grant resource, create session, connect to username;
Create a Connection in Oracle JDeveloper
Open the Connection Navigator (ctrl+shift+o)
Select the "Database" entry and create a "New Database Connection"
using the right mouse button menu
Give a name to the connection and provide the connect information for the
database account. Before finishing, test if the connection works.
Create the tables :
You must run the included SQL script (createADFJClientDemoTables.sql) using
the
jclient_user connection. To do this in JDeveloper, you must have SQL*Plus
installed.
Open the start_here project in the Application Navigator.
Right click on createADFJClientDemoTables.sql.
Select Run in SQL*Plus|<connection name>
If you haven't used SQL*Plus with JDeveloper, you may be prompted for
thelocation to SQL*Plus. Enter it and click OK.
If you don't have SQL*Plus installed, you could also use the SQL Worksheet
available in JDeveloper.
From the Tools menu, select SQL Worksheet. Copy all contents of the script
into the SQL Worksheet. Click the Execute Statement button.
This script is designed for the Oracle database. It may not work on other
databases
Update the design-time connection in your ADF Business Components project.:
In the Application Navigator, expand the onlineorders
package in the Business Components folder in the OnlineOrders
project.
Right-click OnlineOrdersModule and choose Configurations...
.
Click Edit in the Configuration Manager to update the
existing OnlineOrdersModuleLocal configuration definition.
Change the database connect to the user account used with this demo.
Compile the ADF Business Components project.
You are now ready to configure the JClient project (named ComponentDemo).
In he Oracle JDeveloper 10g Application Navigator:
To configure the JClient project:
Test the JClient Data Definition.
In the Navigator, expand the test package to locate
the class named testApplicationDefinition.java.
Run this test case to verify your data definition. It will try to connect
and tell you if you succeeded by popping up a window.
Load the demo images:
In the mediaLoader package, you'll find a class named
loadMedia.java.
Run this class, to load the images into the database.
Modify the program arguments:
Right-click ComponentDemo and choose Project Settings... .
Choose Runner in the Project Settings dialog selection
tree.
Modify Program Arguments so they point to the directory
containing all your source files. This step is required if you run this demo
on UNIX, to make sure that the ..\src entry is changed to ../src
To run the JClient demo:
You are now ready to run the demo.
Select the ComponentDemo project and select "Make" from
the right mouse context menu. This compiles the project.
Select theOnlineOrders project and select "Make" from the
right mouse context menu. This compiles the project.
The starting class is componentdemo.StartFrame.java. Select
this class in the JDeveloper Navigator and select "Run" in the right
mouse context menu
About the generated Code
Using the Oracle Application Development Framework with ADF JClient, the binding
is defined in an xml files outside of the JClient Java Panel.
The name of the metadata file, the binding container, is <PanelName>UIModel.xml.
To study the databinding for a specific demo, select the UIModel.xml file in
the Application or System Navigator of JDeveloper.
Open the Structure Window and select the entry for the component you are interested
in (e.g. a navigation list box) and right mouse click onto it. In the context
menu, select "Edit" to start the databinding editor.