Monday, 24 September 2007

What do you want to learn about?

In the interest of trying to write good posts that the APEX community will find useful, I have added a new 'poll' feature to my blog. My first poll is entitled simply, 'What would you like to read more about on my blog?' and I have suggested a few titles to pick from. You can cast your vote by selecting from the check boxes on the right of the page, below 'About Me'.

If you have any other suggestions or areas you wish to learn about or understand better, then please add a comment to this post.

Look forward to hearing from you!
Anthony.

Wednesday, 5 September 2007

UKOUG 2007 agenda packed with APEX

The agenda for UKOUG 2007 has just been released and there is currently a total of 13 presentations on or relating to APEX (and a keynote delivered by Tom Kyte!). They are...

Loads to learn so come along, I'll be there and presentating 'Building The Rich User Interface with Oracle Application Express and AJAX' so looking forward to doing that (scary!) and listening to many more! Hope you can make it!
Anthony.

Monday, 3 September 2007

Developer productivity gains with 'Bookmarklets'

Introduction...
The ability to manipulate web content with Javascript on the fly is becoming more and more widespread, with tools such as Firefox's Greasemonkey, IE's Trixie and a whole host of other browser add-ons providing the ability to apply scripts to web pages. Bookmarklets are probably one of the simplest and easiest ways to achieve this, storing Javascript code in the URL of a bookmark or favorite. I have built a few which I find helpful in automating some of the more mundane tasks whilst developing with APEX.


How...
All you need to do is drag the following links onto your bookmarks / favorites toolbar in your browser. They are all compatible with Firefox and Internet Explorer.
  • Bulk Edit - Repad sequence numbers - Sequence numbers by default are padded by 10, but as the development process ensues, items get moved, processes get added and sequence numbers inevitably get scrunched up. This bookmarklet repads sequence numbers by 10 when in bulk edit pages where the 1st column is the sequence number, such as bulk editing page items, computations or validations.

  • General - Enlarge textareas - Enlarges small textareas for easier editing, useful for 'Region Definition > Source' or 'Page Process > Source'.

  • Report Attributes - Alignment LEFT - Sets both 'Column Alignment' and 'Heading Alignment' to 'LEFT' whilst on the 'Report Attributes' page.

  • Report Attributes - Sort All - Checks all the 'Sort' checkboxes whilst on the 'Report Attributes' page.

Once this is done, you can just click the bookmark / favorite when on the appropriate page and the Javascript will be applied.


Conclusion...
In my opinion bookmarklets are fantastic for implementing these type of simple extensions, the main reasons are:
  • Portability(1) - All my bookmarklets will work in Firefox and Internet Explorer.

  • Portability(2) - And this is important, using a Firefox add-on such as Foxmarks which synchronizes bookmarks between different instances of Firefox (home and work), your bookmarklets will be available to you on any browser you have synchronized.

  • Simplicity - Minimal learning curve for deployment, assuming a basic understanding of Javascript and bookmarks.

  • Categorisation - Easy to organise your bookmarklets into folders and subfolders, just as you would with your regular bookmarks.

  • Ease of use - I have my bookmarklets available on my bookmarks toolbar, ready for quick deployment.

As APEX developers, we live in a world of 'browser-based development', rather than a traditionally rich IDE such as JDeveloper and Eclipse. The standard browser was not designed to be used as a development tool and thus anything we can do to help increase development productivity, such as write custom bookmarklets or use the essential Firebug can really help. So have a go and write your own, here are some general guidelines including a very useful bookmarklet builder. During development, I find a 'could I automate this?' attitude helps in identifying bookmarklet opportunities.

Let me know if you have any more useful productivity increasing bookmarklets to share and I'll add them to this post.

Anthony.


Update - Another way...
Following the advise of Patrick and Dimitri, I've taken a look at the APEX Builder Plugin and it really is awesome, congratulations Patrick!

It is compatible with both Firefox (with Greasemonkey) and IE (with IE7Pro), and it's fantastic. Whilst bookmarklets are great for a quick fix, if you want to get serious about building your own productivity customisations then I strongly advise you to invest a little time looking at this plugin.

It does not change the APEX base install in any way and just requires the developer to have one of the above add-ons installed in their browser and the plugin scripts available to the workspace, either on the server or stored in the database as static files. Within a couple of hours I had it installed, had a good look around and was building my own extensions.

One of the features of the plugin is the creation of a custom 'Set' select list at the top of any page in the Application Builder. This comes with some useful pre-rolled 'Setters', and also and importantly allows the developer to easily define their own 'Set' options for all or specific pages. This not only makes work more efficient for the developer, it can also be leveraged for enforcing standards across a team developing in APEX.

I was able to recreate the functionality from my bookmarklet, 'Bulk Edit - Repad sequence numbers' on all the bulk-edit pages accessible via the 'Page Definition' page, with the following code:
// Page Items

ApexBuilderPlugin.addSetOperation
( "General"
);
ApexBuilderPlugin.addSetOperation
( "Repad sequence numbers"
, { "f01": function(pField, pRow)
{
return pRow + '0';
}
}
);

For further information on how to do this, please refer to the How to Install guide.

As well as providing the ability to define your own 'set' operations, it also provides the ability to map keyboard shortcuts to common functions, such as F10 for 'Apply Changes' or F8 for 'Run Page' and a much neater solution to the enlarge textarea problem.

Great work Patrick!!


Another Update...
I am now delighted to announce that my 'Repad Sequence Number' customisation will be included in the next official distribution of the plugin. Thanks to Patrick for giving me a mention.


Further Information...
Bookmarklet homepage
General Guidelines
Bookmarklet Builder
Web Development Bookmarklets
Oracle bookmarklets by Eddie Awad for searching documentation
APEX Builder Plugin