Site navigation (main menu).

Blog

Read-only Pages in OA Framework

The problem

Recently I was working with one of Prōject’s Functional Consultants who was suffering from “Personalisation Overload”.

She had created a copy of the standard Projects Super User responsibility and was attempting to make some of the screens read-only using OA Framework’s Personalisation features. Whilst I am a big fan of using Personalisations, the Functional Consultant had a big job on her hands, especially with screens that have a large number of items to personalise.

A good example of of a multi-tab page that she needed to make read-only was the Task Details screen:

  Task Details Screen (Schedule)

I thought that I would have a look and see whether there was some way that I could make life easier for her.

The investigation

First I thought I would have a look and see what she was doing to set screen items to read-only. Here you can see the Personalise screen for the Task Number item and the effect of changing the Read Only attribute to true:

Personalise Task Number  Task Details Screen with Task Number set View-only

Whilst this obviously works, it was going to take a very long time to set all the items to read only. A better solution would be to use the Personalisation Framework to extend the Page’s Controller class to loop over all of the screen items (or “Web Beans”) and programmatically set them to read-only. Using the About Page I found out that the Page is /oracle/apps/pa/structure/webui/StructTaskDetPG and the highest level Controller class is oracle.apps.pa.structure.webui.TaskDetailsLayoutCO:

About Page for Task Details screen

The solution

Whilst trawling through some of the Oracle-supplied OA Framework classes I had come across a handy utility method that did exactly what I wanted: given a starting Web Bean it recursively travelled over the whole Web Bean hierarchy from that point, setting the Read Only attribute of any items that could be set to read-only. Rather handily, it also changes the relevant style of the items so that the user is given the correct visual feedback to imply that the item is read only.

However, this method was not a published public method, so I decided that it would be better to take a copy and put it into my own library. As it happens, over the last few years I have been building up a small library of OA Framework classes designed to make OAF development easier and more efficient. This libarry is called the OA Framework Toolkit; it is open source and can be downloaded from SourceForge. The OAF Toolkit has classes for all different aspects of OAF development; this particular method I added to the WebBeanUtil class in the com.oaframework.toolkit.util package:

OA Framework Toolkit

To call the setViewOnlyRecursive method I would need to extend the Controller class. In JDeveloper, I created a new Project and then used the New Class… dialog to create a skeleton Class following Oracle’s Naming Conventions. The most important step was to select oracle.apps.pa.structure.webui.TaskDetailsLayoutCO to extend from:

Starting the New Class dialog  

The New Class dialog  The Extends dialog

The Skeleton class

JDeveloper provides a rather handy Override Methods wizard that is very useful when you are extending an existing Class:

Starting the Override Methods wizard  The Override Methods wizard

ProcessRequest has been overridden  Class now tidied-up

After using the override Wizard I tidied up the code to make it meet Oracle’s Naming Conventions. Now I was able to add my call to the setViewOnlyRecursive method:

Adding the "import"  Adding the method call

As you can see, this has compiled successfully in my local JDeveloper, but to use it the Java source needs to be copied to the Application Server and compiled there. I copied to file to $JAVA_TOP/xxprj/apps/oracle/pa/structure/webui and used javac to compile it.

So, we have a compiled class on the server, but we need to ask the Personalisation Framework to use my class instead of the standard one. Using the Personalise screen I changed the Controller Class attribute at Responsibility level:

Personalise Task Details Page Layout  Setting the Controller Class attribute

When you return to the Application, all of the data entry widgets are now read-only:

All widgets now read-only

All the Functional Consultant then had to do was hide any buttons or links that performed some sort of action, such as the Actions poplist and Go button.

Caveat

Many OAF screens have Controller classes attached to Web Beans at lower levels of the hierarchy and sometimes these Controllers change the read-only attributes of their items. This actually happens on the Schedule tab of the Task Details screen:

Schedule tab after setViewOnlyRecursive

In this case you can see that the Controller for the Current Schedule region enables or disables the date items, depending on various business rules. To overcome this, I just had to extend this region’s Controller (oracle.apps.pa.structure.webui.TaskDetDatesCO) in exactly the same way as before.

30 Oct, 2012 by

E-Business Suite | Technical discussion

One thought on: “Read-only Pages in OA Framework”

  1. kumar January 24, 2013 11:18 AM

    Its really useful for me
    Thank u very much

    Regards
    kumar

Comments are now closed... Please contact us if you have any queries.