Dimitri Gielis
I created this Blog to share my knowledge especially in Oracle Application Express (APEX) and my feelings ...
Updated: 11 hours 40 min ago
Goodies - APEX 4.2.2 included Libraries
External libraries are typically used to extend APEX so you (and the APEX development team) don't need to build certain features from scratch.
One of the advantages of applying the latest patches is that the external libraries that come with APEX carry an update too. Most known examples of external libraries are AnyChart (chart engine in APEX) and the CKEditor (Rich Text Editor), but there are some other nice libraries that come with APEX too.
Here's an overview of the libraries that you will find in the images folder:

Some are declaratively integrated in APEX for example respond-js is part of the Blue Responsive theme, some others are not, for example twitter-bootstrap and another part is used in some sample or packaged apps, for example jquery-flot.
Having those libraries already there, means you can more easily integrate those in your own apps yourself too. Remember, if you want to go the extra mile it's worthwhile to create an APEX plugin so it's easier to reuse.
If you want to know more about those libraries, you find the links below:
Library(latest) version in APEXLatest version of library960.gs120203130207bgiframe2.1.12.1.2ckeditor3.6.44.1.1codemirror0.663.12ios-inspired-theme121106121106jquery1.7.11.9.1 / 2.0.0 (no support IE6/7/8)jquery-autocomplete1.1deprecated - part of jQuery UIjquery-colorpicker1.41.4jquery-flot0.70.8jquery-jstree0.9.9a2pre 1.0 fix 2jquery-mobile1.2.11.3.1jquery-qtip22.0-6.26.20112.0.1jquery-quicksand1.2.21.3jquery-ui1.8.221.10.3jquery-validate1.71.11.1modernizr2.5.32.6.2respond-js1.1.01.1.0selectivizr1.0.21.0.2twitter-bootstrap2.2.12.3.1
So note that APEX is not always including the latest version of the library.
One of the advantages of applying the latest patches is that the external libraries that come with APEX carry an update too. Most known examples of external libraries are AnyChart (chart engine in APEX) and the CKEditor (Rich Text Editor), but there are some other nice libraries that come with APEX too.
Here's an overview of the libraries that you will find in the images folder:

Some are declaratively integrated in APEX for example respond-js is part of the Blue Responsive theme, some others are not, for example twitter-bootstrap and another part is used in some sample or packaged apps, for example jquery-flot.
Having those libraries already there, means you can more easily integrate those in your own apps yourself too. Remember, if you want to go the extra mile it's worthwhile to create an APEX plugin so it's easier to reuse.
If you want to know more about those libraries, you find the links below:
Library(latest) version in APEXLatest version of library960.gs120203130207bgiframe2.1.12.1.2ckeditor3.6.44.1.1codemirror0.663.12ios-inspired-theme121106121106jquery1.7.11.9.1 / 2.0.0 (no support IE6/7/8)jquery-autocomplete1.1deprecated - part of jQuery UIjquery-colorpicker1.41.4jquery-flot0.70.8jquery-jstree0.9.9a2pre 1.0 fix 2jquery-mobile1.2.11.3.1jquery-qtip22.0-6.26.20112.0.1jquery-quicksand1.2.21.3jquery-ui1.8.221.10.3jquery-validate1.71.11.1modernizr2.5.32.6.2respond-js1.1.01.1.0selectivizr1.0.21.0.2twitter-bootstrap2.2.12.3.1
So note that APEX is not always including the latest version of the library.
Categories: Development
Oracle Database 12c and APEX
The below content is based on a David Peake's presentation at OOW 2012 and APEX World 2013.
As the Oracle Database 12c is not out yet at the time of writing, note that things might be different in the final product.
The Oracle Database 12c is a major release in Oracle history, as it contains a complete redesign of the underlying architecture. Two things will come back a lot when you read about Oracle DB 12c; the Container Database (CDB) and the Pluggable Database (PDB).
The below image shows how it works; you have a container database which the memory and processes are attached at, and then you can have multiple other databases that you can just plugin.

