Fusion Web Application along with Deployment
Steps
To create an
application, perform the following steps:
1. Click on New Application within the
Application Navigator tab in the JDeveloper. This will display New Gallery with
a set of predefined templates targeting various technologies.
2. For ADF web applications, select the Fusion
Web Application (ADF) template and enter the Application Name and here itself
be can provide the package prefix path to organize the Application content and
then click on Next.
3.
JDeveloper will launch the Create Fusion Web Application wizard and will set up
the basic skeleton for our application by generating the Model and View
Controller projects.
When you
finish the Fusion web application generation wizard, the following files are
generated in your source folder. Let us take a quick look at these metadata XML
files to understand the role of each item in our application.
• adfc-config.xml: ADF Faces is built on top
of the JSF with a lot of extra features, which are not covered by the core JSF.
ADF Faces uses adfc-config.xml to keep its configurations. As a Fusion
developer, you should use adfc-config.xml to configure the navigation cases and
managed bean definitions. To run your Fusion web application, you may need both
faces-config.xml and adfc-config.xml files—which is true even if you have not
added any custom configuration entries in faces-config.xml.
• faces-config.xml: The faces-config.xml file
contains the configurations for a web application built using JSF. This file
allows us to configure managed beans, data convertors, and validators used in
the UI, navigation cases, global resource bundles, view handlers, page
lifecycle phase listeners, and custom lifecycle factory implementation for the
application.
• trinidad-config.xml: Apache MyFaces
Trinidad forms the base for the ADF Faces component set. In fact, Trinidad
components earlier were ADF Faces components, which were donated to Apache
Software Foundation later in the journey. By default, the generated
trinidad-config.xml file contains only the skin family name. However,
trinidad-config.xml can be used to override the default configurations for
accessibility settings, locale settings, state management, and so on.
• web.xml: The web.xml file acts as
deployment descriptor for a Java-based web application. When you generate a
Fusion web application by using JDeveloper, a default web.xml file with default
settings will be created for you. The default entries include context
parameters for configuring the runtime state of the system, security filters,
data binding filters for web pages, and resource look up filters. The web.xml
file also includes servlet context listeners for initializing the management
and monitoring services for view and model layers.
• Weblogic-application.xml: This file is the
WebLogic Server-specific deployment descriptor.
• adf-config.xml: The adf-config.xml file
contains application-level settings, which manage the runtime
infrastructure—such as failover behavior for the application modules, global
fetch limit for all the view objects, caching of resource bundles, automated
refresh of page bindings, and so on—for your application.
Application Development Steps:
Step-1: Create Database Connection and click OK.
Changes in the Application
You will see connection in MyFirstApp in
Database Navigator Like below, See the changes in Application
- connections.xml: This file contains the database connection detail that we create for development. If your application consumes web services or map viewer services, the corresponding connection uniform resource locator (URL) will also be present in this file.
- jps-config.xml: The jps-config.xml file is used to store the Oracle Platform Security configurations. The location of this file is configured in adf-config.xml. If your application is not configured to use ADF Security, this file, at a minimal level, acts as a pointer to cwallet.sso, which contains the password for the database connection details present in connections.xml.
- cwallet.sso: The cwallet.sso file follows the Oracle Platform Security Services (OPSS) specification and it is used as a credential provider in connecting to external systems, such as databases. This file is normally not edited directly.
Step-2: Generating the data model and business
services
Right click
on Model Project and click New Select Business Component from table as shown below
and click on Ok
Shuttle the
Table from Available to Selected component and Rename it and organize the
package also to create the Entity Object
Click on
Next to click to create the view Object and here we can organize the package
also as below
Check the
checkbox to create the Application Module and organize the package as shown
below then click Next to generate the
Business Diagram or else click finish to complete the generation of Business Component.
Changes in
Application after Click on Finish button of Business Component Wizard.
• EmployeeEO.xml: The EmployeeEO.xml file
contains the name of the EMPLOYEES table that we selected for generating the
entity and attribute definitions, reflecting the properties of the columns from
the EMPLOYEES table.
• EmployeeVO.xml: The EmployeeVO xml file
contains attribute definitions copied from EmployeeEO. this file also contains
a query to fetch Employee records.
• HRServiceAppModule.xml: The
HRServiceAppModule.xml file contains information about the view object
instances and optional service method definitions. The view object instance
used in our example is EmployeeVO1.
• bc4j.xcfg: The bc4j.xcfg file contains
metadata information about the application module such as name, database
connection, runtime configuration, and so on.
• Model.jpx: The
<model-project-name>.jpx file is used by both ADF design-time tools and
runtime components. The .jpx file contains the pointers to business component
definitions in the model project, where each entry describes the package name
and type of business components in the package. In more complex applications,
it may also contain metadata for the shared application module, which is
primarily used at runtime to share the same data between clients. This file is
located in the package folder for your model project.
When you
create an application module, JDeveloper IDE automatically creates a data
control that contains all the functionality of the application module. You can
click on the refresh icon in the Data Controls panel window to view the data
control generated for the application module that you added to the model
project.
The data
control exposes the following:
• View object instances as named data
collection
• Built-in operations on data collection and
custom business methods
You can
design a data bound user interface by dragging an item from the Data Controls
panel and dropping it on a web page as a specific UI component.
Step-3:
right click on the MyfirstAppUI and select New, In New Gallery, expand Web
Tier, and select JSF. Select JSF Page as item. Confirm the action by clicking
on OK. Refer to the following screenshot:
In the
Create JSF Page dialog, you can key in the name for the page and optionally
select a template. We will use the Oracle Three Column Layout template to build
the Employee.jspx page.
You can use
the drag-and-drop offerings from JDeveloper to visually layout controls on a
page. To build a UI table displaying data from the Employees view object, you
just need to drag the instance of the Employees view from the Data Controls
panel and drop it on the page by choosing the desired display component available
in the list. The following screenshot illustrates this feature:
Changes in
MyFirstAppUI Project:
The IDE
generates two metadata XML files to enable the data binding for the page.
• EmployeePageDef.xml: The department page
definition XML file is used at runtime to fetch the data when you access the
page through the browser. This file will act as binding container for the web
pages.
• DataBindings.cpx: The DataBindings.cpx file
defines the binding context for the entire application. This file acts as the
registry for page definition files. It also holds metadata for the business
services implementations.
• adfm.xml: The adfm.xml file acts as the
registry of registries, holding pointers to each registry metadata file used in
the project. In our example, adfm.xml contains the path for the
DataBindings.cpx file.
Step-4: Deploying and running the application
Run The
Integrated Web Logic Server as shown in below screen or else standalone web
logic server will be running in system.
Right Click
on Employee.jspx Page and select Run from the option to deploy the Application
in Integrated WebLogic Server.
We can
deploy the Application in Integrated server or standalone server via following
steps if server is up and running.
a) Create
the ADF Library Jar Deployment Profile for Model Project as below
c) Create the EAR Deployment Profile for MyFirstApp Application as below
d) Right
Click on the Application and select deploy from the option and select the
server for deploying the Application as shown below.
Click finish to complete the deployment of Application and check the deployment log to check the deployment status.
Copy the deployed url and append the /faces/Employee.jspx and open in the browser to see the result as sown below.




























No comments:
Post a Comment