Wednesday, January 30, 2013

Performance diagnostics with ADFLogger

This post will show how to use the ADF Logger for performance analysis and how to instrument your own code so it shows up in this analysis. Every ADF developer should know, or learn, about the ADF Logger. If you are new to the logger than read up on it at the official documentation or the great Adventures in Logging series by Duncan Mills.

Configuring Oracle Diagnostic Logging

First thing we need to do is to configure the proper ADF Logger levels as the default levels will only show warning and errors. Run your application so the integrated WebLogic server starts. The log window in JDeveloper will have an Actions pull down menu where you can opt to configure Oracle logging:
configuring Oracle Diagnostic Logging

This will open an editor to the logging configuration file at DefaultDomain/config/fmwconfig/servers/DefaultServer/logging.xml which is typically in JDEV_USER_HOME/system11.

SyntaxHighlighter at Blogger

Running a tech/developer blog means I will be posting source code and other technical text. This requires proper syntax highlighting and use of monospaced fonts. Unfortunately doesn't really support this out of the box so we need to resort to 3rd parties. Alex Gorbatchev created an awesome syntax highlighter purely in javascript. This means it doesn't need a server side component and we can easily integrate it into blogger.

To integrate SyntaxHighlighter into blogger you have to edit the HTML of your template:
how to get to editing your blogger template

Tuesday, January 29, 2013

Global DateTimeConverter without separators

We are developing an application where data processing speed is important and users have to enter a lot of dates into the system. This is replacing a legacy Oracle Forms system where people were used to entering dates without any separators. For example they want to enter 120613 for June 12th 2013 (or December 6th 2013 if you're from the US).

ADF Faces (and MyFaces Trinidad) has its own DateTime converter that is already pretty advanced and lenient. You can give it a pattern and it will try to parse any input in several variations of the supplied pattern. For example, both "Jan/4/2004" and "01.4.2004" will be parsed with a pattern of "MMM/d/yyyy". For months it will try MMM, MM and M and it will try any of the separators - or . or /

But we wanted the converter to also try a pattern without any separators. You could specify a secondary pattern for a converter and it will also try to parse any input with this secondary pattern while still using the primary pattern for displaying the date/time. But I don't like the idea of manually setting a secondary pattern on each and every date field in the application.

Tuesday, January 22, 2013

Welcome back!

I've been away from blogging for too long. My old blog succumbed to spam way back. It just got too bad and I ended up shutting down my blog.

I am now putting my faith back in modern anti-spam technology and giving it another try with Google's Blogger. There's just so much stuff going on in my daytime job that is perfect for a blog. Sometimes you spend a couple of hours or days on a technical issue and I want to share it with the world. It's also a great reference for myself because you frequently need a solution you figured out months/years ago and a blog can be a very valuable reference.

For people that don't know me personally: I am Wilfred van der Deijl from The Netherlands. I have been working with Oracle development tools since 1995 with a strong focus on ADF in the last 7 years. I am an Oracle Fusion Middleware ACE and an independent contractor working on projects in the Netherlands and occasionally abroad. Last year I did smaller jobs in Denmark, Belgium, Canada and the Cayman Islands. I am also the creator of OraFormsFaces, a toolkit to seamlessly integrate legacy Oracle Forms modules into a web application. I try to present as much as possible at different Oracle events, such as OpenWorld, ODTUG Kaleidoscope, UKOUG, etcetera.

So here I am again. A fresh new blog about ADF and other Oracle Fusion Middleware topics. I am still thinking whether I should import the content of my old blog or I should get a clean start.

There are some nice ADF goodies coming in future posts. Examples are a global DateTimeConverter that allows the entry of dates without any separator (eg. 311212 or 12312012), a custom ClientBehavior to replace the decimal point on the numerical keyboard with a comma as you type, and some experiences building an ADF Mobile application that we hope to publish in both the Apple App Store and Google Play Store.

If this sounds interesting then please subscribe to the feed, or follow me on twitter (@wilfreddeijl) or Google+.