Wednesday, July 31, 2013

How to deploy/undeploy/redeploy ADF application to respective environment using ANT Script

This post explains about deploy/undeploy/redeploying ADF applications to respective environment weblogic application server using ANT script

ANT script make life easy to deploy various web applications to different environment with minimal changes. Follow below steps to deploy any web application.

Step1 : Generate EAR(Enterprise Archive) file for your application and place at specific location in unix box.

Step2 : Create build.xml as shown below
Step3 : Modify the below build.xml with respect to environment specific
         username, password, hostname,port, admin server name, target,source location

Step3 : Issue below command where your build.xml available
/opt/oraaip/oltd72/oracle/middleware/modules/org.apache.ant_1.7.1/bin/ant -file build.xml undeploy deploy





Tuesday, July 30, 2013

How to get Table Meta data


Below query will returns you meta data of a given table associated column related meta data


SELECT data_type,
       data_length,
       data_precision,
       data_scale,
       nullable            
 FROM all_tab_columns
WHERE table_name = UPPER(:BindTableName)
  AND column_name = UPPER(:BindColName)

Thursday, July 25, 2013

How to set a title to .jspx file in ADF



<f:view>
   <af:document id"d1" title="EmployeeManagement"/>
</af:document>
</f:view>

Friday, July 12, 2013

How to implement Internationalization to ADF application


- Ensure to create properties file for each loacle, Below example, two properties files  , One is for English and another one is for French/Canadian.

- Configure all the supported loacle in faces-config.xml as shown below screenshot.


- Load the Properties file in page as shown below, Ensure to use <f:loadBundle> component to load properties file


- Below is the way to access properties file associated entries on UI page.



- To test Internationalization changes in Firefox, Make below changes..

Tool -> Options ->Changes  then select the language you want to test and move it to top then click on Ok, Refresh your page.


Tuesday, July 9, 2013

How to enable SSO to an ADF application ?


Nice article, which talks about implementing SSO to ADF application.



http://java2go.blogspot.com/2012/05/oracle-adf-with-sso-definitive-guide.html


Tuesday, July 2, 2013

How to customize Date/Tme format in ADF

Usecase : How to customize Date/Time format display in ADF application

Implementation

Set the format type as shown below.


- If VO attribute binds directly to .jsff/.jspx then automatically it will get the configured date/time format from the VO attribute control hints, If you want to specify something else, we can hard code the date/time pattern

This is how it displays.. 24 Hours date time format



How to perform SSO(Single Sign On) Logout in ADF application


SSO Logout , Redirecting to a specific page or URL in ADF application

Usecase : Provide SSO Logout functionality in ADF application

Implementation:

- Bind a backing bean method to command button as shown below

       <af:commandButton text="Logout" id="cb4" rendered="true"
                          action="#{pageFlowScope.Bean.sessionLogout}"
                          immediate="true"/>

- Redirect to /oamsso/logout.html?end_url=/portal.html as shown below


    public String sessionLogout() {
        String methodName = "sessionLogout(ActionEvent actionEvent)";
        _logger.entering(CLAZZ_NAME, methodName);
        try {
            ExternalContext ectx = FacesContext.getCurrentInstance().getExternalContext();
            ectx.redirect("/oamsso/logout.html?end_url=/portal.html");
        } catch (Exception e) {
            _logger.logp(Level.SEVERE, CLAZZ_NAME, methodName,
                         e.getMessage() + " while logging out: ", e);
        }
        return "back";
    }


Monday, July 1, 2013

How to start Oracle Jdeveloper in Linux?


1. Go the the JDeveloper installation location (jdeveloper/jdev/bin)
2. Give the execute permission to the jdev file
3. run the jdev file as below.

           > cd ~/Oracle/Middleware/jdeveloper/jdev/bin
           > chmod a+x ./jdev 
           > ./jdev

4. If you want to start the JDeveloper using a command say "jdev", then create a softlink in /usr/bin pointing to the JDeveloper location as below.


           > link ~/Oracle/Middleware/jdeveloper/jdev/bin /usr/bin/jdev