Login
Register

Home

Trainings

Fusion Blog

EBS Blog

Authors

CONTACT US

OA Framework - All Articles
  • Register

Oracle Gold Partners, our very popular training packages, training schedule is listed here
Designed by Five Star Rated Oracle Press Authors & Oracle ACE's.

webinar new

Search Courses

You will often hear a sentence "extension to the controller is not safe."

In this article, lets discuss why such extension is unsafe, and what steps can we take to make the extension to the OA Framework controller as safe as possible.


Controller Extension in OA Framework is safe or unsafe ?

 

In this article, lets discuss why such extension is unsafe, and what steps can we take to make the extension to the OA Framework controller as safe as possible.



Lets do some Q & A

How do we extend the controller?

1. Create a new class file which extends the original controller's java class

2. Using personalization, personalize the region to which controller is attached.

Once in personalization screen for the region, replace the existing controller with your newly created extended controller.

For detailed step by step explanation, please refer to this link

 

Controller can be extended at any of the levels at which personalization can be done. Unlike substitutions to BC4J, extension to controller does not necessarily need to happen at site level. What I mean is that, one responsibility can be personalized to use controller class say CO1 and the second responsibility can be configured to use controller class named CO2 (both for the same region/screen)



Why is the Controller extension unsafe?

Two reasons:-

Point 1. If in your extended CO class, you write a method named processRequest, then framework will execute this method in your custom class. Framework will not execute the method in original controller class.

 

Point 2. In Oracle Fusion Applications, the User Interface layer will certainly change, and controller may not exist in FUSION in same manner as we see it now. Hence you may have to re-develop/design your extension to controller in equivalent technology in Fusion Apps [ADF with Faces].



What can we do to make the controller extension safe?

Whilst we can't do much about the "Point 2", but we can certainly play safe on "Point 1".



If in your extended controller, you call super() method, then there is a possibility that your extension is safe.

Your extended controller should

    1. Call standard controller method(from original CO)

2. Do additional bits after or before calling the super()

If oracle delivers a patch that modifies the code in original CO, yet your extension will still be upgrade safe, as your custom controller will continue to call current version of CO method via super().



If "Point 1" is taken care of, will my extension be 100% safe?

It will certainly be upgrade safe until Fusion, but upgrade-safe is different than safe extension.

For example, if you have five screens in  a transaction, and if in your extension you make navigational jump to last screen straight from first screen, then your extension may be flawed, despite being upgrade safe. Never compromise the Data Integrity in your extensions.



Moral of the story

There is no one size fits all when it comes to extension of controllers in OA Framework. Try to adhere to the principle of calling super(), to keep your controller extensions upgrade safe.



Fusion will bring a new paradigm to UI design in Oracle Self Service. However, mapping your Controller extensions into ADF framework should be straightforward.

 


Anil Passi

Comments   

0 #1 lakshmi 2007-06-06 00:00
Please can u give one example for super()
Quote
0 #2 Suresh 2007-06-15 00:00
Hi Anil,
Thanks for all the helpful documents available on this site. This is really helpful for all the Oracle Apps Tech & Func Consultants.

I need your inputs for an issue i face in OA Framework - In my OAF page i am displaying a DFF where the user would create a new record and i have to save it to a database table through oracle standard APIs. Do you know how can i get the values from the OAF page and send it to the database? Please do give me sample code if you have one.

Thanks, Suresh.
Quote
0 #3 MANIKANDAN 2007-06-20 00:00
Hi anil,
This is manikandan.i am studying myself with helf of ur sites.
i installed OAF software while run the program i got standard error like system responsibility could not find.
Please tell me the steps to fix the error.
please send me if you have any set up documents and also i need very basic steps in OAF to develop one page



Tha nks
M.Manikand an
Quote
0 #4 Anil Passi 2007-06-20 00:00
Hi M Manik
Please copy paste exact error from stack.
Also, under runtime connection in Project Setting, what is your value for Responsibility and application?

Is that valid for the user specified?
Tha nks
Anil
Quote
0 #5 zamora 2007-09-04 11:59
hi Anil,

all ur works are great.
I would like to know, where you hosting your web site, (this pages).
is it free, I would appreciate , if you could give some details.
Quote
0 #6 zamora 2007-09-05 07:01
hi Anil,

all ur works are great.
I would like to know, where you hosting your web site, (this pages).
is it free, I would appreciate , if you could give some details.
Quote
0 #7 kritika 2009-05-21 11:14
AFTER extension and personalization the page is not reflecting the changes please help.

In personalization it shows the extended co.

Kritika
Quote
0 #8 Anil Passi 2009-05-22 01:22
Hi K

Please debug this using option 2 in article
http://apps2fusion.com/apps/oa-framework/187-debugging-oa-framework-7-different-techniques


Thanks
Anil
Quote
0 #9 kritika 2009-05-22 02:31
Hi anil

Thanks for the reply.

I have to test it on local company instance not on local machine jdeveloper before doing on client instance.
Can't use debugging tools.

And even the files that i imported from server are not running very fine. Means i am not able to go to personalize link on local machine. So i tested it on local instance.

I tried bouncing the server and deploying JPX file also at local instance


Doubts:

1. Do CO extension needs JPX importer step?? (still i did it)

Problem still persist. Basic problem is even after the co for the class is changed it doesnot picks up the new code...

Obviou sly new class is extending the previous one but code thats changed should b picked from this.

If i am wrong some where please correct me.

