Wednesday, December 27, 2006

Christmas in Oklahoma

My experiences flying have always been, well, unique is a good word. I don't know exactly what it is, but I tend to have the out of the ordinary trip every so often. Fortunately, most of these events have had little or nothing to do with the overall safety of the aircraft, but they tend to be so ridiculous, that they are amusing to me, and even more so to others.

Some examples:
  • I once flew from Hartford, CT to BWI next to a man with no stomach or spleen. He spent most of the 1 hour flight telling me of his woes that weekend, from his obvious health issues to his father pouring gasoline all over his car and threatening to light it on fire.
  • Flying out of LaGuardia, we had several members of the same family from some African country on the plane, all with the same name. The gate agents were ready to hold the flight because they couldn't tell who was who, and it didn't help much that their guide was Japanese and spoke less English than his group.
  • I saw a little old man punch a woman as our late-arriving flight from New Orleans taxied to the gate at Dulles.
  • I've even flown with turkeys in 1st class.
Typically, my fun has always been on United Airlines, as that's who I tend to fly, as one of their hubs is at Washington Dulles, which is also the absolute worst designed airport on the planet. Seriously - if you had the brightest minds in engineering sit down and try to come up with a worse designed airport, they would fail miserably.

Because of my United frequent flying, I naively always thought that other airlines had to be "better", and that this lunacy which I always got to experience was limited to just United.

Well, a great big Christmas thank you to American Airlines, who proved that they truly can be "something special in the air". I won't go in to how that our cab reservation was not really a reservation, but more of a suggestion for someone with a cab to pick us up, and that
at 5:30 AM, we had to pile in the car and drive to the airport, park somewhere in the next county, and take a packed shuttle bus to the terminal.

The flight was almost 100% full, just unlike the customer service rep told me a couple days before. Not a big deal, I've been on crowded planes before, and clearly if I only buy 2 seats, anyone else has the right to buy up all of the others.

We took off on or close to on-time, which was encouraging. After bumping through the clouds, it seemed like we were going to have a nice, uneventful flight.

About an hour or so later, the pilot came on and made some sort of announcement. I assumed it was the normal "Welcome aboard" message, with flight time, destination weather, and a reminder to keep your seat belts fastened. Immediately after the pilot's announcement, the flight attendant came on and re-iterated the captain's announcement, which so happened to include an additional morsel of information about us not having any water on the plane and that we were going to land in Tulsa, Oklahoma in about an hour to get some.

I looked at my wife and said, "Did they just say Tulsa?"

"I think so" she replied.

"Well, I've never been..."

So our non-stop to LAX instantly became what the airline industry refers to as a "direct" flight, meaning you're stopping at least once between here and there. After an hour or so later, we were on our way down, bouncing through the bumpy Oklahoma air, and after one of the longest approaches ever, on the ground in Tulsa, OK.

We were met by a bunch of maintenance folks, who at one point, spilled a bunch of water on the tarmac. After about 45 minutes, they managed to put the water on the plane and we were on our way back up to our cruise altitude.

All things considered, we were only about 1 1/2 hours late, give or take. We mostly just laughed it off, as it was, after all Christmas day, and heck, what else could we do?

If you've ever seen My Name Is Earl - or even seen Jason Lee on a Southwest flight, like I did while we were flying from Vegas to Burbank - you know a little bit about karma. We had the AA karma with us, as on the way back, they really came through, more so than I expected.

We had to extend our trip a couple of days, as our daughter had a bit of a cough. I called AA, and was given the standard "$100 each plus change in fare" line, to which I replied "Do you really want a sick, screaming baby on a Thursday night red-eye flight with all of your business travelers?" There was a pause, and then I was offered $30 each to change flights, no additional fees.

We jumped on that offer, stayed a couple more days, and then got lucky one more time when we were able to snag the entire bulkhead row. If you have ever traveled with an infant, you what a difference an extra seat in the bulkhead really makes.

All in all, I'll fly AA again. They tend to be a spot cheaper than United these days, fly non-stop (sometimes) from Dulles to LAX, and the customer service thus far has been more than I expected.

Tuesday, November 28, 2006

Can Someone Please Put the "Smart" in SmartPhone?

Almost nothing aggravates me more than people who feel it necessary to read e-mail on their Blackberries while retrieving their bags from the overhead compartments and blocking the aisle at the same time after a 5 1/2 hour transcontinental flight. Is it THAT important that you can't wait until you're not blocking the other 150-some passengers? Surely whoever sent the e-mail doesn't know the exact time that you landed...

I've always swore to myself that I will not become one of those people.

Well, I'm closer than I ever feared, as I am now the owner of a Motorola Q - a so-called "SmartPhone". I guess calling it a "DumbPhone" may be more accurate, but a heck of a lot harder to sell to people.

