Sunday, December 9, 2018

ADF Architecture

ADF architecture has five different layers. ADF architecture follows MVC architecture. Like in MVC, three layers are there. Additionally, two more layers are added in ADF architecture. i.e.  Business Service Layer and Data Service Layer.
So we can explain ADF architecture by defining following layers in order.
  1. View Layer
  2. Controller Layer
  3. Model Layer
  4. Business Services Layer
  5. Data Services Layer


View Layer 
This layer implements UI part of ADF application. View Layer of ADF architecture supports multiple view technologies. It works well for Browser, Desktop, Mobile technology as well.
ADF faces are used for web application. ADF Faces are built on top of the JSF technology.
ADF Swing can be used for desktop applications.

Controller Layer


Controller layer provided the control on flow of application. Re-usability is also provided by ADF Controller. Task flows are used to provide control flow and re-usability of components. State Management, Transaction Management is also done by ADF Controller.

Model Layer
Model Layer provides data to View Layer or UI in ADF application. Model Layer further divided into two parts.
  1. Data control – Works as an adapter for business service layer. Provide implementation of business service layer to View Layer.
  2. Data binding – Binds the data and logic of Business Service layer from Data control to the view Layer components.


Business Service Layer
Business Service Layer provided the access of Data from various Data Sources like RDBMS, Excel, CSV etc. It provides space to write business logic for application.
Business components, Beans, POJO, Web services are the part of business Service Layer.

Data Service
Data Source provides the Data for the application. Data can be fetched from various Data sources like Database, Web Services etc.

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.

How to install Jdeveloper

Prerequisite

  • You should have Jdeveloper installer exe file or Jdeveloper installer jar file.
  • You should already have java installed on your system. Set Class Path and Java Home in Environment Variable.

Installation Type

  • .exe file
  •  .jar file.

Steps

  • To install Jdeveloper from jar file use the following steps.
  • First, open command prompt using administrator. To open command prompt using administrator ->
    • Search “Command Prompt” in window panel.
    • Now it will show command prompt in window. Right click on the Command Prompt option.
    • Select “Run as administrator”.
    • It will open command prompt.
    • Go to the java -> bin folder in command prompt. use following command. “cd <path of Bin folder where java.exe exists>” press enter.
  • Now Write following command to execute jar file and press enter. “Java –jar <filename.jar>”. Filename.jar is the path of jar file with name and extension of file. If you have any space in .jar file name and path, I’ll recommend you to remove that space from name and Path also. You can place that .jar to some other path.        
  • It will open the dialog box same as open by .exe file. Now all the steps are same as used in .exe file
  • If you have .exe file then double click on the exe file, an installer window will open and you can continue the steps same as jar file steps.





Click on next button


Set path for oracle home where it will install all files of Jdeveloper. Click on Next button.


Now, Installer is checking prerequisite. After it is 100%, Click on next button.


Screen is showing installation summary of Jdeveloper. Click on install button.


Now, it is installing the jdeveloper files. After completion of 100% it will enable the Next Button.
Click on Next button.


Select first option (Start Jdeveloper wih default Settings) as given below and Click on Finish button.
Now, Jdevleoper has been installed on your system. It will automatically open the Jdeveloper.


It will ask for the Role setting. Select Studio Developer (All Features) so that it will show all features in Jdeveloper. Don’t worry it will ask every time when you open Jdeveoper.
Click OK button and Now, It is ready for development.