Sunday, November 28, 2010

Writing your first BPEL process in SOA Suite 11g

Hi,

I finally managed to setup soa server on another machine so now i can work much faster than running on a 2GB Ram virtual machine on my macbook.

So here in this post we will see how to write a simple BPEL process which will concat the text "Hello Dear" with our input value same as my older post sayHello method.

Download the sample project and instructions in the video



Happy Jdeveloping,
Zeeshan Baig

Friday, November 19, 2010

Calling Webservice in Oracle ADF by Creating Webservice Data control

Hi,
In this post we will call the webservice by creating webservice data control in Oracle fusion application we will call the same webservice that we have created in last post.

More info in this video



Happy Jdeveloping,
Zeeshan Baig

Creating Webservice from Java class in Jdeveloper 11g

Hi,
In this post we will see how to create Webservice from java class, test it using HTTP analyzer and deploy to weblogic server.

Watch this video tutorial



Happy Jdeveloping,
Zeeshan Baig

Monday, November 15, 2010

How to display Videos in ADF Fusion application

Hi,

Simple post but effective by using af:media component we can display or run videos in oracle adf fusion application. af:media just like af:image accept a source parameter to the location of the file.

Here is the code snippet



standbyText="Please wait while the movie loads" id="m1"
autostart="true" playCount="0"
innerHeight="500" innerWidth="600"/>


Happy Jdeveloping,
Zeeshan Baig

Tuesday, November 9, 2010

Displaying table data in tool tip style popups in Oracle ADF

Hi,

 A common use case is to display related data in tool-tips style. In this post we will see how to to achieve that in Oracle ADF.

Download the sample code

Details in this video



Happy JDeveloping,
Zeeshan Baig

Wednesday, November 3, 2010

How to execute SQL DML statements in Oracle ADF

Hi,

In some use cases it is required to execute just a simple DML (Insert, Update, Delete) statements in application.  so how to execute those in ADF? I will describe a one way to do this.

The steps are:

1. Create a method in Application Module (using DBTransaction and CallableStatement)
2. Expose that method to client interface
3. Drag and drop the method to your page
4. And optionally you can set the partial triggers and write a code to refresh your iterator bindings.

Here is the sample method in AppModuleImpl.java


  public int increaseSalary(int deptId, int increamentPercent) {
    
      DBTransaction trans = getDBTransaction();

      CallableStatement statement = null;
      int rows = 0;
      
      String plsql =
            " BEGIN " 
          + " UPDATE EMPLOYEES "
          + " SET SALARY = SALARY + (SALARY * ? / 100)"
          + " WHERE DEPARTMENT_ID = ?;"  
          + " END; ";
    
    
      statement = trans.createCallableStatement(plsql, 2);
      try {
          statement.setInt(1, increamentPercent);
          statement.setInt(2, deptId);
  
         rows = statement.executeUpdate();

      } catch (SQLException s) {
          throw new JboException(s);
      } finally {
          try {
              if (statement != null)
                  statement.close();
              return rows;
          } catch (SQLException s) { /* ignore */
          }
      }
  return rows;
  } 


Download the sample code

Watch this video for more info



Happy JDeveloping,
Zeeshan Baig

Monday, November 1, 2010

Performing logical delete in Oracle ADF

Hi,

In some use cases it is required not to physically delete the row from database but instead update a FLAG e.g delete_FLAG = 'Y'  to hide rows from user. So, if you are not familiar with the framework then you might take a long route to do the task which could easily be done by declarative steps.

In this post we will do the following.
  1. We will add history columns in entities.
  2. We will have a view criteria to display only DELETE_FLAG = 'N' rows.
  3. On deletion in detail table we will delete logically.
  4. We will update the History columns of Master entity as modified by and modified_date.

Download the sample code

More info in this video




Happy JDeveloping,
Zeeshan Baig

Avoiding JBO-26048 during commit in a master detail transaction

Hi,

You might face error JBO-26048 while performing COMMIT in a master detail transactions. This error occurs because by default your Association is not configured to perform optimized DMLs (Both Master and Detail same time) and you might see something similar.


(oracle.jbo.DMLConstraintException) JBO-26048:
Constraint "TAB_DET_TAB_MST_FK" is violated during post
operation "Insert" using SQL statement
"BEGIN INSERT INTO TAB_DET(DET_ID_SEQ,ID_SEQ,
DET_DESC,DELETE_FLAG) VALUES (:1,:2,:3,:4)
RETURNING DET_ID_SEQ INTO :5; END;".


You can simply avoid this checking the "Cascade update key attributes" and Composition Association in Association > Relationship



Happy JDeveloping,
Zeeshan Baig