You find more information about this architecture here.
So what does Oracle DB 12c mean for APEX?

Oracle DB 12c comes with APEX 4.2.0. You can either install APEX in the CDB or in the PDB. APEX 4.2.0 is the minimum version you can install in Oracle DB 12c.
The advantage of running APEX in the CDB is that when you upgrade APEX, all database plugged into that CDB will have the latest version of APEX.
The advantage of installing APEX in the PDB is that you can run different versions of APEX in the different databases. If APEX is installed in the CDB, you can't remove APEX from CDB$Root anymore.
But one of the first things I would do is either upgrade APEX 4.2.0 to 4.2.2 or install APEX 4.2.2 from scratch depending which option you went with.
When you upgrade from DB 11g with APEX to 12c PDB here's a screenshot of the steps to take:
When you install APEX in the Oracle database 12c, some new options will become available in APEX, build on top of some new Oracle database 12c features.
The 12c database parameter - max_string_size will allow you to upgrade your VARCHAR2 from 4k (standard) to 32K (extended).
If you look in your APEX installation you will find /core/collection_member_resize.sql. Running that script will change the APEX collection VARCHAR2 columns from 4K to 32K.
In 12c there's also a new column type that is basically an "auto numbering field", something you would typically do with a sequence and trigger. In 12c the column type is called "Identity column" and it can have following values: ALWAYS - which means a Sequence number is always used, DEFAULT set value, DEFAULT ON NULL use seq nr if null.
When you run APEX in a 12c database, SQL Workshop will allow to specify an identity column in the create table wizards. Also the Create Form/Report wizard will create the correct item type (display only).
Another new column type in 12c database is the "Invisible Column": SELECT * from
will not display invisible columns. INSERT into will not insert into invisible columns. To insert into the invisible column you must explicitly set it.
In APEX - SQL Workshop - Object browser; the column will not show up.
Data Redaction, to mask your application data dynamically, is also a new feature in Oracle 12c. Before you had to setup VPD policies and do FGAC (Fine Grained Access Control), now it becomes more native in 12c. APEX will just show you what you are allowed to see following your policy. For example depending your policy you will see a credit card number like 4541 **** **** **** or null. You can read more about data redaction and masking in a blog post of Lewis Cunningham.
As the Oracle Database 12c is not out yet at the time of writing, note that things might be different in the final product.
The Oracle Database 12c is a major release in Oracle history, as it contains a complete redesign of the underlying architecture. Two things will come back a lot when you read about Oracle DB 12c; the Container Database (CDB) and the Pluggable Database (PDB).
The below image shows how it works; you have a container database which the memory and processes are attached at, and then you can have multiple other databases that you can just plugin.

You find more information about this architecture here.
So what does Oracle DB 12c mean for APEX?

