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…