Wednesday, May 14, 2008

Some facts About R12 OAF techstack

As Applications R12 is maturing and stabilising , we are seeing more and more R12 projects coming up. One prominent question I find very often on Oracle OAF forums as well as e mails, is there any change is relation of OA Framework components development and deployment in R12?? Here is list of some changes which you will come across while working on any R12 project:

1)Apache Jserv is upgraded to OC4J(Oracle Containers for Java) server in R12.

2)How to enable log in R12?Since there is no Jserv as in 11i, there is no more dependency on jserv.properties file for enabling of log.Here are the details how to enable log on R12:
In R12,
Goto $ORA_CONFIG_HOME/10.1.3/opmn/conf
take the backup of opmn.xml
edit opmn.xml for data id="java-options" and add the following:
-DAFLOG_ENABLED=true -DAFLOG_LEVEL=statement
-DAFLOG_MODULE=fnd%
-DAFLOG_FILENAME=/tmp/aflog.txt -Djbo.debugoutput=console


The log message should get written in,
$INST_TOP/logs/ora/10.1.3/opmn/oacore_default_group_1/oacorestd.out


3)How to add custom classpath in OC4J server classpath ?
Add an entry in,


$ORA_CONFIG_HOME/10.1.3/j2ee/oacore/application-deployments/oacore/orion-application.xml

< library path="..."/ >

prepending the existing library path.Modifying orion-application.xml works only if you manually go and modify it. But whenever we run autoconfig orion-application.xml is generated again and it does not have the custom jar files which we had specified.
In case you need to permanently add a custom classpath to the OC4J instances then you need to update the template file

$FND_TOP/admin/template/orion_application_xml_1013.tmp
There would be some set of entries with tags like
< library path="%s_oacore_prepend_classpath%" />
< library path="%s_javatop%" />
< library path="%s_af_jlib%/ojdigsig.zip" />
< library path="%s_oacore_append_classpath%" />
< library path="%s_weboh_oh%/j2ee/forms/applications/forms/formsweb/WEB-INF/lib/frmsrv.jar" />
< library path="%s_tools_oh%/forms/java/frmxlate.jar" />
< library path="%s_weboh_oh%/j2ee/oafm/applications/mapviewer/web/WEB-INF/lib/mvclient.jar" />




you can add your custom path like this after all the existing library path entires

where /abc/xyz/classpath.jar is the path for your custom libraries



4)Autocompilation setting of jsp files in R12.
In file
$INST_TOP/ora/10.1.3/j2ee/oacore/application-deployments/oacore/html/orion-web.xml

afterwards please restart apache
$ADMIN_SCRIPTS_HOME/adapcctl.sh stopall
$ADMIN_SCRIPTS_HOME/adapcctl.sh startall
now, whenever you change a character in your jsp, this will immediate reflect your output. In production environments this setting is not recommended.


4)Steps for Manual compilation of jsp in R12.
> cd $FND_TOP/patch/115/bin
> ojspCompile.pl --compile -s hello.jsp


5) Why R12 uses two Oracle homes in ?
There is an interesting article on Steven Chan's blog on this which explains y Oracle introduced 10.1.3 and 10.1.2 both in R12 Application server archietecture:
Why Use Two ORACLE_HOMEs for Release 12's Application Tier?


6)DBC file location in R12:
$INST_TOP/appl/fnd/12.0.0/secure

7)Bouncing OC4J server, for OAF to pick latest class and xml files.
In R12, there are two scripts which need to run to bounce the HTTP server and make OC4J container pick latest class files instead of one as in 11i, we only need to run adapcctl.sh shell script to bounce Apache Jserv.

Since in R12 Jserv is replaces by OC4J container, we need to run two scripts:
1)Script which is responsible for bouncing Oracle HTTP Server (powered by Apache).(adapcctl.sh)
2)Script which responsible for bouncing OC4J container (adoacorectl.sh)

So basically, here is the sequence of steps you need to do :
1)adapcctl.sh stop
2)adoacorectl.sh stop
3)adapcctl.sh start
4)adoacorectl.sh start
All these scripts are in $ADMIN_SCRIPTS_HOME

Monday, May 12, 2008