Oracle DB 12c comes with APEX 4.2.0. You can either install APEX in the CDB or in the PDB. APEX 4.2.0 is the minimum version you can install in Oracle DB 12c.
The advantage of running APEX in the CDB is that when you upgrade APEX, all database plugged into that CDB will have the latest version of APEX.
The advantage of installing APEX in the PDB is that you can run different versions of APEX in the different databases. If APEX is installed in the CDB, you can't remove APEX from CDB$Root anymore.
But one of the first things I would do is either upgrade APEX 4.2.0 to 4.2.2 or install APEX 4.2.2 from scratch depending which option you went with.
When you upgrade from DB 11g with APEX to 12c PDB here's a screenshot of the steps to take:
When you install APEX in the Oracle database 12c, some new options will become available in APEX, build on top of some new Oracle database 12c features.
The 12c database parameter - max_string_size will allow you to upgrade your VARCHAR2 from 4k (standard) to 32K (extended).
If you look in your APEX installation you will find /core/collection_member_resize.sql. Running that script will change the APEX collection VARCHAR2 columns from 4K to 32K.
In 12c there's also a new column type that is basically an "auto numbering field", something you would typically do with a sequence and trigger. In 12c the column type is called "Identity column" and it can have following values: ALWAYS - which means a Sequence number is always used, DEFAULT set value, DEFAULT ON NULL use seq nr if null.
When you run APEX in a 12c database, SQL Workshop will allow to specify an identity column in the create table wizards. Also the Create Form/Report wizard will create the correct item type (display only).
Another new column type in 12c database is the "Invisible Column": SELECT * from
will not display invisible columns. INSERT into will not insert into invisible columns. To insert into the invisible column you must explicitly set it.
In APEX - SQL Workshop - Object browser; the column will not show up.
Data Redaction, to mask your application data dynamically, is also a new feature in Oracle 12c. Before you had to setup VPD policies and do FGAC (Fine Grained Access Control), now it becomes more native in 12c. APEX will just show you what you are allowed to see following your policy. For example depending your policy you will see a credit card number like 4541 **** **** **** or null. You can read more about data redaction and masking in a blog post of Lewis Cunningham.
Categories: Development
APEX Ice Cream - Oracle ACE Cookbook
The warm days are coming... time for some APEX Ice Cream!
People in my close environment, they know I can't resist ice cream and chocolate! So what I did was I bought a real ice cream machine, so I could make my ice cream myself :-)

The different ways and flavours you can make your ice cream is unlimited ... anyway, this is how it looks like when you put your cream into the ice machine and wait 30 minutes.

So, is this blog post about making ice cream? Not really... I just wanted to bring under your attention that under the lead of Lewis Cunningham some Oracle ACE and ACE Directors created a real cookbook (for food)!
Lewis came up with the idea and did the hard work of putting everything together. There's a nice video of Lewis explaining why he wanted to do it. In 2008, it was actually Lewis who put forward my name to become an Oracle ACE Director which I will be forever thankful. When he raised the idea about the cookbook, I didn't have to think long to put the recipe in to make one of my favourite desserts; home made ice cream with chocolate sauce, I call it "APEX Ice Cream". You can read in the recipe why :-)
I embedded the cookbook from Scribd below:
ACE Cookbook by Lewis Cunningham
If you want to make your ice cream responsive...
Here's how a version of a desktop version of APEX Ice Cream looks like:

And here's the smarth phone version, I didn't remove any content as you can see, it's just a bit closer together... APEX Ice Cream is why to good to show less on a smaller plate ;-)

Enjoy!
People in my close environment, they know I can't resist ice cream and chocolate! So what I did was I bought a real ice cream machine, so I could make my ice cream myself :-)

The different ways and flavours you can make your ice cream is unlimited ... anyway, this is how it looks like when you put your cream into the ice machine and wait 30 minutes.

So, is this blog post about making ice cream? Not really... I just wanted to bring under your attention that under the lead of Lewis Cunningham some Oracle ACE and ACE Directors created a real cookbook (for food)!
Lewis came up with the idea and did the hard work of putting everything together. There's a nice video of Lewis explaining why he wanted to do it. In 2008, it was actually Lewis who put forward my name to become an Oracle ACE Director which I will be forever thankful. When he raised the idea about the cookbook, I didn't have to think long to put the recipe in to make one of my favourite desserts; home made ice cream with chocolate sauce, I call it "APEX Ice Cream". You can read in the recipe why :-)
I embedded the cookbook from Scribd below:
ACE Cookbook by Lewis Cunningham
If you want to make your ice cream responsive...
Here's how a version of a desktop version of APEX Ice Cream looks like:

And here's the smarth phone version, I didn't remove any content as you can see, it's just a bit closer together... APEX Ice Cream is why to good to show less on a smaller plate ;-)

