Showing posts from October, 2013

OAF : Trace OAF Pages

To enable diagnostic for specific user set Profile Option FND: Diagnostics to YES
See this article about profile option

Now login at application, you will find in global buttons "Diagnostics" link, click it.
Enter the follwing
Diagnostic: Show Log on Screen
Log Level : Statement (1)
Module : %

Now Click go button

Now when opening any page at application you will find trace at button of page.


OAF : Programatically Add Region to OA Page

Sometimes in OAF, you want to add a region to OA Page.

For example i had a requirement to add employee summary region to another page.
Employee Summary Page exists at MDS at this path "/oracle/apps/per/selfservice/common/webui/AsgSummaryRN".

Application module that is used with this region is "oracle.apps.per.selfservice.common.server.SummaryAM"

I wrote the following code to add this page to another page at controller of OA page

ipublic void processRequest(OAPageContext pageContext, OAWebBean webBean) { super.processRequest(pageContext, webBean); OATableLayoutBean empSummaryBeean = (OATableLayoutBean)this.createWebBean(pageContext, "/oracle/apps/per/selfservice/common/webui/AsgSummaryRN", "AsgSummaryRN", true); empSummaryBeean.setApplicationModuleDefinitionName("oracle.apps.per.selfservice.common.server.SummaryAM"); empSummaryBeean.setStandalone(true); webBean.addIndexedChild(0, empSummaryBeean); }…

OAF : Configure Jdeveloper for OAF

Developers use specific version of Jdeveloper to extend or customize OAF pages.
Each Oracle OAF framework has specific version of Jdeveloper used with it.

Before configuring jdeveloper you must know current OAF version used by Oracle EBS.
To get OAF version used by your instance, login at application and click "About this page" link on the left button of OA page and select "Technology Components" tab.

After knowing your OAF framework version , login at Oracle Support and open Note ID: ID 787209.1 - How to find the correct version of JDeveloper to use with eBusiness Suite 11i or Release 12.

Download correct Jdeveloper patch and extract anywhere at your machine.

Follow the following steps to configure Jdeveloper

1- Specify Path of jdeveloper
Right click on My Computer, select Properties, click System Properties, Select Advanced tab , Click Environment Variables as given below screen shot
Variable name : JDEV_USER_HOME

Variable value : <>

2- Download DBC file

OAF : Disable Global Buttons in Page

I write snippet code to disable global buttons in OAF page.
You can add the following code to Controller class of the page that you want to disable global buttons inside it.

public void processRequest(OAPageContext pageContext, OAWebBean webBean) { super.processRequest(pageContext, webBean); OAPageLayoutBean pageLayoutBean = (OAPageLayoutBean)pageContext.getPageLayoutBean(); pageLayoutBean.prepareForRendering(pageContext); OAGlobalButtonBarBean globalButtonsBean = (OAGlobalButtonBarBean)pageLayoutBean.getGlobalButtons(); globalButtonsBean.setRendered(false); }

Route HTTP to HTTPS in HttpClient

I published before an article about JAVA : Get html Page Source through Website URL that HttpClient was used to send Get method and get Response.

Sometime developer want to route Http to Https when invoking Urls.
So You can use WebClientWrapper.wrapClient to do this issue.



import org.apache.http.client.HttpClient;
import org.apache.http.conn.ClientConnectionManager;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.impl.client.DefaultHttpClient;

public class WebClientWrapper {
    public static HttpClient wrapClient(HttpClient base) {
        try {
            SSLContext ctx = SSLContext.getInstance("TLS");
            X509TrustManager tm = new X509TrustManager() {


JAVA : Get html Page Source through Website URL

To get source code of website page you can use HttpClient ,I will  send GET method and then get response.
The response has content of website URL.

I used Apache HttpClient package to implement this task.

In this Class I used  getStringFromInputStream method that was I was posted before in Convert InputStream to String.

here you can find Class do this task
Note I use static method WebClientDevWrapper.wrapClient, you can find its code in the article Route HTTP to HTTPS in HttpClient

import; import; import; import; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.HttpClient; import org.apache.http.impl.client.DefaultHttpClient; public class WebsiteSource { public static String getSource(String url) throws Exception { String retValue = ""; HttpClient httpclient = new Defa…