E-Business Suite Application Development Using Oracle Application Framework (OAF) and Application Development Framework (ADF

Latest Update of the much discussed topic on Oracle OA Technology Forum ... which techstack to use OAF or ADF till the time Oracle comes up with Fusion Release, is that Oracle has now released official guidelines for using which framework OAF/ADF while building your custom web application.This white paper is there on the metalink:
E-Business Suite Application Development Using Oracle Application Framework (OAF) and Application Development Framework (ADF) (Metalink Note 563047.1)

Saturday, April 5, 2008

Discussion for deploying ADF project in R12.

Hi all,
I recently had a interesting mail conversation with couple of senior guys of Oracle regarding Deployments of ADF project in R12.Here is the conversation:


Mukul---->Hi Steven, I have worked in both OAF , ADF Faces. I would like to know is it possible to deploy a standalone adf faces j2ee application in R12 OC4J server. If yes, can anybody on this blog provide a article/ metalink note regarding this! This is really important for R12 customers to know whether they can move their custom applications in ADF or not!


Steven Chan(Steven Chan, Sr. Director, Oracle Applications Technology Integration,Oracle)---->
Hi, Prabodh,
How are you making out with the whitepaper on this subject? Can you share any information with Mukul until its release?

Regards,
Steven

Probodh(From Oracle)---->
Hi Mukul,
As far as I know, this has not been tried out internally yet, but there is nothing technically preventing you from achieving deploying an ADF app within an EBS OC4J server. I've also cc'ed Shay Shmeltzer who is the Product Manager for ADF, and who might have come across customers who have already done this.



Shay Shmeltzer(Group Manager,Oracle Development Tools) --->

I also don't know if this has been tested.

That said - as long as the OC4J that is included with EBS is the same version as the public external one and the ADF Libraries are the same this should work.

Hence, in a nut shell deploying ADF project in R12 OC4J server has not yet been tried even in internal Oracle..! Actually I was facing some problem in deployment... anyways.... if I will get time.. will try this again and will let all know a common solution.

Regarding deployment of any ADF project in any standard j2ee server its pretty straight forward will put the screenshots for this soon with description!

Thursday, March 13, 2008

ADF : Hello World Page

Hi guys,
I am back for the much discussed topic on our OAF forum regarding ADF page creation and deployment .Without wasting much time lets see how to create a very basic Hello world page and in the next article i will discuss how to deploy it.

Step 1 : I hope you have downloaded Jdev, from the link I have mentioned in my last article.

Step 2: Setup Of Jdeveloper.
a)Unzip jdevstudio10133.zip
b)Click jdeveloper.exe inside the unzopped folder to start Jdev.
c)Create a DB connection with R12 instance.(Although not required since this is a hello world page) You don't need a dbc file for ADF project. You just need to have db credentials to create DB connection.


Step 3: Create a Application, see screenshots




Enter project name and location where you wanna make this project. We will use jdev directory to hold our projects, this is not mandatory, you can have any directory for the same.Enter following details:
Application Name: Mukul_ADF_SAMPLE
Directory name : (Jdev install dir)/jdev/(project name)
See screenshot below:



Step 3: Create projects for the Application created.
When you create an application it prompts for creating a project.We are creating a project with name "Model" in the application we created.




Now since , every application can be divided into MVC-- Model, View and Controller, we will make 2 projects.One project for Model(name--"Model") and one project for View and Controller(name--"ViewController").Here are the steps for creating ViewController project in the same application:







Basically our model project will contain all objects for the model layer, i.e BC4J layer, EO, VO, VL etc.Our viewController project will contain all web realted stuff and backing beans. The role of backing beans in ADF is somewhat similar to controller in OA Framework.
In this present example we need at all create the model project,because this is just a hello world page( we are not creating any BC4J object like EO,VO etc). I have created this just give a idea how do we work on a standard project, where there would be some Model layer objects.



STEP 4:Marking projects as dependent.
Now... as I explained that one project contains all model related stuff(Model) and one project for view and controller(ViewController),so, basically we need to tell application that our view and Controller project is depedent on Model project for all data bindings. This can be done declaratively through Jdeveloper.
Right click on ViewController project and click on "project properties":



Select "Dependencies" node and click tick on "Model.jpr", as shown in screenshot below:

This will in turn update web.xml and tell project the ViewController project components are based on Model project.