Enjoy!
Categories: Development
Goodies - APEX 4.2.2 Sample and Packaged Apps
After reading Michael Hichwa's blog post about APEX 4.2.2 where he mentions the patch set includes a major upgrade of all 18 productivity and all 16 database sample applications, I decided to install all of them again and check them out.

Those apps are a great way to see how to do certain things and see working applications behind the scenes. The packaged applications you first have to unlock before you can see the pages and source.
As APEX is meta-data driven you can also query for specific information.
I was for example interested in knowing which apps where using the Responsive Design Theme (Theme 25). Following query shows you per application which theme is used.
As you can see the sample apps are using Blue Responsive (theme 25) and most of the packaged apps are using the Cloud Apps theme. As those also have a mobile version, you can see the JQuery Mobile Smartphone theme is used there too.
select a.application_name, a.alias, a.compatibility_mode, a.pages, a.installation_scripts,
listagg(t.theme_number, ',') within group (order by t.theme_number) as theme_numbers,
listagg(t.theme_name, ',') within group (order by t.theme_name) as theme_names
from apex_applications a, apex_application_themes t
where a.application_id = t.application_id
group by a.application_name, a.alias, a.compatibility_mode, a.pages, a.installation_scripts
order by 1
Here's the result:

The sample and packaged apps are not only nice examples (and useful apps), but they also contain some plugins that are not on the official Oracle Plugins page.
There are 21 plugins used in the sample and packaged apps. But two I believe are the same (CSS Bar Chart vs CSS Bar Charts and Slider vs APEX Slider), so that brings the total to 19 plugins to checkout!
And there are some really nice ones, like the Gantt Chart (completely in css, so works on the iPad) :

and Flot Pie Chart (build in JavaScript and CSS) :

Running following query shows you all the plugins in your workspace and in which application it was used:
select p.plugin_type, p.display_name, p.name,
count(a.application_name) as nbr_app_using_plugin,
listagg(a.application_name, ',') within group (order by a.application_name) as applications
from apex_appl_plugins p, apex_applications a
where p.application_id = a.application_id
group by p.plugin_type, p.display_name, p.name
order by 1,2
Here's the result:

I would definitely recommend having a look at the apps, the APEX team did a nice job on those.

Those apps are a great way to see how to do certain things and see working applications behind the scenes. The packaged applications you first have to unlock before you can see the pages and source.
As APEX is meta-data driven you can also query for specific information.
I was for example interested in knowing which apps where using the Responsive Design Theme (Theme 25). Following query shows you per application which theme is used.
As you can see the sample apps are using Blue Responsive (theme 25) and most of the packaged apps are using the Cloud Apps theme. As those also have a mobile version, you can see the JQuery Mobile Smartphone theme is used there too.
select a.application_name, a.alias, a.compatibility_mode, a.pages, a.installation_scripts,
listagg(t.theme_number, ',') within group (order by t.theme_number) as theme_numbers,
listagg(t.theme_name, ',') within group (order by t.theme_name) as theme_names
from apex_applications a, apex_application_themes t
where a.application_id = t.application_id
group by a.application_name, a.alias, a.compatibility_mode, a.pages, a.installation_scripts
order by 1
Here's the result:

The sample and packaged apps are not only nice examples (and useful apps), but they also contain some plugins that are not on the official Oracle Plugins page.
There are 21 plugins used in the sample and packaged apps. But two I believe are the same (CSS Bar Chart vs CSS Bar Charts and Slider vs APEX Slider), so that brings the total to 19 plugins to checkout!
And there are some really nice ones, like the Gantt Chart (completely in css, so works on the iPad) :

and Flot Pie Chart (build in JavaScript and CSS) :

Running following query shows you all the plugins in your workspace and in which application it was used:
select p.plugin_type, p.display_name, p.name,
count(a.application_name) as nbr_app_using_plugin,
listagg(a.application_name, ',') within group (order by a.application_name) as applications
from apex_appl_plugins p, apex_applications a
where p.application_id = a.application_id
group by p.plugin_type, p.display_name, p.name
order by 1,2
Here's the result:

