الثلاثاء، 7 أبريل 2020

OAF – Read Only Application

Why Read Only?
When we develop an application, the end users query for information, edit, update and do a lot of other things. But we often face the requirement to restrict a set of users to a limited functionalities. Let’s say the user can only view the UI for verification or for an audit.
Think of a quote which can be created or updated by a sales team. There is also a service team which can merely verify an existing quote, he is not allowed to update the quote.
Assuming we have developed an application using OAF JDeveloper, we will see how we can make it read only for a responsibility so that we can assign it to a set of users.
Our Approach
  1. First, we will create a profile and set it to ‘Y’ for a responsibility which has only read only access.
  2. We will create a java class with a method to recursively change the render and read only properties of WebBeans.
  3. Will invoke the java class method from the process request of different controllers in the application.
Example
  1. Create a profile with ‘Y/N’ values.
ro1
Set it to ‘Y’ for the read only responsibility.
ro2
  1. Create a java class in the OAF application navigator.
ro3
Lets name it: CLQotRenderUtil.
ro4
We can use the code in the attached file for reference.
  1. Lets open the Controller in JDeveloper and paste the following code in the ProcessRequest.
String readonly_profile_value = paramOAPageContext.getProfile(“ASO_NEW_QUOTE_SECURITY”);
if (readonly_profile_value.equalsIgnoreCase(“Y”.toString()))
{
CLQotRenderUtil.setViewOnlyRecursive(paramOAPageContext, paramOAWebBean);
}
ro5
Now, if we open the page in the application using the readonly responsibility, the buttons, dropdowns, etc would not be appearing or appear readonly as per the coding in the util file. The util file is easy to understand, so we can edit it to meet our requirements. Also, please note that the profile we created can be set ‘Yes’ for any responsibility which we are planning to make read only.

ليست هناك تعليقات:

إرسال تعليق

ADF: Programmatic View Object Using Ref Cursor.

ADF: Programmatic View Object Using Ref Cursor. Posted by:  Manish Pandey   April 25, 2013   in  ADF   Leave a comment   3758 Views Sometime...