STEP 5:Creating faces-config.xml
I guess the step heading sounds quite difficult.... :), like we need to write a faces-config.xml. I hope you must thank to Jdev where most of your xml code is generated through wizards.Ok, so basically this xml file holds the flow diagram of the application.Entirely different from OA Framework, ADF provides a very lucid and effective flow mechanism.Lets see how?
Right click on your ViewController project and select new... and follow as shown in screenshots to create faces-config.xml file.









STEP 6:Defining Pages and flow.
In the component pallete for faces-config.xml you can see items like jsf page, note etc, jsf navigation case etc. They signify exactly what there name signifies. We will do the follwoing:
1)Drag Note from pallete to our diagram. The purpose of note, is to make a heading or notes in the diagram.Click in the note after u have dragged it in diagram and type"Flow diagram of project".



2)Drag a JSF page into the diagram. You would be "a yellow exclamation mark on page diagram", this basically signifies that this project is still not created,so, that user should remember the which pages in the flow diagram are not created yet.



Click untitled.jspx and edit it as /apps/HelloWorldPG.jspx.



Since, in my example I am just showing one page with hello world we don't need more pages. Still, to give you a idea, we will create one more page to show how we make navigation.Hence darg one more jsf page and edit its name as shown in screenshot.



3)Now to make navigation case from helloworld page to search page, click jsf navigation in component pallette, now click on helloworld page and extending the line click on search page.You would see following screenshot:



This diagram basically tells that any action/ost event occured on helloworld page with action name "success", will forward the flow to search page. We will change name of action from "success" to"search", this is just for appropriate name puprose, you can keep any action name like xyz.



4) Now in this step we will actually create the page.Double click hello world page in the faces-config.xml diagram, you would see following screenshot:



Make sure that select jspx document and click next...



Select "Automatically Expose UI Component in new Managed Bean", this is like your controller, you want to create or not. Although we won't need this in our hello world page, but just creating this to give you an idea what this file contains. By selecting this option in wizard, any UI bean attached to page, its getters/setters are automatically exposed in your backing bean class. Edit the backing bean name as shown:



In the next screen select following libraries:
1)ADF Faces Components
2)ADF Faces HTML
3)JSF Core
4)JSF HTML

Press finish.You would see following screenshot on finishing this in Application Navigator:



You can click pkg viewcontroller.backing.apps and see the backing bean class.It will contain getters/setters for all the beans in the page.Also, every new bean you add to page, is automatically added in this class. This class will contain all controller logic and will be used to invoke any method in AM. But method here to access AM is a little different than from AM, due to fundamental differences in techstack.
Also like the methods process request and process form request, we can customise lifecycle of a JSF page, but, here its all a bit different. All these facts can be fould in ADF developer guide, I am not explaining each and every fact here, to make this article short and crisp.Main purpose of this article is to give you start with ADF, rest depends on individual effort.

STEP 7:Page UI creation.
Extend all nodes in structure window of HelloWorldPG and click h:form. In the Component pallete select "ADF Faces Core".



Drag the scrollbar down in component pallete and select PanelPage and drag and drop this mouse to h:form, here are the screenshots, how it will look like:



"PanelPage" can be considered as pagelayout region in OAF, basic page layout with header and footer. Typically every page would have this, and all regions and otems will be child of this.One feature of Jdev is that as soon as you drag and drop any item from component pallete to structure of page, you can immediately see its look and feel on the page. This nis very essential from the point of development, as you would not everytime run the page and see that what your UI look like.

Now we can edit the title of page to Hello world from property inspector as shown in figure



STEP 7:Run The page.
We are done with our hello world page. You can right click the HelloWorldPage.jspx file and click run, a new browser window will open and your page will something like:



This finishes creation of Hello world page in ADF.... and I hope this article will give u an idea of ADF to self start it. In the next article will discuss how to deploy it.You can go through ADF developers' guide and learn fundamentals.

Thursday, February 21, 2008

The Next BIG thing ADF Faces: Getting the comfort level in comparison to OAF.

Hi all.... starting with new interesting article... after I have returned from my Vaishnodevi Trip!I was thinking of writing this article from quite a some time, but was busy with various things, as I recently moved back to Delhi!