The Q is not on the list of supported devices that iSync works with. That should have been more than enough of a warning sign to me that getting this thing to work with a Mac was not going to be easy.

In order to get the Mac to talk to it, you have to buy a piece of software called the Missing Sync. Cute name. Initially I thought that this piece of software was just plain missing itself, as it was quite a challenge to install & configure. However, after playing with the Q for a while, I realized what a temperamental little device it is.

Case in point: I figured that since the Q has Bluetooth, I could use that to synchronize with my Mac, saving the hassle of lugging an extra USB cable with me. Well, what I didn't realize is how poor Bluetooth is implemented on the Q. (Another hint I missed - the #1 support topic on the Missing Sync's support page is "Information on the Motorola Q and USB and Bluetooth connectivity")

If you do end up getting a Q, don't leave the store before buying the extended-life battery if you plan on using Bluetooth. Again, this piece of technology is mis-named, as if you're running Bluetooth on the Q, it's more accurately described as the "barely make it home to recharge" battery. Again, a bit of a marketing challenge.

Second, don't really expect Bluetooth to work. The Q has some known issues with it, and I could get it to sync about 1 out of 4 times that way. I finally gave up and switched back to USB, as at least it's about 90% reliable that way.

Another thing to consider if you're looking at the Q: Since the Q runs Windows Mobile, add a few minutes every couple of days to re-boot the phone. Mine just seems to stop working after about 2 days, and removing the battery is the only remedy. That wouldn't be too bad if it didn't take forever to re-boot. Just the other day, I landed at Dulles, and everyone in my row was up & running with their cell phones or Blackberries, checking messages & making calls while I sat there staring at the screen for at least 3 minutes, watching the elegant yet utterly useless Verizon Wireless & Windows Mobile splash screens play as the Q slowly came to life. I really hope that I don't ever need to dial 911 and my Q is off.

If it were worth waiting for it to boot, then I may be able to forgive the aforementioned issues. Unfortunately, that is not the case. The UI is 100% Windows - or what I like to call a "partially completed thought". Admittedly, there are a ton of features available on the phone. You can take a picture, record some video, play a game, listen to an MP3, store contacts, heck - you can even edit the phone's registry!

Rather than specialize and make a few features rock-solid, Microsoft chose to make a large number of features mediocre. The most annoying lack of a feature is when someone calls you from a number that you do not have stored in your address book. In most cases, you want to add that number to that person's address card. Well, someone forgot to add a search capability to this feature, as you literally have to scroll through every contact to get to the one you want. Many of the other shortcomings are similar - not show-stoppers, but clearly if someone sat down and thought the 10 most popular use cases through, they would have been remedied.

The other thing about the Q which drives me mad is that I can't for the life of me figure out how to turn off all sounds except the ringer. I've painstakingly set each sound option to None, and without fail, each night the e-mail sound goes off at least once, as that's when the best spam messages arrive. Thus, I'm forced to put the Q into Silent mode each night, which does silent most of the sounds, including the new e-mail sound. The problem arises when I forget to put it back into Normal mode the next morning and miss calls until I realize my blunder.

I could go on and on about the small little things that make the Q just plain quirky. Many of them I can get past, but it's the compilation of them that make it just a spot annoying to use on a daily basis.

This all goes back to designing a device or program to solve a problem which exists, rather than solving non-existent ones. The Q is a broad-stroke attempt to solve a bevy of problems, any of which someone may possibly have. The result is a device which in my opinion, just does too much with a lack of focus on any one thing. The fact that I need to reboot it almost 3 times a week alone is proof that not enough time was devoted to basic system stability.

So until Apple comes out with the iPhone - if the rumors are true - I'll keep on keeping on with the Q. It does get the job done most of the time, as I am able to check messages from the road, synchronize contacts & calendar with my Mac, and if push comes to shove and I can't get a signal, browse & edit the registry.

Thursday, October 26, 2006

Think Different

I've been a Mac fan since the mid-80s. I was the proud owner of a Mac IIsi and then a PowerMac 7100. Both machines got me through high school & college, where there were Macs-a-plenty. However, once I joined Oracle, I was forced back into the world of Windows.

Given that Oracle gave us Windows laptops, that's what I used for the better part of my 10 years there. The closest I came to getting a Mac was a hand-me-down old beater PowerBook G4 667Mhz that I inherited for a while. It worked, but it was definitely not in a rush to do anything. When the screen saver kicked in, the fan immediately spun into high gear.

Now that I no longer work for Oracle, I no longer get "free" laptops. I did initially buy a Dell when I left Oracle instead of the Powerbook that I really wanted, as I needed to run Oracle eBusiness Suite & TOAD.

