Saturday, September 26, 2009

about invoking ADF Business Components methods

some interesting links about invoking ADF Business Components methods
- blog post where Steve Muench suggests to make sure not to skip the JSR 227 binding layer
"Instead, to invoke a client interface method on an application module, view object, or view row, you should use a ADFM action binding to invoke it declaratively instead. ... If you do need to write some custom backing bean code ..., then your backing bean code should exclusively invoke the client interface method on the application module using the action binding. One key reason to use the action binding even from your own custom code is to ensure that any exceptions are handled in the same, consistent way as if ADF had invoked the method declaratively."
at http://radio.weblogs.com/0118231/2009/08/20.html#a959
- forum thread "binding wrapper methods and Page Definition beans" with the example application BindingWrapperMethodsApp-v0.01.zip resulting in enhancement request 8920226
at http://forums.oracle.com/forums/thread.jspa?threadID=958407
- blog post by Steve Muench, "Best Practice Example for Invoking AM, VO, VORow Methods from Backing Beans"
at http://blogs.oracle.com/smuenchadf/2009/09/best_practice_example_for_invo.html
- forum messages on the method executeEmptyRowSet() and how to invoke it (enhancement request 8929420), with the example application ClearSearchStuff11g-v0.01.zip
at http://forums.oracle.com/forums/message.jspa?messageID=3773539#3773539
and http://forums.oracle.com/forums/message.jspa?messageID=3774544#3774544

Monday, September 21, 2009

nice Code Template for log statements

This seems to be working properly again in JDeveloper 11.1.1.1.0 .
(see also forum thread "JDeveloper 11g : variable $end$ in custom Code Template")

I often find myself adding "print debug statements" to my code like this:

public class SomeClass
{
   public void someMethod()
   {
      System.out.println("SomeClass.someMethod() : some info");
   }
}

I already used the default "sop" code template to help me with that.
Now I have been able to configure my own code template that also adds the class name and method name automatically.

I don't know how to export code templates so I'll try to describe it:
In the "Preferences" dialog on the "Code Editor > Code Templates" pane I added a Shortcut "sopl" with Description "System.out.println logging".
On the "Code" tab I added:

System.out.println("$myCurClass$.$myCurMethod$() : " + $end$);




On the "Variables" tab I configured:
Name="myCurClass", Type="curClass", Default Value="x", Editable=<unchecked>
Name="myCurMethod", Type="curMethod", Default Value="x", Editable=<unchecked>



So, if I type "sopl" in my Java code followed by Ctrl+Enter I can add my log statements faster.

Sunday, September 20, 2009

deployment of ADF 10g on WebLogic 11gR1 currently not supported

Recently I learned that deploying an ADF 10g application (with 10g ADF libraries) on WebLogic 11gR1 is currently not supported.
I got this from Oracle support in service request 7771680.992 and from Shay Shmeltzer in the OTN forum thread "deploy an ADF 10g application on WebLogic 11gR1".

But, it does not seem to be impossible to deploy this very simple ADF 10g application on WebLogic 11gR1:
http://www.consideringred.com/files/oracle/2009/ADF10gOnWebLogic11gR1App-v0.01.zip

Saturday, September 19, 2009

an easy way to check some System properties

The properties.jsp page available in properties.war has proven to be useful from time to time.
see http://www.consideringred.com/files/mix/properties/properties.war

It allows you to quickly check some System properties on the server you are dealing with.
- For example on OC4J:
properties.jsp?pProperty=oracle.j2ee.container.name
could return oracle.j2ee.container.name = Oracle Containers for J2EE 10g (10.1.3.4.0)
- For example on Oracle WebLogic Server Version 10.3.1.0 (11gR1):
properties.jsp?pProperty=java.vm.name
could return java.vm.name = BEA JRockit(R)

If you add the properties.jsp page to your own application, it could be a quick way to check some System property values used by your application.
(note : Be careful when packaging the properties.jsp page for a production deployment.)

Friday, September 4, 2009

search for class file in JAR files

Searching for a Java class file in multiple JAR files is easy using this SearchInJar.jar tool.
Pass in the name of the class to find and the directory to search in, like this:

D:\searchinjar>java -jar SearchInJAR.jar oracle.jbo.domain.Number D:\oracle\jdevstudio111110-mw
found oracle/jbo/domain/Number.class in D:\oracle\jdevstudio111110-mw\jdeveloper\modules\oracle.adf.model.generic_11.1.1\bc4jdomgnrc.jar
found oracle/jbo/domain/Number.class in D:\oracle\jdevstudio111110-mw\jdeveloper\modules\oracle.adf.model_11.1.1\adfm.jar

Note that the SearchInJar.jar file includes the Java source files for this tool.