Monday, July 18, 2011

Packt Publishing discounts on Oracle books

Just noticed that Packt Publishing are celebrating the publication of its 50th Oracle book.

They are offering some attractive discounts on all their Oracle books.


  • Buy any Oracle print book and get 20% off
  • Buy any Oracle eBook and get 30% off

There is also a competition to win a year's free subscription to their online library, so a good time to pick up a book or two.

Saturday, June 18, 2011

Updated Code Bundle for "Oracle Application Express 4.0 with Ext JS"

For those of you patiently waiting for the updated code bundle, its finally available.


The bundle includes the template application shown above.
All you need to do is install the application, including the supporting objects, and then upload the web assets and Ext JS library to your web server.

When you download the code, just extract the highlighted code bundle, the other folder is the original code bundle which can be discarded (I don't know why they included it).

One last change...

Add the following CSS rules to the playpen-book.css file:

.ux-table input[type="text"] {
    background-color: #FFFFFF;
    background-image: url(/ux/extjs/resources/images/default/form/text-bg.gif);
    background-repeat: repeat-x;
    border: 1px solid #B5B8C8;
    padding: 2px 3px 0;
    line-height: normal;
}

.ux-table input[type="text"] {
    height: 18px; 
    vertical-align: middle;
}

Gremlins, they're everywhere.

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