I would definitely recommend having a look at the apps, the APEX team did a nice job on those.
Categories: Development
Importing APEX Team Development Feedback from TEST to DEV (on same instance)
One of the great features in APEX is Team Development. It was introduced in APEX 4.0 and I already blogged about it before, so if you don't know what it is, have a look at my previous post first.
This post is about exporting the feedback from your other environments (TEST, ACC, PROD, ...) back into Development. It's a lot easier to have everything in one Team Development environment (typically DEV) for an application / workspace, so you need a way to get the feedback from the other environments feed into your development environment.
When you connect to your TEST environment, you can export the feedback through the normal export wizard in APEX (the wizard is the same to import/export apps, but then with the feedback tab):

Once you have your feedback exported to a sql file, you can connect to your development environment and import the feedback:

This goes well as long as you're importing from a different APEX instance than what you exported from.
In case you are running your TEST environment on the same database (and APEX instance) as your development instance, when you try to import the feedback you might get following error:
ORA-00001: unique constraint (APEX_040200.WWV_FLOW_FEEDBACK_PK) violated

It's a known limitation of APEX. The way to get around it is to export the feedback from TEST to a file (see first step), purge the data in that environment (TEST) and after that you can import it in your DEV environment.
You find the Purge Data under Team Development - Utilities (Team Actions on the right side):

Here you can purge the feedback (or other entries):

The import will work fine in your DEV environment. But be careful you are in the right environment, because once you purged the feedback in one environment you can't import it anymore in that environment. When you try doing that, you get following error:

This post is about exporting the feedback from your other environments (TEST, ACC, PROD, ...) back into Development. It's a lot easier to have everything in one Team Development environment (typically DEV) for an application / workspace, so you need a way to get the feedback from the other environments feed into your development environment.
When you connect to your TEST environment, you can export the feedback through the normal export wizard in APEX (the wizard is the same to import/export apps, but then with the feedback tab):

Once you have your feedback exported to a sql file, you can connect to your development environment and import the feedback:

This goes well as long as you're importing from a different APEX instance than what you exported from.
In case you are running your TEST environment on the same database (and APEX instance) as your development instance, when you try to import the feedback you might get following error:
ORA-00001: unique constraint (APEX_040200.WWV_FLOW_FEEDBACK_PK) violated

It's a known limitation of APEX. The way to get around it is to export the feedback from TEST to a file (see first step), purge the data in that environment (TEST) and after that you can import it in your DEV environment.
You find the Purge Data under Team Development - Utilities (Team Actions on the right side):

Here you can purge the feedback (or other entries):

The import will work fine in your DEV environment. But be careful you are in the right environment, because once you purged the feedback in one environment you can't import it anymore in that environment. When you try doing that, you get following error:

