Some 'more, in-depth' information on Oracle BPEL PM, ESB and other SOA, day2day things

Wednesday, October 06, 2004

Creating your own DataControl, links and some more info

Since we came up with the ADF framework in JDeveloper 10g, I've heard from lots of people that there's neary any doc on how to create your own DataControl - after searching a little bit around, I thought it would be a cool idea coming up with some links and little more details (Transaction support).

Steve Muench describes plenty of details about ADF in his ADF-Binding Primer, so the first thing we recommend, if you're not familiar with the concepts, is to take a look at it.

Every datacontrol we ship together with JDeveloper is extending the the base datacontrol class
oracle.adf.model.generic.DCGenericDataControl so this is the one to start with. This "base"datacontrol class provides all the necessary methods and functions to create a DataControl, that might support find-mode, transaction awareness, scrolling, creating / removing rows etc.

One of our fellow PMs, Olivier, came up with a programmatic datacontrol a while before, that accesses an LDAP server to display some filtered data at the end. Within this paper he describes the necessary steps that you have to do, to create your own in the same manner.

After working on a more detailed explanation how to create your own DC, there is something to mention, which is otherwise pretty difficult to find. If you take Olivier's approach, creating your own DC, you should notice, that for design time (= what you see in JDeveloper), we use the subtype DCJavaBean, within the DataControl definition (DataControls.dcx), which is very helpful in the case where you don't want to start writing a designtime part - that exposes all the functionality you provide within your DC.

There is right now a limitation that this subtype of DataControl (DCJavaBean) does not support transactons per default.

This means for you:
  1. Even if you turn the flag supportTransactions to true (within the DataControls.dcx file), the designtime in JDeveloper will not show commit / rollback buttons ..
  2. Don't forget to override (= implement) the commitTransaction / rollbackTransaction methods within your DataControl class, these will be called on invocation of the defined events.
  3. You have to write the needed configuration code within the UIModel, where you want to expose the commit / rollback buttons.

    As of a crazy limitation on this blogger, pls contact me and i'll send you the code :-(
  4. The last thing to do is within the JSP (for which you already extended the UIModel) to create the two buttons, one for commit and one for rollback.

    As of a crazy limitation on this blogger, pls contact me and i'll send you the code :-(

I filed an Enhancement request for this feature to have it done without custom coding, just by our DesignTime within JDeveloper - hope it's coming soon, but until this time, whenever you use the subtype DCJavaBean, you have to do it by hand :-/.



0 Comments:

Post a Comment

<< Home