Well, here I am almost a year later, the proud new owner of a MacBook Pro. And I couldn't be happier. Well, I could, if I got a free upgrade to the new Core 2 Duo MacBooks, which of course, came out just a few months after I bought mine...

In any case, it is so refreshing to use Mac OS X. From the second I booted up the machine to now, I've been impressed time and time again by its pure elegance. The best way that I can describe OS X is that it is "simply a completed thought." A group of engineers at Apple actually sat down and thought through what people will actually do with their machines - not what they may possibly want to do - and THEN designed their software with that in mind.

Take this example: We bought a video camera after our daughter was born. Naturally, we took a bunch of video of her with the thought being that I could make a DVD & send it off to our families in California, Connecticut & Florida (yes, they could barely live further apart and still be in the US).

So I plugged the camera into my PC, and was immediately prompted with the Auto-Detect Wizard which claimed to recognize my camera, but then at some point, asked for the drivers, which I thought I had on the CD, but after it rebooted, it complained they were out of date, so I had to go to the camera's web site, download new USB drivers, install them, reboot, try to get the camera to be recognized by Windows, sent an e-mail to the camera's manufacturer explaining my plight, uninstalled all of their software, re-installed it, tried again and was able to get grainy 2-bit quality video, which clearly was not what I expected, more e-mails to and from support, another de-install and re-install, and then for the heck of it, I installed the software on my other PC, rebooted, updated, rebooted, and alas - after 2 days, 2 machines and a flurry of e-mails back and forth from support - the video camera worked with my PC!

After getting the Mac, I plugged the camera in, stated iMovie, and it just worked.

Apple designed their OS to make some assumptions for us. For example, if Mac OS X notices a video camera plugged in, it makes the bold assumption that I want to use that camera to transfer video to my Mac. Thus, it quietly does what it needs to do - downloads, installs, updates, whatever - all quietly in the background. I don't get a chance to tell it otherwise, and frankly I don't care, as the assumption that Apple makes is that 99% of people who plug a camera into a Mac want to transfer video. The other 1% who want to do something else probably wrote their own driver anyways.

This level of quiet yet clever integration is evident throughout the OS. Add a contact to your Address Book, and you can instantly refer to them in Mail or iCal. Associate a contact with an AIM username, and the full name of that user is displayed in iChat. All of my pictures which are organized in iPhoto are easily available in Keynote & Pages. Same with my music in iTunes. Simply elegant integration which doesn't get in your way.

Like anything, the Mac is not 100% perfect. There's a few things that are quirky that take some getting used to. Applications will crash - although less frequently than in Windows. Technology is not, and probably never will be, perfect. However, it can be more pleasant to interact with, and that's what Apple has achieved with OS X.

I'm going to expand the focus of this blog a bit and try to also include some Mac OS X entries. Some will be related to Apex & Oracle, while some will focus on OS X only.

Wednesday, October 25, 2006

A New Oracle Blog

I noticed that Donal Daly, who work for the Server Technologies division at Oracle, has started a blog here: http://donaldaly.blogspot.com/

Donal is based out of the Dublin, Ireland Oracle office, and while I was at Oracle, I had the pleasure of working on some projects with him & his team. From what I hear, they are working on a pretty slick Microsoft Access Migration Toolkit, which will be part of Apex 3.0. Donal's team is also responsible for the Migration Workbench, which you can download for free from OTN.

Monday, October 23, 2006

Application Express in Oracle 11g

That's right - the title reads Oracle 11g. It's not a typo. In his keynote at Open World today, Oracle's VP of Server Technologies Chuck Rozwat said "the latest version of Application Express lets end-users build applications like a report generator, in as little as 30 seconds time." (see http://www.internetnews.com/ent-news/article.php/3639621 for the complete article)

This is excellent news, as this is one of the first official direct mentions of Oracle Application Express being something that Oracle is committed to for the long haul. It should also quell the fears that Apex will go down the same path that WebDB did and become abruptly extinct.

Missing OOW

Unfortunately for me, OOW just wasn't in the cards. Starting a new business and having a new baby has left me with little to no free time this year, and I just can't break away for a week. It is nice to see all of the blog posts from OOW, and it seems like Oracle really has taken over a few blocks of downtown San Francisco this year.

It's also been a while since I have updated my blog. This is largely the reason:


"Little" Isabella is almost 5 months old and has grown to 28" already! Most people think she is 1 year old, based on her height alone. She's already in 12 month clothes, and some of those seem a little tight at times. We don't know where she's getting the "tall gene" from, as noone in our families is excessively tall.

In any case, I'll be watching the developments from OOW, so for those who are blogging from there, thanks and keep up the good work!

Wednesday, July 26, 2006

ApEx 2.2 is Production