Ok, I think lets' start, as we all know Oracle Fusion techstack includes ADF faces for all web related development, I think this is the best time to optimize your skillset to ADF faces and Bpel.ADF is an extensive J2EE framework, which is
documented as well as used for two category of programmers:

1)Developers from J2EE background,i.e. people having knowldge of JSF,STRUTS,JAVASCRIPT,SWING,TOPLINKS,EJBs etc,

2)Developers from Forms background,i.e. the best suited guys are the OAF guys, who already have exposure to BC4J.Basically this category of developers, as they work on this framework, they gradually learn more and more standard J2EE technologies gradually.

In this article, I have typically covered approach for OAF developers, who I assume have a good exposure to core Java and BC4J, but have not worked/have knowledge of toplinks, ejbs',struts etc.

Here is the list of downloads, you would need to have to start with ADF Faces on your laptop/computer:

1)JDEVELOPER 10G (Download Oracle JDeveloper (10.1.3.3))
Oracle JDeveloper(10.1.3.3)

2)ADF Faces guide for forms developers (Download Developer's Guide for Forms/4GL Developers pdf version)
Download Developer's Guide for Forms/4GL Developers

3)Database server(This you would require to download, if you don't have a database server, and your working on your home pc/laptop.Download Oracle Database 10g Express Edition (Western European) )
Oracle Database 10g Express Edition

Similarities between OAF and ADF
Both OAF and ADF follow industry best pratices i.e. MVC standard(Model-View-Controller), for people who still don't have a fundamental understanding of MVC, i would suggest reading:
Article On Web-Tier Application Framework Design
Here are MVC layers of both:

OAF
--------
Model : All BC4J Component classes like AM,EO,VO,VL etc.
View : UIX
Controller : CO classes.

ADF
-----
Model : All BC4J Component classes like AM,EO,VO,VL etc.
View : JSF JSPs, in simple terms file with extension .jspx
Controller : Backing bean classes.

As we see above Model layer is same for both i.e. BC4J, hence OAF developers, have a added advantage since, working with OAF, they already have sound knowledge of this. Next comes the view layer thats changed from UIX to JSF.One major problem with UIX in OAF is that UI is not very extensive, in the sense that there are many limitations on UI front , while if you take JSF, its a Sun's standard j2ee technology where you can have all web features integrated and is also flexible enough to integrate UIs from other technologies.... like industry popular Flex, flash etc.Jsf is capable enough to deliver most complex and extensive UIs.

Now, as in OAF,most of the UI development is done through drag and drop and wizards in Jdeveloper(Or even if the page is dynamic you would write java code for adding various UIX beans to pagelayout region), hence, even if you don't have any knowledge/limited knowledge of xml and UIX, then also you can work with ease,because Jdeveloper generates the xml for you.The same is in the case of ADF, most(not all) UI development is done through wizards and drag-drop functionality in Jdeveloper.You only need to have bean level knowledge, similar to OAF.

The last layer, i.e. the controller layer is quite similar to what we code in CO classes in OAF, typically every page where you need to put event logic, you would need to attach a backing bean class to that jspx page. This can be automatically done through wizard in Jdeveloper.The backing bean class typically contain getter/setter methods of all beans in the page, so you can add your custom event methods to this class which will be attached to UI through EL.

I think by now you would have developed some comfort level with ADF! One stunning feature of ADF are the flow diagrams, like in OAF to redirect to diffent page you use vaious page forward apis' in pageContext class.In ADF, you can design the whole flow in flow-diagram, which is a completely drag and drop feature of Jdeveloper ad then attach it with action of any bean say a "command button", on whose submission you want to redirect the flow.

To start with example, Oracle provides a fantastic tutorial called SRDEMO. You can run it on your Jdev, read the guide and get aquittaned with ADF.

Recently, there was a discussion on "OAF Forum" regarding "Can ADF Faces/ADF BC aplications developed on Jdeveloper 10g can be deployed on Apps 11i?".
Here is the Steven Chan's blog comments link which gives you the answer:
Read last question on this link.

He basically says "The E-Business Suite 11.5.10.2 uses Oracle9i Application Server 1.0.2.2.2 as its application tier server. You cannot use this to run externally-developed applications.

I would recommend running your custom application on an external Oracle Application Server 10g instance.
"

Another point is pointed by Tapash for Apache Jserv application server used in Oracle Apps 11i, he says "Apache JServ module , QApache are servers built at oracle not totally open sourced, so these are not pure J2EE servers, although you can run some J2EE components like jsps/servlets/EJBs, but these servers dont have containers for all J2EE components.". So, i would say Apache name is misleading, because Apache.org things immediately flicks my mind saying open source :)!