Categories: Development
Review PhoneGap 2.x Mobile Application Development (e-book)
Packt asked me if I was interested in reading one of their books, PhoneGap 2.x Mobile Application Development Hotshot, and write my thoughts on it.As the topic is in my interest sphere and I was having a long flight ahead, I decided to use that time to read it. So I read the book on my iPad in about 9 hours, but didn't try the code the comes with the book yet.
I strongly believe in developing mobile applications for both smartphones as tablets. You can either go the native route (iOS, Android, Windows phone, ...) or go the HTML5, CSS3, JavaScript route. I see a market for both, but I personally lean more towards the HTML5 way, as I can use the skills that I currently have. PhoneGap (built on Cordova) bridges the gap between what you can do standard in HTML5 and what you can do if you would code natively for the device. PhoneGap offers a JavaScript API to access the hardware of the device, for example the camera, microphone, accelerometer, filesystem etc. PhoneGap wraps your HTML and JavaScript into a native shell, specific to the device, so you could even submit it to the platform's app store.
The book is mostly build of examples, which is a great way to see the potential of the tool. The author starts with giving a brief overview what PhoneGap is and where it fits in. It also walks you through how to prepare your environment to run the examples. Next it's all examples... The first chapter talks about how to create multilingual applications and sets the foundation for the other chapters. I found it interesting to see the author is using the YASMF framework (instead of for example JQuery Mobile).
In the second chapter you basically build a basic twitter application which also allows you to share the information. To do the sharing she used ShareKit, a very nice open source project.
In the following chapters she builds applications around the PhoneGap's File APIs, geolocation features together with Google Maps, recording and playing of audio, using the camera to store pictures and video, all very nice examples.
Chapter 8 is interesting as it builds a game! Behind the scenes it's using the HTML5 canvas, multi-touch gestures and the accelerometer. It's also reusing some of the things you learned in previous chapters like the file api, but it expands now to use localStorage.
The final two chapters are about expanding PhoneGap with native functions from the device and supporting bigger mobile devices like the iPad.
As you can see, a lot of ground is covered, with all excellent and useful examples!
Before, I only played a bit with PhoneGap, but I didn't find it hard to follow the content. I found the chapters well structured. I like to know why I'm doing something, so it was great to see that was covered first and then it builds up by designing the app (UI/interactions), the data model, putting it together and wrapping it up. You need a good understanding of HTML and JavaScript to follow the examples, but the author highlights that too in the Preface.
Categories: Development
APEX 4.2.2 patch set released
Today APEX 4.2.2 was released. As with every patch set a number of bugs got fixed, but this patch also contains a new packaged application to build surveys.

Here's a screenshot of the app:

If you are on 4.2 or 4.2.1 (first patch set), you should get the update from Oracle Support, the patch number is 16277995.

If you are on a previous version you should download the entire APEX version from OTN.
I upgraded my virtual machine in about 6 minutes.

If you want to read more, Joel Kallman and Marc Sewtz did some blog posts about APEX 4.2.2.
Marc recorded some nice videos about the updated PDF Printing in APEX 4.2.2 in combination with the APEX Listener.
Happy patching...

Here's a screenshot of the app:

If you are on 4.2 or 4.2.1 (first patch set), you should get the update from Oracle Support, the patch number is 16277995.
If you are on a previous version you should download the entire APEX version from OTN.
I upgraded my virtual machine in about 6 minutes.

If you want to read more, Joel Kallman and Marc Sewtz did some blog posts about APEX 4.2.2.
Marc recorded some nice videos about the updated PDF Printing in APEX 4.2.2 in combination with the APEX Listener.
Happy patching...
Categories: Development
Online Oracle APEX documentation updated
Today, Anthony Rayner tweeted that the online APEX (JavaScript APIs) documentation was updated.
The JavaScript APIs of APEX got a complete rewrite over time and contains many hidden gems of APEX. Now you can read more about those in the documentation too and see some examples straight in there.

Next to the documentation it's also useful to look at the non-minified .js files that come with APEX.
You find them in ~your APEX directory~/images/libraries/apex/
In there you find many interesting .js files, based on the filename you have an idea which area they are in. For example if you want to work with cookies you can find that in storage.js. The navigation.js for example contains an interesting function to create popups and so much more...
Not everything is in the online documentation yet, but the documentation is updated frequently now, so definitely good to check it out again.
The JavaScript APIs of APEX got a complete rewrite over time and contains many hidden gems of APEX. Now you can read more about those in the documentation too and see some examples straight in there.

Next to the documentation it's also useful to look at the non-minified .js files that come with APEX.
You find them in ~your APEX directory~/images/libraries/apex/
In there you find many interesting .js files, based on the filename you have an idea which area they are in. For example if you want to work with cookies you can find that in storage.js. The navigation.js for example contains an interesting function to create popups and so much more...
Not everything is in the online documentation yet, but the documentation is updated frequently now, so definitely good to check it out again.
Categories: Development


