Sunday, December 2, 2018

How to create ADF Application

To create a basic ADF application, follow the steps :
Open Jdeveloper.



Click on New Application option in Applications window. It will  open a popup window, Select “ADF Fusion Web Application” option to create ADF Application. Click on OK button.




  • Enter the Application Name in window. Application Name should explain the functionality of application.
  • Select Directory where you want to save your source code.
  • Enter Application Package Prefix. Mean it is a parent package. All other packages will be created inside this package. Java standard says that a Package Name should be in small case. 
Now click on Next button and Enter Project Name. You can leave the Project Name as default 'Model'.

By default, An ADF application contains two projects. 1. Model and 2. ViewController.
 
Click on Next button to enter the Package Name for Model Project.


click on Next Button, It will ask you to enter the Second Project Name. You can leave the same as default 'ViewController'.


Click on Next, Now enter Package Name for ViewController Project.


Click on Next button, Now you can set the Build Tool for you application. We are using default Build tool as provided by Jdeveloper.


Now the structure of this Application is ready. This new application contains:

  • Two Projects (Model and ViewController). 
  • Currently, Model Project is empty. 
    • Further you can add ADF-BC (Business Components like EO,VO,AM) in this project. You can define business logic class , service class in Model Project.
  • In View Controller you can access -
    • adfc-config.xml
    • faces-config.xml
    • trinidad-config.xml
    • web.xml
  • adfc-config is a default unbounded Taskflow. 
  • Faces-config allow you to define Managed Bean, Validators, Resource Bundle etc.
  • You can register skin family in trinidad-config.xml.
  • web.xml is web descriptor.

Later, We will discuss about these xml files in detail.



You can create a runnable page to your application. Without runnable page you can not run the application and can not see the application output on browser.

Runnable Page can not created in ViewController project only. We will create a jspx Page to run the application.
Right click on view Controller -> New -> From Gallery.
Search 'Page' in Gallery. It will show you multiple options of Page. Select Page(JSF/Facelets).


Here you can enter Page Name in 'File Name' option. 
Here we are creating jspx/jsf page, so this Name will appear in browser URL.
Enter Directory to save the page location on drive. 
Select Document Type as 'JSP XML'. This option will create JSPX page while selecting 'Facelets' will create JSF page. 
You can use Template to design the page with Pre-define templates. or you can select 'Create Blank Page' if you wish to design the page later by drag & drop 
click on ok button and your blank page is ready.


You can see the Components,  Properties right side of the page. Page Structure can be modified in Structure window left side of page.
search Panel Group Layout in components and drag & drop layout to page.
Now search Output Text in components and drag & drop layout to page.
Select Output Text in Structure Window and then you can see the properties of output text in property window.
You can change the 'value' of Output Text. Change 'Inline Style' for font.


Now you are ready to run the page.

To run the page, right click on untitled1.jspx page in Application window. Click run.

If it is first time that you are running any application then weblogic will ask you for password and port. Enter new password for weblogic console, re-enter the same password, leave the port option same as default. click ok button.
It will take a while and browser will load the output.

No comments:

Post a Comment