Vous êtes sur la page 1sur 31

Exploring the Project Structure and Core File Architecture

Copyright 2008, Oracle. All rights reserved.

Objectives
After completing this lesson, you should be able to do the following: Work with the JDeveloper integrated development environment (IDE) Explain how metadata files relate to data controls Identify Application Development Framework (ADF) data control and data binding files Describe ADF Faces and Web configuration files Explain the hierarchical relationship of Extensible Markup Language (XML) metadata files in a Web application Describe the file structure of a Web application

1-2

Copyright 2008, Oracle. All rights reserved.

Agenda
JDeveloper Overview Metadata Files File Layout

1-3

Copyright 2008, Oracle. All rights reserved.

Launching JDeveloper
You can launch JDeveloper by:
Double-clicking jdeveloper.exe in the <JDev Home> directory Starting from the command line or a shortcut pointing to jdev.exe in the <JDev Home>\jdev\bin directory

You can specify flags:


For the user directory: -J-Dide.user.dir=<path> For editor windows: -noreopen

1-4

Copyright 2008, Oracle. All rights reserved.

Using the Component Palette


The Component Palette enables you to: Display the components that you can drag to the visual editor Search for the components Display the favorite and recently used components

1-5

Copyright 2008, Oracle. All rights reserved.

Using the Structure Window


The Structure window provides: A tree view of the selected document or object The ability to:
View in different ways Navigate Sort
New View
Freeze / Unfreeze Synch with Editor Show Methods, Fields, Static / Public Members

1-6

Copyright 2008, Oracle. All rights reserved.

Agenda
JDeveloper Overview Metadata Files File Layout

1-7

Copyright 2008, Oracle. All rights reserved.

Metadata: Overview
ADF Business Components (ADF BC) are metadata-driven with optional Java code. In addition to defining components in the model, metadata files are used to:
Specify parameters, methods, and return values for data control usage Create objects in the ADF binding context and define their run-time behavior Define the configuration for UI components Define the application configuration for Java EE application server

You can modify metadata in the Structure window, Property Inspector, or by using other design-time facilities.

1-8

Copyright 2008, Oracle. All rights reserved.

Examining Metadata File Relationships


adfm.xml Defines the location of .cpx, .jpx, .xcfg files DataBindings.cpx Provides the location and mappings of pages and page definition files; defines data controls and maps them to beans <page>PageDef.xml Binds iterators to VO and iterator bindings to iterators

<page>.jspx or .jsff
References bindings defined in the page definition file bc4j.xcfg

Defines AM names and their database sources with any run-time parameters used
<AM>.xml

Defines VO names and locations

1-9

Copyright 2008, Oracle. All rights reserved.

Examining Metadata File Hierarchy


ADF-BC Web Application Model Project Data Control Files
<AM and VO>.xml files

UI Project Data Binding Files


DataBindings.cpx <Page>PageDef.xml files adfm.xml <Page>.jspx files

bc4j.xcfg

The UI project is dependent on the Model project.

ADF Faces & Web Config Files


faces-config.xml
adfc-config.xml <task flow>.xml files web.xml

1 - 11

Copyright 2008, Oracle. All rights reserved.

Data Control Files


Metadata files for an ADF BC Web application fall into three broad categories: Data control files:
AM and VO .xml files bc4j.xcfg

Data binding files ADF Faces and Web configuration files

1 - 12

Copyright 2008, Oracle. All rights reserved.

Configuring Application Modules: bc4j.xcfg


The bc4j.xcfg file: Contains application module metadata, such as:
Name Database connection Run-time parameters Security information Pooling information

Is located in the application module (AM) packages common directory

1 - 13

Copyright 2008, Oracle. All rights reserved.

Data Binding Files


Metadata files for an ADF BC Web application fall into three broad categories: Data control files Data binding files:
<Page>.jspx or .jsff <Page>PageDef.xml DataBindings.cpx adfm.xml

ADF Faces and Web configuration files

1 - 14

Copyright 2008, Oracle. All rights reserved.

Defining a Binding Container: Page Definition Files


Page definition files (<pagename>PageDef.xml): Are created for each page that has a data-bound component Define the pages binding container Are in the Application Navigator under Application Sources > package

1 - 15

Copyright 2008, Oracle. All rights reserved.

Registering Data Bindings: Databindings.cpx


The Databindings.cpx file: Is created the first time a data-bound component is added to a page Defines the binding context of the entire application
Maps JSF pages to their page definition files Lists the usage of data controls

Is located in the \adfmsrc directory of the UI project Displays in the Application Navigator under Application Sources > package > node

1 - 17

Copyright 2008, Oracle. All rights reserved.

Finding Data Controls: adfm.xml


The adfm.xml file: Points to the user interface (UI) projects:
Data bindings and data controls registries BC service and project registries

Is located in the projects META-INF directory

Binding context definition file


