Thursday, March 31, 2011

Book Released: Oracle Application Express 4.0 with Ext JS

I'm very happy to announce that my book Oracle Application Express 4.0 with Ext JS is now officially published.

A printed copy turned up in the mail recently, and I'm very pleased with the final result.


 The table of contents for the book as well as a sample chapter is available on the Packt website.



Sue Harper blogged about the three phases of book writing:

  • before the book - Seems like a good idea
  • during the book - Not a good idea, will this ever end? Who's idea was this anyway?
  • after the book - That was easy ... what's next?

After spending most evenings and weekends writing until midnight for the last 15 months, I've definitely done the first two phases, but haven't quite reached the last phase yet.

Still to do
The code bundle available to download on the Packt website includes code from each of the chapters.
I will be updating it in the next couple of weeks to:

  • include the Ext JS library, so the stand-alone examples work when the bundle is unzipped
  • add the APEX TEMPLATE application, CSS, JavaScript and image files used in the book
  • include a few extras that didn't make it into the book.
I'll write another blog post when the updated code bundle is available.

Then after that my demo site definitely needs an overhaul, it's looking sadly neglected...

Thursday, March 10, 2011

Bookmarklets to extend APEX 4.0

APEX allows you to add help text for your pages at a page level, and also an item level.
Your only given a plain textarea to add your text, as you can see in the following screenshot.
Hint APEX team: can we change this in the next version?

One way to replace the textarea with the APEX Rich Text Editor is to use a Bookmarklet, which allows you to embed JavaScript code in a browser bookmark.
Then simply click the bookmarklet to convert the textarea to a Rich Text Editor when needed:


Simply drag the following links onto your browser bar to save the bookmarklets:
The source code for the Page Level Help bookmarklet is:
javascript: (function(){
    function getScript(url, success){
        var script = document.createElement('script');
        script.src = url;
        var head = document.getElementsByTagName('head')[0];
        var done = false;
        /* Attach handlers for all browsers*/
        script.onload = script.onreadystatechange = function(){
            if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) {
                done = true;
                success();
            }
        };
        head.appendChild(script);
    }
    /* Code to execute after script loaded */
    function run(){
        apex.widget.ckeditor3("#F4000_P4301_HELP_TEXT", {
            "language": "en",
            "toolbar": "Basic",
            "toolbarStartupExpanded": true,
            "skin": "kama"
        });
    }
    /* Main */
    if (!window.CKEDITOR) {
        getScript('/i/libraries/ckeditor/3.2/ckeditor.js', function(){
            run();
        });
    }
    else {
        run();
    }
})();

All we are doing is adding the ckeditor.js file when it's not present, and then converting the specified page item to use the basic CKEditor.
For the advanced version replace "toolbar": "Basic" with "toolbar" : "Full".

You may need to adjust the item reference if your not using Application Express 4.0.2.00.07, or a translated version.

Friday, March 4, 2011

APEX_PUBLIC_USER password expires on 11g

Just read Scott Wesley's post on APEX Listener issues which was being caused by Oracle 11g automatically expiring passwords.

The cleanest solution is to use an unlimited password lifetime profile, and assign to APEX_PUBLIC_USER.

This is done simply by:

CREATE PROFILE UNLIMITED_PASSWORD_LIFETIME LIMIT
  SESSIONS_PER_USER DEFAULT
  CPU_PER_SESSION DEFAULT
  CPU_PER_CALL DEFAULT
  CONNECT_TIME DEFAULT
  IDLE_TIME DEFAULT
  LOGICAL_READS_PER_SESSION DEFAULT
  LOGICAL_READS_PER_CALL DEFAULT
  COMPOSITE_LIMIT DEFAULT
  PRIVATE_SGA DEFAULT
  FAILED_LOGIN_ATTEMPTS DEFAULT
  PASSWORD_LIFE_TIME UNLIMITED    /** this sets unlimited lifetime */
  PASSWORD_REUSE_TIME DEFAULT
  PASSWORD_REUSE_MAX DEFAULT
  PASSWORD_LOCK_TIME DEFAULT
  PASSWORD_GRACE_TIME DEFAULT
  PASSWORD_VERIFY_FUNCTION DEFAULT;


