### OS/2 Still Kicking..!?

I was pretty amazed to see IBM responding as recently as 16-Jan-2008 to the requests by the OS/2 online community to open source OS/2.

I've admitted before to being an OS/2 fanatic for a few years, but seriously, I think we should let it die and just savour the memories!

One of the great things about the OS/2 community way-back-when is that it was a total geek-out (memories of the OS/2 Devcon in 1992 - still have the bag tag!). Linux has I think long taken that mantle.

It's a bit of a laugh to find some of my OS/2 detritus still kicking around the Internet, like:

I had fun with a couple of other projects that never made it to release (in both cases beaten to the post by the big boys. But dang it, no M&A windfalls in those days!):
• LNDW - Lotus Notes Doorway. I wrote a web server in C++ that provided gateway access to Lotus Notes database under OS/2. Tricky adaptation of the Notes C API to C++ and getting it to work with BC++. Then came Domino...
• OS2IP - a project with a long-lost collegue Bryan Ryan (if you are out there Bryan - drop me a line!). At the time, there was no free TCP/IP stack for OS/2 Warp, so we set about writing one. Got as far as an NDIS packet driver, and a user mode frame interface before IBM finally got their act together and made us obsolete! Nevertheless, good fun hacking around with the Driver Dev Kit in assembler, and bridging to a C++ user-mode API. I don't think it was until then that I really understood Comer in detail. When you are working at that level, it is amazing how exciting exchanging just a few bytes of data in a chat application can be!

### Free Nelson Mandela - The Special AKA

For no reason in particular, I get The Specials' Free Nelson Mandela spinning in my head every so often. It's wierd, since I guess the last time I actually heard the song was in the late 80's. This time I googled it, and happily YouTube comes to the rescue!

### Optimism

A pessimist sees the difficulty in every opportunity; an optimist sees the opportunity in every difficulty.
For myself I am an optimist. It does not seem to be much use being anything else.
But Havelock Ellis would rather lock him up..
The place where optimism most flourishes is the lunatic asylum.

I hinted at a project to develop a simple filter add-in in my last post on Code Generation with JDeveloper. So that turned into my latest weekend project;-)

I'm registering the project on sourceforge, but in the meantime you can get the full source kit here, or if you prefer just the add-in jar here (which just needs to be dropped into your ${jdev.home}/jdev/extensions folder). [30-Jan-2008: the project is now available on sourceforge] What does it do? It is a simple idea. Allow you to invoke an external program to filter any text you have selected in the JDeveloper Editor. Of course, it is up to you to define what filter means - limited by your imagination only. And by externalizing the filter process, it means you can use the tool or scripting language of your choice to implement and make on-the-fly changes to your filter. To be precise, the filter operates like operating system pipes: • Selected text is sent to the standard-input of the filter process. • The standard-output of the filter process is written back to replace the selected text. Configuring the Filter Configuration is done via the JDeveloper Tools | Preferences menu, and is very simple at present. It only supports a single filter process definition. As you can see in the screenshot, you just need to enter a valid command line to invoke the filter. A nice enhancement would be the support for multiple filter definitions. This is where the flexibility comes in. As an example, I've provided a rot13 encoder written in ruby [samples/myrot13filter.rb in the source kit]. puts$stdin.readlines.to_s.tr("A-Za-z", "N-ZA-Mn-za-m")

Ruby, Perl, php, vbscript/WSH, bash ... use whatever you prefer. Rather than needing to develop and deploy an add-in in Java, you can just script the filter.

Applying the filter is simply a matter of selecting some text in the IDE, and choose the Custom Text Filter item from the right-click pop-up menu

The Development View
The truth is that I developed this add-in as more an investigation of the Extensions SDK, and the filter idea appeared to be unexplored territory.

As Brian Duff writes, there are some major improvements in the support for JDeveloper Extensions in 11g. Since it is still in preview, I decided to stick with Extension SDK 10.1.3 however.

There are four classes of significance. since this was an educational exercise, I spent a bit of time to make sure I really understood how it all worked, and tried to reflect that with liberal comments in the source.
• CodePaneAddin - implements the pop-up menu hook and applies the filter
• ExecShell - wraps the invocation of the filter process iwth stdin/out handling. It is independent of the extension API and may be of interest in its own right
• ConfigPanelData - handles preferences panel configuration
• ConfigData - bean to wrap the configuration data

The source kit comes with a JDeveloper project and also ant build file. If you want to build and deploy the add-in to JDeveloper, simplest is to first check the environment-specific settings in build.properties and then simply run
C:\MyDocs\MyDev2\JDevFilter>ant deploy
Buildfile: build.xml

init:

prepare:

compile:

jar:

deploy:
[copy] Copying 1 file to C:\oracle\jdevstudio10131\jdev\extensions

BUILD SUCCESSFUL
Total time: 0 seconds