Monday, August 27, 2007

Boosting up apex global notification messages

Some weeks ago my hosting provider experienced some network routing difficulties as a consequence of the exceptional rains and consequent flooding that hit central UK.
The service was not stopped altogether however one could see an abnormal sluggishness when opening a page.

This is one of those situations where one may want display some highly visible warning across all pages of an application, in order to inform the users as to why the service quality is below the average standard.

Another good reason for displaying such messages is for announcing server downtime, software upgrades or other important information with minimal effort and especially without tampering with Apex regions on production sites.

One could take this approach even for displaying commercial ADs, including a banner based on an image or a flash clip.

In Oracle Application Express, the basic mechanism for displaying this kind of messages is through the so-called Global Notification Message, an application definition attribute that is substituted to the #GLOBAL_NOTIFICATION# template string at page rendering time.

The global notification message as it is, has a few limitations, that i recap below in sparse order:

  1. It's monolingual; in order to make it multilingual, one must write all the translations one after each other.
  2. One must update the message by editing the application definition which isn't easily available in Run Only mode, because the application is not listed in the applications panel.
  3. If you have more than one applications in the same workspace, you must update the message in each and every application separately.
  4. There is no built-in mechanism for checking if the templates you are using are able to display the global notification message.
So, this is why i came up with my own solution to get rid of these limitations, working on a documented way of setting the Global Notification programmatically, as you can see in Apex online documentation, chapter 7, customizing templates, page templates, global notification.

apex_application.g_global_notification := 'some text';

Building on this simple idea, i developed an application that allows you to edit, translate and publish global notifications on all applications belonging to your workspace.

You can freely download this application from the link below:

Yocoya Global Notifications Manager for Oracle Application Express 3.0
(version 1.0 in zip format)

Anyone who dares to try it out?

Not sure yet?

Check out this video that shows you how to be up and running in less than 5 minutes.

5 comments:

Dimitri Gielis said...

Very nice video Flavio!

And the apps seems to work for me (I tried it on an older app of me: http://apex.shellprompt.net/pls/apex/f?p=106:1)

Thanks,
Dimitri

Byte64 said...

Hi Dimitri,
thanks for getting back!

This morning, after rereading a post of Patrick, i found out that in Apex 3.0 there are those two new HTML editor enabled text areas, so i went back to the notifier application and changed the page item where one edits the messages. I didn't use the old textarea with HTML editor for the known problems with Firefox, but now i can take advantage of this new feature and let the user exercise his fantasy.

I'll update the applications in the afternoon.

By the way, it that application using a browser based language detection or is it monolingual?

If it is browser based, you can see that you can publish translated messages very easily.

Bye,
Flavio

Anonymous said...

Hi Flavio,

I tried to download the example app but the link seems to no longer work. Do you still have the app and could you make it available?

Thanks,
Todd

Anonymous said...

Hi Flavio! I was looking to download your app but the link gives an error and not one of your errors :-)

Byte64 said...

Hi,
I updated the link, it should be working now.

Thanks
Flavio

yes you can!

Two great ways to help us out with a minimal effort. Click on the Google Plus +1 button above or...
We appreciate your support!

latest articles