2. My new class extends the previous one and both have processformrequ est and procesrequest.
So its picking the code from the old classes function??

3. If this is the problem wat should i do...if not then where exactly i need to modify.

(For CO extension i read that " replace the whole code edit it in your extended class as per requirement. still it extends the previos one" I have done this)


Regards
K.Kritika
Quote
0 #10 Anil Passi 2009-05-22 02:58
hi K

In that case, you should display debug messages using writediagnostic s and then use option Show Log on Screen to see the debug
Are you using R12 or 11i
The oc4j/Apache has to be bounced each time you make change to java files on server

1. Do CO extension needs JPX importer step?? (still i did it)
ANSWER- No, jpx import is only required for BC4J object extension

2. What does about this page say? Does it show your custom controller
Afte r the co for the class is changed it doesnot picks up the new code...
Have you bounced apache?
If on R12, then bounce oc4j for changes to take effect


3. My new class extends the previous one and both have processformrequ est and procesrequest.
So its picking the code from the old classes function??
ANSW ER - are you calling SUPER() ?
You do not always need to copy past the code from decompiled class
In this case, you can put your if condition for button click before the super is called

Also - please raise on http://apps2fusion.com/forums, which is monitored by various experts, and it allows screenshots to be attached

THank s,
Anil
Quote
0 #11 kritika 2009-05-22 03:20
Hi anil

Thanks for the reply.

Yes i bounced the appache server. I am working on r11i only.


About page is displaying the name of the new class. (Extended one which has the new code)

I tried to call super.processre quest after the condition.

Its giving NULL pointer exception.

In java we use to make base class function virtual to acces the dirived ones.
I guess we cant touch the standard controller in my case.
Is der any thing i can do in my new class so that new code gets excecuted rather than old one?

Kritika
Quote
0 #12 kritika 2009-05-22 03:50
I am stuck with NULL Pointer exception.

I even tried not to extend the previous class as code is totally repeated in this.
Still null pointer exception is coming.

I have deleted the part which is not required from the existing code only if condition is der still
Null pointer exception is der if i call super afterwards.

No w if super is before condition it goes to base classezs function,

Krit ika
Quote
0 #13 kritika 2009-05-22 07:54
HI anil,


I have made custom class without extending and subtitued in a new package.

and in personalization of page i gave that address.
For time being it working fine as the new class has all the code( I got the code using jcompiler:D)

T he solution is time being for the demo i need to still extend the original class only.

Thanks a lot for ur help.

Kritika
Quote
0 #14 kritika 2009-05-27 12:10
Hi anil,

I just want to share that extending controller is working fine
(I really dnt knw wat made the difference n y it was not working that day.
Next day i just recreated a customized package did everything again n it was working fine..)

Declar ing super after customized code made every thing worked....
Than ks a lot..

Kritika
Quote
0 #15 Anil Passi 2009-05-27 15:02
Very well done K.
If you want the custom logic to kick-in even before standard code fires, then you must place your custom code prior to super()

Also, it is best to raise your extensions issues on http://apps2fusion.com/forums

Thanks,
Anil Passi
Quote
0 #16 kritika 2009-06-02 10:21
HI anil,

The work is related to isupplier responsibility.
In the i-supplier responsibility when we create an ASN.(add header quantity , Shipment lines)
then we click on Submitt button.
This button moves to a conformation page.
Now we need to move to summary page of that asn.

Directly we can go to summary page through

View/C ancelASn---> Clicck on any asn-->summar y page.

Problems :

1. After extending co the page is visible but functionality(c ancel shipment button) of the page is not working.
2. I am passing shipment number asn type and vendor id and vendorsite id...
vendor id and vendor siteid are comming as null.
(vendor id and vendor site id and header id these are not avialable at page level but are in VO.)

Regards
k .Kritika
Quote
0 #17 kritika 2009-06-02 13:11
Hi Anil,
on the client instance i have extended the controller class and have made changes in ProcessFormRequ est
method.
but it is giving "Java null pointer exception" on the SubTableLayoutb ean which is also present in standard
functi onality.
here is the xcat line which z givin error


if(oapagecontex t.getParameter( "SubmitBtn") != null)
{
if(oasubtablayoutbean.getSelectedIndex(oapagecontext) == 1)
{
Quote
0 #18 Teresa 2011-05-13 20:13
Hi Anil,

Before loading the extended controller to the server, how can I run it from my JDeveloper to ensure the logic and everything else are correct. Can I get the associated OAF page or region from the database and plug it in "myprojects" folder in Jdev and run that page from JDeveloper? Thank you very much.

Regards,
Teresa
Quote
0 #19 Sabeena Begum 2011-09-23 08:54
Hi Anil,

Useful Article.
Normally,
Am doing Controller Extension for the seeded controller class using the method super.ProcessRe quest() say for the customer creation Page in R12.
After CO extension and personalizing the page, itis working fine now.
I have a question as if a patch is applied for the upgradation, will the extended Controller gets affect?
The standard CO reflects or our extended CO reflects the same in Page?
Quote

Add comment


Security code
Refresh

Search Trainings

Fully verifiable testimonials

Apps2Fusion - Event List

<<  Apr 2024  >>
 Mon  Tue  Wed  Thu  Fri  Sat  Sun 
  1  2  3  4  5  6  7
  8  91011121314
15161718192021
22232425262728
2930     

Enquire For Training

Fusion Training Packages

Get Email Updates


Powered by Google FeedBurner