Looks like ApEx 2.2 is ready for prime-time. You can download a copy here.

Monday, July 17, 2006

Web Developer Toolbar for IE

Well, almost. Microsoft has made a version of the popular Firefox extension here. It's still beta, but seems to have not entirely messed up my PC yet. I have found it to be useful, as most of my clients use IE as their preferred browser, thus forcing me to do the same when testing their sites.

Thursday, July 13, 2006

ApEx Home Page Facelift

Looks like the ApEx PMs have been busy, as the ApEx Home Page has been re-worked. There's not a ton of new content, but I do like the new organization of the page, especially the links to Oracle Magazine articles which feature ApEx. There's also some details on what's new in Release 2.2, which you could previously only see in an obscure corner of apex.oracle.com.

In talking with some of the folks at Oracle, there is a lot more in store, so check back every now and then to see the forthcoming changes.

Tubes

I learned something about the Internet last night which I did not know before:

Friday, June 23, 2006

Announcing the 2007 Application Express Training Conference

I'm excited to announce that Sumner Technologies, LLC in conjunction with ODTUG will be sponsoring a 2 or 3 day ApEx Training Conference sometime in early 2007. This training conference will be held in conjunction with Steven Feuerstein's PL/SQL conference. (http://oracleplsqlprogramming.com/opp2005.php)

Very few details have been worked out yet - heck, we don't even have a real name! What we do know is that we're targeting sometime in February 2007, most likely in San Francisco. The conference will also have some members of the Oracle ApEx Development team participating. I do not know how much it will cost at this point, either.

The format will likely be 1/3 lecture, 2/3 hands-on training. We have not finalized a list of topics yet. Please reply on this OTN Thread and let us know what you'd like to spend some time on - from themes to security, or anything in between.

Our thought was to cater to the more advanced users of ApEx, but I'd be interested to see if there are enough "newbies" who would consider attending if we were to offer an Intro to ApEx track.

More details to follow as they become available.

Thursday, June 22, 2006

Time Breakdown of Modern Web Design

Warning to those easily offended: There's a bad word on the following link. Don't say that I didn't warn you!

I stumbled upon this little gem: Time Breakdown of Modern Web Design

I thought about a few recent projects, and it's scary how accurate it is!

Squirrel on a Wire

This photo was taken outside my house, just across the street:


I've been told he's been up there for some time now, and when the wind blows down, you get the smell to prove it.

Monday, June 19, 2006

ODTUG Monday

Today was the 1st day of ODTUG where I did something other than speak for 5 minutes or down a couple of beers. I hopped on the Metro from Vienna (Virginia, not Austria) and was downtown well before the general sessions started. Unfortunately, I had to miss them, as I needed the time to polish off my presentation for Wednesday, "You can't do THAT with a Browser!"

I led a panel of myself and three others (Michael Snyder & Greg Jarmiolowski from CASETech, and Patrick Cimolini from the Cayman Islands Government) on Application Express. We played to a room of about 40 or so people, and took questions right until the end.

Perhaps Patrick's experiences with ApEx were the most impressive. From seeing a couple of my presentations last year, he was able to take the idea of using ApEx back to the Caymans, train his staff, and deploy 3-4 production applications in well under a year's time frame - all with no previous Oracle experience! There were some other great stories from the audience - from a customer who is running an ApEx-based HR system in 77 countries to another customer who
deployed an application in just a few hours.

After the session, I had lunch with some folks and met with the ODTUG Board to discuss some interesting ideas - more on them if and when they become public! And then it was back to Vienna on the Metro so that I could make it home in time to take a couple of customer calls.

Tomorrow AM, we're teaching a condensed version of our Intro to Application Express class, and I'll likely hang around for part of the afternoon and pop in on some of the sessions.

Sunday, June 11, 2006

New ODTUG Site

The Oracle Development Tools Users Group (ODTUG) just went live with their new site, just about a week before their 2006 Conference. The new site is, of course, running on Oracle Application Express, and is one of my first Internet deployed sites.

Over 1,500 documents (presentations, white papers & technical journal articles) are indexed by Oracle Text and available to Full ODTUG Members on the site. Associate Membership is free, and will give you access to a limited number of these documents.

The content of the site is managed by the ODTUG folks via a separate ApEx application. This way, they can make changes at any time, and do not require any access to the ApEx development environment. Everything from managing the Banner Ads to adding & managing content is done via this Administrative Console.

Check it out and hopefully I'll see some of you at the conference next week!

Tuesday, June 06, 2006

Win a Year of FREE ApEx Hosting!

If you know a thing or two about Football - and by Football, I really mean Soccer - you can win a free year of ApEx hosting, thanks to John Scott of Shellprompt .

Dimitri Gielis has put together quite an impressive World Cup 2006 "bracket" application, hosted by Shellprompt. All you need to do is sign up (it's free), enter your picks (no money is exchanged), and go cheer on your favorite team! Drinking a pint of beer from the team's home countries during the match is optional.

XM is broadcasting all of the games this year, in both English and Spanish, so I'll be sure to tune in now and then.

Tuesday, May 23, 2006

Another New Addition

No, not anohter baby - one is more than enough!

A few weeks ago, Sumner Technologies welcomed Josh Millinger as employee #2. Josh also comes from Oracle, where he was for over 10 years prior to leaving. During his tenure there, Josh was responsible for managing the Oracle Partner Technology Center (now called the Oracle Enterprise Technology Center) in Reston, VA.

I have known Josh personally since the 1st day I moved to the Washington, DC area, and am thrilled that he has decided to jump the ship and take the plunge into the world of small business with me.

Banner Generator

I was writing an installation script today, and wanted to have a large banner displaying the product name as part of it. I fondly remember the UNIX banner command, where you could type "banner sumner" and get something like this:

###### ## ## ## ## ## ## ######## ########
## ## ## ## ### ### ### ## ## ## ##
## ## ## #### #### #### ## ## ## ##
###### ## ## ## ### ## ## ## ## ###### ########
## ## ## ## ## ## #### ## ## ##
## ## ## ## ## ## ## ### ## ## ##
###### ####### ## ## ## ## ######## ## ##
So I SSH'ed into a Linux machine to try to get the same result quickly & easily. No dice! Not to be deterred, I hit up Google and got this link: http://www.network-science.de/ascii/

Not only can I generate a banner as I did above, but you can get all kinds of fancy, like this:

___ _ _ _ __ ___ _ __ ___ _ __
/ __| | | | '_ ` _ \| '_ \ / _ \ '__|
\__ \ |_| | | | | | | | | | __/ |
|___/\__,_|_| |_| |_|_| |_|\___|_|

Or this:

_______ ______ ___ ____ ___ _____
/ ___/ / / / __ `__ \/ __ \/ _ \/ ___/
(__ ) /_/ / / / / / / / / / __/ /
/____/\__,_/_/ /_/ /_/_/ /_/\___/_/


Or even this:

.d8888b 888 888 88888b.d88b. 88888b. .d88b. 888d888
88K 888 888 888 "888 "88b 888 "88b d8P Y8b 888P"
"Y8888b. 888 888 888 888 888 888 888 88888888 888
X88 Y88b 888 888 888 888 888 888 Y8b. 888
88888P' "Y88888 888 888 888 888 888 "Y8888 888

Clearly, some of these are better than others, but I'm happy that there's a quick & easy way to create banners without a UNIX box!

Ajax Memory Tree Article on OTN

My article, "Building an Ajax Memory Tree" has finally been published on OTN. It was also picked up by Ajaxian today, and got decent reviews there!

In this article, I discuss how you can use ApEx & Ajax to create a new type of Tree. This Ajax-based tree is more lightweight than the built-in ApEx tree. You can also search for a node in my version, and have the Tree automatically expand to that node - something which the built-in ApEx Tree cannot do.

To give credit where credit is due, the basis for the Tree which I create in the article is based on Carl Backstrom's Ajax-based tree.

Monday, May 08, 2006

ApEx 2.2 Evaluation

Looks like the ApEx folks have an Evaluation Version of ApEx 2.2. Just got my credentials and was able to sign on.

At first glance, you will notice that the Application Builder pages have been given a face-lift:




There are also some new icons next to the "Run" icon for Comments, Page Locks, Export the Page, and Search.

Three new Themes have made it into Release 2.2: Blue Gray, Dark Blue, & Modern. I'm a fan of Blue Gray, but could take of leave the other two.

One of my favorite new features has to be the way report columns are re-ordered. Prior to Release 2.2, each time you wanted to move a column up or down, you had to submit the page. Now, thanks to some DHTML, you can easily and quickly move columns up and down. This alone will save me time on my use of the tool.

On that same page, each section has been moved to a DHTML "hide & show" region - no more scrolling to the lower depths of the page to set up CSV export! This approach was also implemented in the Region Attributes section as well.

A feature which I have been doing by hand has also been added. It's call Access Control. According to the New Features feedback page:

"When adding a new page to an applicaiton, APEX 2.2, now offers an Access Control Page option. Selecting this option creates 2 tables in your application schema, a screen to manage those tables, and authorization schemes that check the values of those tables. Together, these wizard-generated pieces allow you to declaratively add access control (authorization schemes) to your application."

There's some more features which I'll try to take a look at and report back on a little later. You can see what these and all of the new features are here. Raj from the ApEx team tells me that there will also be a New Features document shortly.

Thursday, May 04, 2006

A New Addition


On Wednesday, April 27th, we welcomed Isabella Lillian Spendolini into the world. She was 7 lbs 7 oz and 20". Both mom and little Izzy are doing well.

All three of us have been trying to get some rest this week. Fortunately, Grandma is in town and has taken over pretty much all day to day tasks.

Saturday, April 15, 2006

ApEx Open Source Applications

There is now an ApEx project on SourceForge.net. There is also a Project Home Page, hosted on apex.oracle.com here.

According to the site, the goal of the project is to "facilitate development of Oracle Application Express (APEX) applications until they gain enough momentum of their own to become their own separate projects." Some of the initial projects include a Forum, Wiki, Blog, and AskSomeone, which if you can't tell, is based on AskTom.oracle.com.

This move represents another step in the maturity of ApEx as a development environment. As this project grows, more "cookie cutter" applications will be available for common tasks, making it even easier and quicker to deploy ApEx applications.

Wednesday, April 12, 2006

Custom Export to CSV

It's been a while since I've updated my blog. I've been quite busy lately, and just have not had the time that I used to. We're expecting our 1st child in just a few short weeks now, so most of my free time has been spent learning Lamaze breathing, making the weekly run to Babies R Us, and relocating my office from the larger room upstairs to the smaller one downstairs - which I do happen to like MUCH more than I had anticipated. I have everything I need within a short walk - a bathroom, beer fridge, and 52" HD TV. I only need to go upstairs to eat and sleep now, but alas, this will all change soon...

Recently, I was asked if you could change the way Export to CSV in ApEx works. The short answer is, of course, no. But it's not too difficult to "roll your own" CSV export procedure.

Why would you want to do this? Well, the customer's requirement was to manipulate some data when the Export link was clicked, and then export it to CSV in a format which can be imported into PeopleSoft. With the built-in export functionality, this is simply not possible.

It's almost too easy. Simply create a Report Region with your favorite query. Add a button or link or anything which will get you to a blank page. On that page, add a PL/SQL process which will fire "On Load - Before Header" In the source of that process, use this code:


begin
-- Set the MIME type
owa_util.mime_header( 'application/octet', FALSE );
-- Set the name of the file
htp.p('Content-Disposition: attachment; filename="emp.csv"');
-- Close the HTTP Header
owa_util.http_header_close;
-- Loop through all rows in EMP
for x in (select e.ename, e.empno, d.dname
from emp e, dept d where e.deptno = d.deptno
and e.deptno like :P1_DEPTNO)
loop
-- Print out a portion of a row,
-- separated by commas and ended by a CR
htp.prn(x.ename ||','|| x.empno ||','||
x.dname || chr(13));
end loop;
-- Send an error code so that the
-- rest of the HTML does not render
htmldb_application.g_unrecoverable_error := true;
end;


You can download the export file here.

Wednesday, February 22, 2006

Page 0 Branches

What? There's no way to put a Branch on Page 0 of an ApEx application! Or is there...

Technically, no - page 0 does not support branches. But how many times do you wish it did?

This scenario recently came up: I wanted to put a "Search" box on every page in my application, so no matter where a user is, they can search the site. Currently, it has 10 or so pages, but this will grow to closer to 50 by production.

So, thought #1 was to put an text item on Page 0, call it search, and then ensure that each and every page had some sort of Branch to run the search. Not so fun, as this was a tedious task, even for just 10 pages. And each time a new page was added to the application - by myself or anyone else - the search branch would have to be added to the page. Clearly not a scalable solution.

With a little bit of help from Raj from the ApEx team, I came up with this solution:
  • Create Page 0, if you haven't already
  • On page 0, create an item of type "Text Field (Always submits when enter pressed)" - this will let the user type in a search term and press return and fire off the search, as opposed to having to rely on a button being clicked
  • Create an Application Process (Shared Components > Application Processes)
  • Give it an unusually high Sequence number, such as 999999, as you want it to fire after ALL other page-level processes in your application
  • For the source, enter the following, making sure to use the page number that you want your search to branch to:
htp.init;
owa_util.redirect_url('f?p=&APP_ID.:710:&SESSION.');
htmldb_application.g_unrecoverable_error := true;

  • Put a condition on the Process to only fire when the REQUEST = P0_SEARCH, where P0_SEARCH is the name of your Search text item on Page 0
  • Run your application and test it out
Ideally, you will have some sort of Report on your Search page which is filtered by :P0_SEARCH, but you can really have that page do anything you want. You can also put more logic in the Application Process.

For example, I am using this method to first determine what level of access a user has. If they have Access Level A, then they branch to page 1; otherwise, they branch to page 10. Sure, I could accomplish this at the page level with two branches, but I need this functionality to be available application-wide. Thus, this solution saves me countless hours and some of my sanity.

Tuesday, February 14, 2006

Yahoo Releases Free UI Library

As noted on Boing Boing, Yahoo! just released its UI Library, an open-source set of AJAX user interface components that developers can use in their sites for free!

From Trees to Sliders, some of these components look quite slick! The real challenge here is not getting them to work with Oracle ApEx, but rather finding practical applications for them. So often I see sites where AJAX is used for the sake of using AJAX, and the result is just a mess.

What intriques me are the reasons behind this. As I've been told many times, there is no such thing as a free anyyhing - it's just a question of when and how you pay. Perhaps Yahoo is trying to steer developers to its services (Maps, Calendar, Mail, etc.) in a pre-emptive strike against Google?

Should be interesting to see how it all plays out.

Monday, February 13, 2006

Learning DIVs

Recently, I’ve been experimenting with using DIVs instead of TABLEs for creating Region Templates in Oracle Application Express.

DIVs seem to have a lot less “moving parts” – or places where the code can become corrupted. Troubleshooting a missing <TD> tag is never a fun exercise, and by using DIVs, you can largely avoid that.

However, DIVs tend to have issues with cross-browser development. What looks great on Firefox doesn’t even render on MSIE. That alone can be a challenge to troubleshoot,

Having said all of this, I was able to take this Region Template:


<table width="100%" cellpadding="0" cellspacing="0" id="#REGION_ID#">
<tr>
<td>
<table border="0" cellpadding="1" cellspacing="0" width="100%">
<tr>
<td bgcolor="#666666">
<table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#FFFFFF">
<tr>
<td>
<table border="0" cellpadding="5" cellspacing="0" width="100%">
<tr>
<td height="25"><span class="projectInfoRegion">#TITLE#</span><br />
<span class="content_text">#BODY#</span></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><img src="/i/st/st_region_bottom_shadow.gif" width="100%" height="3"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br />


And reduce it to just this:

<div class="regionContainer">
<div class="regionOuterContainer" id="#REGION_ID#">
<div class="regionInnerContainer">
<div class="regionButtons">#CLOSE#</div>
<div class="regionTitle">#TITLE#</div>
<div class="regionBody">#BODY#</div>
</div>
</div>


Now keep in mind, pages built with DIVs aren’t much to look at without an associated CSS file. I used the following entries for my new Region Template:


.regionContainer
{
padding-bottom:10px; font-family:Arial; font-size:12px; margin-top:5px;
}
.regionOuterContainer
{
border-bottom:1px solid #aaa; border-right:1px solid #aaa;
}
.regionInnerContainer
{
padding:5px; border:1px solid #000;
}
.regionTitle
{
font-size:18px; font-weight:bold; border-bottom: 1px solid #ddd;
}
.regionButtons
{
float:right;
}


CSS Zen Garden offers some pretty compelling examples of how powerful CSS-based design can truly be. Each example on the site uses the exact same HMTL. All attributes, from images to spacing, are defined in the CSS.

Adding the number of lines in the CSS (20) to the actual DIV-based HTML (8) is almost the same as the TABLE-based HMTL (32). However, the DIVs allow you to do more “cool” things, such as hiding and showing a region.

I am also finding that by using DIVs and a CSS, you have an easier way to make more site-wide changes. I can easily change the Font of that template by altering one line in the CSS file. I can also fine-tune any of the attributes of each of the DIVs by adding the appropriate directives to the respective class.

Despite their cross-browser issues, I’m finding that designing UIs using DIVs and a CSS is much more elegant than the traditional TABLE-based approach.

Monday, January 30, 2006

A new name for Oracle HTML DB

That's right - Oracle HTML DB has officially been renamed to Oracle Application Express. You still don't need Oracle Application Server, and it has nothing to do with Oracle Express or Express Objects, but it does coincide with the name of Oracle Express Edition Database.

This renaming campaign came up once every few months or so when I was at Oracle, as we could never quite come to a consensus on what it should be renamed to. Looks like somoene finally made the call!

My only fear with this new name is that people will associate Application with Oracle Application Server, as in it's a required component (as I said before, it still isn't) and Express with "small and insignificant", which is clearly not the limitations of HTML DB - umm, Application Express. It's going to take some getting used to...

Wednesday, January 18, 2006

Username and Password on Every Page

Well, not really, as that would be bad. However, I’ve often wondered how to include a field for the username and password on every public page, making the sign on process one less click. Well, there’s nothing like learning how to do something like having a customer requirement!

A current client wants a largely public site – that is, you do not need to authenticate to see most of it. Simple enough – just set the Page Attributes Security to Page is Public. However, the client also wanted the username and password field to appear on each and every public page.

From a developer point of view, I didn’t want to have to put any items on any page aside from Page Zero. Thus, every time that I add a page to the application, the login region would simply show up. This required a bit more thought.

Here’s what I came up with: I created a region on Page Zero which holds my username and password fields, as well as a Login button. The button is not an item button, but rather a true button which submits the page when clicked. I also set this region to only display when the user was unauthenticated.

In order to accommodate authenticated users, I also created an HTML region on Page Zero which only renders when the user is authenticated. This region simply displays a welcome message to the user.

Next, I created 2 application level processes to handle the actual authentication process. These two processes are copies of the Set Username Cookie & Login processes which are typically found on Page 101 of your HTML DB Application. These processes are set to run only when the REQUEST = P0_LOGIN, which is the name of my button on Page Zero.

Thus, when you enter a valid username and password and click the Login button on any public page in my application, you are authenticated and returned to the page from which you came. All without any code or items on any page aside from Page Zero!

Steps to Implement
  1. Create Page 0

  2. Create an HTML Region on Page 0 called Login

  3. Set condition of that region to User is the Public User (user has not authenticated)

  4. In that region, create two items:
    P0_USERNAME
    - Text
    P0_PASSWORD - Password

  5. Create an HTML Region on Page 0 called Welcome

  6. In the source of that region, enter a simple welcome message, such as Welcome, &APP_USER.

  7. Set condition of that region to User is Authenticated (user has not authenticated)

  8. Create a Button named P0_LOGIN on Page 0 in the Login region
    - Select Create Button in a Region Position when prompted
    - Leave Branch to Page blank

  9. Create an Application Level Process:
    Sequence
    : 1
    Process Point
    : On Submit: After Page Submission – After Computations and Values
    Name
    : Set Cookie
    Type
    : PL/SQL Procedure
    Process Text
    :
    begin

    owa_util.mime_header('text/html', FALSE);

    owa_cookie.send(

    name => 'LOGIN_USERNAME_COOKIE',

    value => lower(:P0_USERNAME));

    exception
    when others then null;

    end;

    Process Error Message
    : An Error Has Occured
    Condition Type
    : Request = Expression 1
    Expression 1
    : P0_LOGIN

  10. Create an Application Level Process:
    Sequence
    : 2
    Process Point
    : On Submit: After Page Submission – After Computations and Values
    Name
    : Login
    Type
    : PL/SQL Procedure
    Process Text
    :
    begin

    wwv_flow_custom_auth_std.login(

    P_UNAME => :P0_USERNAME,

    P_PASSWORD => :P0_PASSWORD,

    P_SESSION_ID => v('APP_SESSION'),

    P_FLOW_PAGE => :APP_ID||':&APP_PAGE_ID.'
    );
    :P0_USERNAME := null;

    :P0_PASSWORD := null;

    end;


    Process Error Message
    : An Error Has Occured
    Condition Type
    : Request = Expression 1
    Expression 1
    : P0_LOGIN

  11. Edit your current Authentication Scheme, and set the Logout URL to redirect to a public page, not page 101.

  12. Set the Security - Authentication to at least one page in your application to Page is Public.

You should now be able to sign on from any public page in your applicaion.

Thursday, January 12, 2006

Updated Version of Raptor

As Laurent Schneider reported, a new version of Project Raptor has been released on OTN.

Wednesday, January 04, 2006

QuickBooks

Starting your own business makes you learn how to play many roles: project manager, consultant, marketing department, technical support, “executive”, and – worst of all – accountant.

I say that because I really, really, really hate accounting. Maybe I just had a bad experience in college, and could never really appreciate it. Perhaps I’m even a bit ignorant about it. In any case, there’s software out there to help someone like me. Right?

I bought QuickBooks based on several recommendations from co-workers. The folks at Intuit have done a tremendous job! That is, if their job was to create the most un-user friendly, non-intuitive, archaic piece of software.

I don’t even know where to start. They tried way too hard to over-engineer the UI. Everything is “cute”, with arrows, icons, and more reminders than I care to mention. In an attempt to account for every possible “use case”, they have created something that is far less usable than intended. All I need to do is send out invoices, write checks to myself and receive payments. And no matter how hard I try, it takes me longer to execute this process each time.

A lot can be learned from this when writing your own applications. Give the user what they typically expect, not what they may possibly want on a rainy Tuesday morning. Exceptions are just that: exceptions. Since they happen less frequently, they will warrant a little extra effort. But if the exception becomes the rule, then its time to re-design.

Steve Johnson from Pragmatic Marketing summed it up in a class which I took with him months back: “But what if the cat jumps on the keyboard? We have to account for that in the code!” You do not and should not.

Maybe there is room in the market for an HTML DB accounting package…