Hence, for Apps 11i version ADF faces can't be atleast in straight forward way be deployed. If you are using Apps 11i version , you should use external J2ee compliant server, like Apache Tomcat,OC4J etc. for hosting your ADF Faces/ ADF BC application.
This is not the case with Apps R12, which is a j2ee compliant server, hence you can deploy all ur ADF faces applications on the same application server.This is because of the fact Oracle has moved to OC4J application server with R12.


I hope I am able to give some picture of vast ADF to OAF developer community through this article!I will soon write another article of making a sample page in ADF and integrating it with OAF/JTT/JTF pages in Apps.

Friday, December 28, 2007

Passing pl/sql table to Java using Oracle JDBC and vice - versa

While replying several threads on OA Forums(http://forums.oracle.com/forums/forum.jspa?forumID=210), I have seen couple of threads where developers have a requirement to pass a pl/sql table to OA Framework Page and vice-versa.Even if people copy paste this code from google. oracle or other available sources, they are not sure what actually they are doing!
Actually the best practice for such a requirement is to use Rosetta to generate class file for the particular pl/sql pkg.But the point is Rosetta is Oracle's internal tool and Oracle does not ship it to customers.Then also,I have seen it to be used in consulting industry, very often, i don't know how :)!But if u don't have rosetta, u don't have an option that to go with jdbc, which is anyways base of Oracle and Java bridge.When talking of JDBC, there is two set of JDBC classes popular in market, one from SUN(Founder of Java)and Oracle.Oracle jdbc wrapper classes are better in the sense, that they are flexible enough to cater almost all pl/sql objects.
Ok, so if you are not using Rosetta, then how would u pass pl/sql table to Java using Oracle JDBC and vice - versa?Recently was helping a friend in this code, had to some struggle for this code , so thought to put it on my blog, so that would help other developers with similar requirement.

So, lets start:
Read comments carefully to understand the code

1)Define Object with the same structure as your table of records u need to use in ur pl/sql procedureof some pkg.Remember define it as global object type and not inside package specification, because in that case our jdbc code would not be to find this object type.
/******************************************************************************/
/*The Script used to create Object type in this example is as follows:*******/
/******************************************************************************/
create or replace type rectype as object(col1 varchar2(10),col2 Date,col3 Number);



2)Define table of object u have defined above which u need to use in ur pl/sql procedure of some pkg.Remember define it as global table type and not inside package specification, because in that case our jdbc code would not be to find this object type.
/******************************************************************************/
/*The Script used to create table of Object type is as follows:*******/
/******************************************************************************/
create or replace type rectab as table of rectype;


3)Defining package specification and procedure definition
/*********************************************************************************/
/*The Script used to create package specification in this eg.is as follows:*******/
/******************************************************************************/

create or replace package ioStructArray as
procedure testproc(iorec in rectab,orec out rectab);
end ioStructArray;
/



4)Defining package body and procedure
/*********************************************************************************/
/*The Script used to create package specification in this eg.is as follows:*******/
/******************************************************************************/
create or replace package body ioStructArray as
procedure testproc(iorec in rectab,orec out rectab) is
begin
/*see how to loop and assign values*/
for i in 1..iorec.count loop
iorec(i).col1 := orec(i).col2;
iorec(i).col2 := orec(i).col1;
end loop;
end testproc;
end ioStructArray;
/

5)Getting connection object in JDBC Code :
//Getting db connection in a jdbc
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
// Connect to the database
Connection conn=DriverManager.getConnection ("jdbc:oracle:oci8:@S692815.WORLD",
"scott", "tiger");



6)If writing in AM in OAF page, code to get connection:
OADBTransactionImpl oadbtransactionimpl = (OADBTransactionImpl)getOADBTransaction();
OracleConnection conn = (OracleConnection)oadbtransactionimpl.getJdbcConnection();