adfm.xml in UI project

Data Controls definition file DataControls.dcx

DataBindings.cpx
1 - 19

Copyright 2008, Oracle. All rights reserved.

Examining the Binding Context


Binding Context

Page definitions *PageDef.xml

Binding Container

Data control

Structure definitions *.xml

Binding Context definition DataBindings.cpx

Data control description *.dcx

1 - 20

Copyright 2008, Oracle. All rights reserved.

ADF Faces and Web Configuration Files


Metadata files for an ADF BC Web application fall into three broad categories: Data control files Data binding files ADF Faces and Web configuration files

1 - 21

Copyright 2008, Oracle. All rights reserved.

Examining ADF Faces and Web Configuration Files


Configuration files for an ADF Faces application: Are in \public_html\WEB-INF

Display in Application Navigator: Web Content > WEB-INF Include:


Individual task flow definitions adfc-config.xml faces-config.xml trinidad-config.xml (also trinidad-skins.xml if custom skins are used) web.xml

1 - 22

Copyright 2008, Oracle. All rights reserved.

Configuring the Applications Unbounded Task Flow: adfc-config.xml


The adfc-config.xml file: Is the default name for the applications unbounded task flow Is like all task flows:
Can contain activities, control flow rules, and managed beans to enable a user to complete a task Displays in the Application Navigator under Web Content and also in both WEB-INF and Page Flows

1 - 23

Copyright 2008, Oracle. All rights reserved.

Configuring the Application: faces-config.xml


faces-config.xml is the standard JSF application configuration resource file. For ADF Faces, the navigation, managed beans, and so on are in the task flow files, so faces-config specifies:
The default render kit The resource bundle

1 - 24

Copyright 2008, Oracle. All rights reserved.

Configuring Skins: trinidad-config.xml and trinidad-skins.xml


The trinidad-config.xml file:
Defines the default skin used by the UI components Defaults to blafplus-rich, but you can change it to blafplus-medium, simple, or a custom skin Is created automatically when the first ADF Faces component is added to a page

The trinidad-skins.xml file:


Lists custom skins Is created manually

1 - 25

Copyright 2008, Oracle. All rights reserved.

Setting Run-Time Configuration Parameters: web.xml


The web.xml file: Contains the configuration parameters needed to run an ADF Faces application, such as:
Where to save the application view state Servlets and filters Registered mime types Session time-out period

Properties editor

Flat editor

Is generated by JDeveloper Is edited with a properties editor or flat editor


Copyright 2008, Oracle. All rights reserved.

1 - 26

Examining Additional Metadata Files


Additional metadata files: Application level:
<application>.jws cwallet.sso jpsconfig.xml connections.xml adf-config.xml

Model project:
<project>.jpx

UI project:
pagetemplate-metadata.xml

Any project:
<project>.jpr <project>Bundle.properties

1 - 27

Copyright 2008, Oracle. All rights reserved.

Agenda
JDeveloper Overview Metadata Files File Layout

1 - 28

Copyright 2008, Oracle. All rights reserved.

File Layout: Application

<Application>

<Application>.jws

.adf META-INF

adf-config.xml

connections.xml

src

META-INF

cwallet.sso

jps-config.xml

orion-application.xml

<Model Project>

<UI Project>

1 - 29

Copyright 2008, Oracle. All rights reserved.

File Layout: Model Project

<Model Project>

<Model Project>.jpr

classes <Model Project>Bundle.properties src <package> common bc4j.xcfg <Model Project>.jpx <business component>.xml files <business component>.java files

1 - 30

Copyright 2008, Oracle. All rights reserved.

File Layout: User Interface Project

<UI Project>

<UI Project>.jpr

adfmsrc

META-INF

adfm.xml

DataBindings.cpx

classes

<package> pageDefs

<Page>PageDef.xml files

model

WEB-INF

Task flow diagrams properties files

(Continued on the next slide)

1 - 31

Copyright 2008, Oracle. All rights reserved.

File Layout: User Interface Project


(Continued from the previous slide)
public_html .jsp and .jspx files, image files

<package>
WEB-INF

.jsp and .jspx files

faces-config.xml adfc-config.xml

trinidad-config.xml web.xml

<package>

<task flow>.xml files

pagetemplate-metadata.xml src META-INF <package> <UI Project>Bundle.properties

1 - 32

Copyright 2008, Oracle. All rights reserved.

Summary
In this lesson, you should have learned how to: Work with the JDeveloper IDE Explain how metadata files relate to data controls Identify ADF data control and data binding files Describe ADF Faces and Web configuration files Explain the hierarchical relationship of XML metadata files in a Web application Describe the file structure of a Web application

1 - 33

Copyright 2008, Oracle. All rights reserved.

Practice 1
This practice covers the following topics: Examining configuration files Tracing data from a page back to its source

1 - 34

Copyright 2008, Oracle. All rights reserved.