ALTER USER APEX_PUBLIC_USER
 PROFILE UNLIMITED_PASSWORD_LIFETIME
 ACCOUNT LOCK;

Sunday, January 30, 2011

Web page optimization with Page Speed

I've only recently become aware of Google's Page Speed Firefox  add-on integrated with the Firebug extension.


Page Speed is Google's equivalent of Yahoo's YSlow, also a Firefox add-on that needs the Firebug extension to work.
Like YSlow it tests the performance of your webpages against a set of criteria, giving an overall score for a page as well as advice on how you can improve your page performance.

Not surprisingly many of the recommendations are similar to Yahoo's, but some are different, giving you an additional perspective on website performance.

As well as telling you how to improve page performance, there are tools built-in to assist you. Page Speed automatically optimizes JavaScript, CSS, and image files referenced from a page when you run the analysis, saving them to a local directory. Drilling into a rule, such as Minify CSS tells you the potential reduction in size as well as a link to the optimized version.

Page Speed also has mod_pagespeed, an open-source Apache module for Apache 2.2 that automatically optimizes web pages and resources on them. I haven't investigated this, but it would be interesting to experiment with.


I use both YSlow and Page Speed, each tool has something unique to offer. Page Speed is a useful addition to your toolbox for web development.

Tuesday, December 21, 2010

Plugin: Re-sizable columns and save preferences

A very quick post, with an example of an APEX GridPanel Plugin used to convert a APEX Standard Report into an ExtJS GridPanel.


The Plugin implements the following functionality:

  • drag-and-drop to re-arrange columns
  • check-box menu to show or hide columns
  • resizable table to change width
  • resizable columns
  • save settings and restore defaults.
IE has a nasty habit of caching the page, so make sure you do a refresh to retrieve the saved layout.

Full details of how to implement are in chapter 9 of my book Oracle Application Express 4.0 with Ext JS

Tuesday, December 14, 2010

Illumination for Developers

Just wanted to let people know about an awesome Firebug addon called Illumination for Developers created by Steven Roussey.


It makes Firebug know about ExtJS components and it's an absolute gem.

In this screenshot from Steven's blog you can see the Ext components on the left, and their properties etc on the right.

Currently it supports ExtJS, Sencha Touch, Dojo, SproutCore with plans for qooxdo, jQuery UI and YUI.
It's early days for it's development, and it will be a commercial product, but looks like a great addition for your toolbox.

BTW, I have no affiliation with the product and don't know Steven. I'm just impressed with the concept.



Wednesday, November 3, 2010

Book "Oracle Application Express 4.0 with Ext JS" released


I'm very pleased to announce my book "Oracle Application Express 4.0 with Ext JS" has just been released as a RAW book by Packt Publishing.

RAW simply means the book is still being written, with 8 of 11 chapters completed so far. You're getting access to new chapters as they are being completed, in an unedited format.

A RAW book is an ebook, and this one is priced at 40% of the usual eBook price. Once you purchase the RAW book, you can immediately download the content of the book so far, and when new chapters become available, you will be notified, and  can download the new version of the book. When the book is published, you will receive the full, finished eBook.

For details on the book visit the Packt website.

If you're not familiar with Ext JS, take a look at the Sencha website.

APEX combined with Ext JS allows you to create visually impressive web applications easily. Integrating the Ext interface into a APEX theme and powerful widgets as APEX Plug-ins allows you to give your users a much richer Web 2.0 desktop experience.

Writing the book has been an opportunity to revisit every aspect of integrating the two technologies, with the benefit of over 3 years experience combining the two.

My knowledge has deepened along the way, and I'm happy to be able to share what I've learnt with you.