7)Lets, consider a simple scenario where we have a XXVO in AM and I have to pass all VO rows data to the pl/sql procedure we just created and then receieve a table of data back and then based on it values do something in AM.Here is the Code:
//imports
import oracle.sql.*;
import oracle.jdbc.driver.OracleConnection;
import oracle.jdbc.driver.OracleCallableStatement;
import oracle.apps.fnd.framework.server.OADBTransaction;
import oracle.apps.fnd.framework.server.OADBTransactionImpl;

Public void arryToPLSQL()
{
//Getting Db connection
OADBTransactionImpl oadbtransactionimpl = (OADBTransactionImpl)getOADBTransaction();
OracleConnection conn = (OracleConnection)oadbtransactionimpl.getJdbcConnection();

//Defining variables

//oracle.sql.ARRAY we will use as out parameter from the package
//and will store pl/sql table
ARRAY message_display = null;

//ArrayList to store object of type struct
ArrayList arow= new ArrayList();

//StructDescriptor >> use to describe pl/sql object
//type in java.
StructDescriptor voRowStruct = null;

//ArrayDescriptor >> Use to describe pl/sql table
//as Array of objects in java
ArrayDescriptor arrydesc = null;

//Input array to pl/sql procedure
ARRAY p_message_list = null;

//Oracle callable statement used to execute procedure
OracleCallableStatement cStmt=null;

try
{
//initializing object types in java.
voRowStruct = StructDescriptor.createDescriptor("RECTYPE",conn);
arrydesc = ArrayDescriptor.createDescriptor("RECTAB",conn);
}

catch (Exception e)
{
throw OAException.wrapperException(e);
}

for(XXVORowImpl row = (XXVORowImpl)XXVO.first();
row!=null;
row = (XXVORowImpl)XXVO.next())
{
//We have made this method to create struct arraylist
// from which we will make ARRAY
//the reason being in java ARRAY length cannot be dynamic
//see the method defination below.
populateObjectArraylist(row,voRowStruct,arow);
}

//make array from arraylist
STRUCT [] obRows= new STRUCT[arow.size()];
for(int i=0;i < arow.size();i++)
{
obRows[i]=(STRUCT)arow.get(i);
}

try
{
p_message_list = new ARRAY(arrydesc,conn,obRows);
}
catch (Exception e)
{
throw OAException.wrapperException(e);
}

//jdbc code to execute pl/sql procedure
try
{
cStmt
=(OracleCallableStatement)conn.prepareCall("{CALL ioStructArray.testproc(:1,:2)}");
cStmt.setArray(1,p_message_list);
cStmt.registerOutParameter(2,OracleTypes.ARRAY,"RECTAB");
cStmt.execute();

//getting Array back
message_display = cStmt.getARRAY(2);
//Getting sql data types in oracle.sql.datum array
//which will typecast the object types
Datum[] arrMessage = message_display.getOracleArray();

//getting data and printing it
for (int i = 0; i < arrMessage.length; i++)
{
oracle.sql.STRUCT os = (oracle.sql.STRUCT)arrMessage[i];
Object[] a = os.getAttributes();
System.out.println("a [0 ] >>attribute1=" + a[0]);
System.out.println("a [1 ] >>attribute2=" + a[1]);
System.out.println("a [2 ] >>attribute3=" + a[2]);
//You can typecast back these objects to java object type


}

}
catch (Exception e1)
{
throw OAException.wrapperException(e1);
}
}



/*Our custom method which will populate
arraylist with struct object type
*/
public void populateObjectArraylist( XXVORowImpl row,StructDescriptor voRowStruct , ArrayList arow)
{
Object[] attribMessage = new Object[3];
String attr1 = null;
Date attr2 = null;
Number attr3 = null;

//Get value from Vo row and put in attr1,att2 and attr 3

//Putting values in object array
attribMessage[0]=attr1;
attribMessage[1]=attr2;
attribMessage[2]=attr3;

try
{
STRUCT loadedStructTime = new STRUCT(voRowStruct, conn, attribMessage);
arow.add(loadedStructTime);
}
catch (Exception e)
{
}

}

So, i hope every step is clear in the above code. I hope it helps all OAF developer community.Special Thanks to Pooja Arora for her contribution and constantly bugging me to fix this!

Sunday, December 16, 2007

PPR-- An insight !

