20 April, 2015

ADF & OAF ::: Missing IN or OUT parameter

If the bind variable required property wrongly defined into View Object, then it will cause following exception
"java.sql.SQLException: Missing IN or OUT parameter at index:: 1 "

To avoid this exception, you have to keep in mind when you are creating bind variable.
 1- If you are directly passing the bind variable in view object main query then in this case bind variable require property should be selected.

2- If you are using bind variable in view criteria only  then in this case the bind variable require property should not be selected.

Thanks

21 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.


Thanks

16 October, 2013

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);
}


Thanks

14 October, 2013

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
Download dbc file for this path $FND_TOP/secure at application server to local machine folder <>\dbc_files\secure

3- Create Database Connection
Open jdeveloper.exe from jdevbin folder
Select Connection Navigator, right click on Database and select New Database Connection

 In step1write Connection Name and choose Oracle(JDBC) at Connection Type


In step2 fill user name and password and deselect Deploy Password


In step3 fill connection details


In step4 you can click test connection


4- Project Properties
After creating workspace and project, click right click on project and select Project Properties


Select Business Compoenent in left pane, select from drop list your connection


Select  Oracle Applications > Runtime Connection  
Fille the following
DBC File Name : path of dbc file that was downloaded at previous step
User Name : application user name
Password : application user name password

Application Short Name : Enter short name of the responsibility that when running page in Jdeveloper local will run under this responsibility
Responsibility Key : Key of responsibility.


Thanks

11 October, 2013

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);
    }

Thanks

09 October, 2013

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 java.security.cert.CertificateException;
import java.security.cert.X509Certificate;

import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;

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() {

                public void checkClientTrusted(X509Certificate[] xcs,
                                               String string) throws CertificateException {
                }

                public void checkServerTrusted(X509Certificate[] xcs,
                                               String string) throws CertificateException {
                }

                public X509Certificate[] getAcceptedIssuers() {
                    return null;
                }
            };
            ctx.init(null, new TrustManager[] { tm }, null);
            SSLSocketFactory ssf = new SSLSocketFactory(ctx);
            ssf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
            ClientConnectionManager ccm = base.getConnectionManager();
            SchemeRegistry sr = ccm.getSchemeRegistry();
            sr.register(new Scheme("https", ssf, 443));
            return new DefaultHttpClient(ccm, base.getParams());
        } catch (Exception ex) {
            ex.printStackTrace();
            return null;
        }
    }
}



Thanks