Dive into Oracle ADF

Send me a mail
 Dive into Oracle ADF   Click to see the XML version of this web page.   (Updated: 2/3/2008; 9:15:13 PM.)
Tips and tricks from Steve Muench on Oracle ADF Framework and JDeveloper IDE

Search blog with Google:
 

Search BC4J JavaDoc:
 

November 2004
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30        
Oct   Dec

Get Firefox!

Friday, November 19, 2004

I'm a faithful user of PubSub's cool (and free!) service of creating you customized RSS feeds based on an ongoing search over millions of blogs. They've now updated their web site to make creating and managing your search feeds a lot more intuitive.

I recently used the site to fine-tune my RSS feed that brings any news about Visual Studio 2005 to my Thunderbird blog reader's doorstep. I was getting a whole bunch of links delivered in the feed that happened to mention Whidbey Island and had nothing to do with the Visual Studio 2005 code name Whidbey.

I modified my search terms to look like:

(("visual studio" and 2005) or whidbey) and not "whidbey island"

and since then all the "false positives" have disappeared.


6:04:52 PM    



Over on the OTN discussion forum George asks an interesting question about how to refer to values in the next row while iterating the rows in an ADF range binding using the JSTL <c:forEach> tag.

I've cobbled together a new "not yet documented" example application to illustrate the technique. See example #20 in the list, " Using JSTL to Refer to Value of Field in Following Row for Conditional Formatting".

The technique combines using the <c:forEach> tag's varStatus attribute, whose value provides the name a variable that JSTL will make available for evaluation inside the loop to access loop-related information. The variable name you provide will be of type LoopTagStatus which has a property named index and last, among others, that you can access via EL.

Since the value of the rangeSet property of an ADF range binding is an array of rows, you can use the value of the current index in the loop as an array index into that array of rows. If you add one to the current (zero-based) loop iteration count, you'll be referring to the next row in that array.

Duncan Mills uses the varStatus attribute in his How to Color Alternate Lines in JSP Databound Table tip on OTN as well.


4:23:47 PM    


About four times a week or more, I end up pointing people to some observation's I included in the ADF Toy Store whitepaper about the ADF application module's batch mode. I factored out the material into a separate article I've added today to OTN:

What is Batch Mode and When Should I Use It?


1:23:32 PM    


While many Java developers may prefer to implement all of the J2EE design patterns by hand, if you happen to be a developer who prefers focusing on writing business application code rather than design pattern application plumbing code, then here's quick article listing the J2EE design patterns that Oracle's ADF framework provides out-of-the box so you don't have to implement them yourself..

OTN Article: ADF J2EE Design Pattern Catalog


1:20:54 PM    


This week I've been setting up a Linux box at work with Red Hat Advanced Server 3.0. I installed Oracle 10g 10.1.0.3 on it with minimal hassles, following a combination of the Oracle installation documentation and the (honestly sometimes more clear and direct) steps that were part of an Oracle Base installation checklist for Oracle 10g 10.1.0.2 on RedHat advanced server 3.0. It was an Oracle consultant in the field office where I worked that told me to use the Oracle Base article, since it goes out of the way to specifically tell you where to find each of the RedHat RPM's to install as prerequisites and specifically tells you "add these lines to this file at this spot".

Of course I then installed the dynamic duo of Firefox and Thunderbird, Oracle JDeveloper, and the VNC Server so I can use my Linux box's Gnome desktop remotely through my Oracle VPN from anywhere I happen to be in the world.

As I was doing all this, it dawned on me that the only reason left that I have to work on a Windows based laptop is because I am huge user of XMetal for authoring all of my tips and whitepapers. If I were able to find a WYSIWYG editor for Docbook-based XML content authoring that runs on Linux, I think I could seriously see bailing on Windows for good. I wonder if Tim Bray or Norm Walsh read this blog and would have any suggestions from their experience?

A quick Google search for docbook authoring tools linux produced this useful link. I might check one of these out after OpenWorld San Francisco is behind us.


12:19:03 PM    


While working on JSP pages, I often include conditional display logic by leveraging the JSTL <c:choose> tag. Trouble is, it's pretty verbose, with at least a couple of nested tags to write each time I use it.

To reduce my typing, I created a JDeveloper Code Template that lets me type ch followed by the [Ctrl]-[Enter] key combination to expand those two letters into this whole block of tags, ready to be used:

<c:choose>
  <c:when test="${}">
  </c:when>
  <c:otherwise>
  </c:otherwise>
</c:choose>

It even puts the insert-point cursor right between the ${ and } of the EL expression so I can press [Ctrl]-[Space] and get code-insight to help me fill out the EL expression I want in no time. 

To define your own code template just pick the Tools | Preferences... | Code Editor > Code Templates to get to the preference panel for code templates. You'll see that there are a number of Java-related, predefined code templates in the list there. Click the (Add) button and in the Shortcut column enter the few-letter shortcut you want to type to be expanded when you press [Ctrl]-[Enter] in any code editor. You can also enter a description if you like. Down on the Code tab, type in the tags above, with the indentation that you want them to have when they get expanded into your JSP page code.

The last step is pretty subtle, but important. Click the mouse cursor into your just-pasted tags so that the i-beam cursor is just between the ${ and the } of the test attribute value on the <c:when> tag as shown in the example above. Then, press (OK) to save the preferences. The place where you click the i-beam cursor in the code template text when you click (OK) is where it will be placed automatically whenever you expand that particular code template.

Finally, create a new JSP page and try out the template by typing ch followed by a [Ctrl]-[Enter] while in the JSP page source view. One caveat is that if it's the first time you're using a tag from the JSTL Core tag library, make sure to add the <@taglib%> directive at the top of your JSP page for that tag library. It needs to look like this:

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>

For Java-related code templates, while defining your code template you can click over to the Imports tab of the preference panel and type in a list of Java classes that your code template depends on. When that code template is expanded in a Java class' source code file, JDeveloper will make sure those classes are imported, and if they are not it will add them automatically. You list the class names to import, one per line, without semicolons at the end.


11:40:55 AM    


© Copyright 2008 Steve Muench.