PPR or Partial Page Rendering is one of the most attractive feature put up by Oracle in 11.5.10 release of Oracle Apps, or OA Famework.
Although most of OAF developer community use this feature, i think very few would have idea, how excatly it works in UIX.PPR uses Ajax kind of design and hence very attractive to use, because it can put dynamic features in various UIX beans, without the use of any client side script like javascript, which is otherwise a integral part of any web application. PPR events are very fast as they refresh only a particular region or protion of page and no the entire page.

Developers that want to add such behaviors to their web pages are often faced with a difficult decision. All of these actions can be implemented using a very simple solution: by refreshing the entire page in response to the user interaction. However easy, this solution is not always desirable. The full page refresh can be slow, giving the user the impression that the application is unresponsive. Another option is to implement such actions using JavaScript (or other client-side scripting technologies). This results in faster response times, at the expense of more complex, less portable code. JavaScript may be a good choice for simple actions, such as updating an image. However, for more complicated actions, such as scrolling through data in a table, writing custom JavaScript code can be a very challenging undertaking.

Oracle UIX provides another solution which avoids some of the drawbacks of the full page refresh and custom JavaScript solutions: partial page rendering (or PPR for short). The UIX partial page rendering functionality provides the ability to re-render a limited portion of a page. As in the full page render solution, PPR sends a request back to the application on the middle-tier to fetch the new contents. However, when PPR is used to update the page, only the modified contents are sent back to the browser. UIX automatically merges the new contents back into the web page. The end result is that the page is updated without custom JavaScript code, and without the loss of context that typically occurs with a full page refresh.

How Partial Page Rendering Works
The partial page rendering process breaks down into three main areas: the partial page event, the partial page rendering pass, and the partial page replacement.

The partial page event is the request that the browser sends to the application to request new contents. Partial page events are very similar to their full page event equivalents. For example, when the user navigates to a new record set in a table bean, a goto event with a value event parameter is sent to the application regardless of whether the event is a partial or full page event. There are two important differences between partial and full page events. First, partial page events specify partial page rendering-specific event parameters which are not present on the full page event equivalents. For example, partial page events may include an event parameter which identifies the set of nodes that should be re-rendered (referred to as "partial targets"). The second difference between partial page events an full page events is how the events are sent.

Unlike full page events, partial page events must be sent in a way which does not force the browser to reload the current page. To implement this capability, UIX partial page rendering uses a hidden inline frame (iframe) as a communication channel between the browser and the web application running on the middle-tier. Partial page events are sent by forcing a navigation in the hidden iframe, which in turn causes a request to be sent to the application on the middle-tier. Since the iframe is hidden, the process of sending a partial page event and rendering partial page contents can take place behind the scenes, without discarding the contents of the current page.

When the partial page event is received by the application, the application responds by determining the set of partial targets to render and performing the partial page rendering pass. The partial page rendering pass is similar to a full page rendering pass. In both cases, the UINode tree is traversed by calling render() on each node in the tree. However, in the partial page rendering case, only the contents generated by the partial targets are actually sent back to the browser. All other contents are dropped. So, although the scope of a partial page rendering pass and full page rendering pass are similar in the number of UINodes that are rendered, the partial page response is generally much smaller, since only the modified contents are sent back to the browser.

The final part of the PPR process is the partial page replacement. When the browser receives the partial page response, the new contents for each partial target node are copied from the hidden iframe into the main browser window, replacing the existing contents for each target node. So, for example, in the table navigation case, rather than replacing the entire page, just the contents of the table itself are replaced. The browser reflows in response to the modifications, displaying the new contents to the user without fully re-rendering the entire page.

To recap, the sequence of steps which occur during a partial page render are:

The initial page is rendered.
The user performs some action which triggers a partial page render, for example clicking on a link or button.
JavaScript event handlers provided by UIX force a navigation in a hidden iframe.
The partial page event is sent to the application.
The application determines whether the request is a partial page event and which partial target nodes to re-render.
The partial page rendering pass is performed.
The contents of the partial target nodes are sent back to the iframe in the browser.
The partial page replacement is performed, at which point the new contents are copied from the iframe into the main browser window.
The browser re-flows and displays the new content to the end user.
Note that the partial page rendering process requires no custom JavaScript code.
(The source of this article is Oracle UIX documentation.)