Saturday 30 May 2009

Checking an Authorization Scheme within a PL/SQL Block

Recently, I had a quite tricky requirement where within a customer application I needed to check if user has a required role to run a process, edit a field or see an information. Many times these conditions were a combination of different authorization schemes and other rules determined during the runtime of the application. So the problem was not solved by just adding an authorization scheme to the object. More than one authorization scheme needed to be checked together with some other conditions. Using the apex_util package and the function public_check_authorization I was able to successfully acomplish those tasks. This is a modified example of the code I used there:


BEGIN
IF ( apex_util.public_check_authorization ('AUTH_GROUP_1')
OR apex_util.public_check_authorization ('AUTH_GROUP_2')
)
AND :p12_status = '0'
THEN
RETURN TRUE;
ELSIF ( apex_util.public_check_authorization ('AUTH_GROUP_2')
OR apex_util.public_check_authorization ('AUTH_GROUP_3')
)
AND :p12_status = '1'
THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
END;

Execute Javascript through PL/SQL

Sometimes, like in this case, where I needed to set the focus on load to a specific line in a table when inserting new rows, you need to execute javascript within your PL/SQL block. In this example in my Demo Application you will find an explanation of the code you need for that.




Friday 29 May 2009

Switch between Apex Versions

This is a part of the apex documentation but the fact is the most of us simply don't know about it. I have several customers and those customers have different versions of Apex installed. I am using XE on my Laptop to develop their applications. Therefore I need to be able to use different versions of apex simultaneously. With a help of the two simple scripts wrapped into an executable, I can switch between the versions in seconds:

ALTER SESSION SET CURRENT_SCHEMA = FLOWS_030000;
exec flows_030000.wwv_flow_upgrade.switch_schemas('APEX_030200','FLOWS_030000');

to switch to the version 3.0.1 and

ALTER SESSION SET CURRENT_SCHEMA = APEX_030200;
exec apex_030200.wwv_flow_upgrade.switch_schemas('FLOWS_030000','APEX_030200');

to go back to the latest release 3.2.

Thursday 28 May 2009

One Million Pageviews per Year

There are 1226 registered users of my workspace on apex.oracle.com. Arround 300 of those are still active. Many of those inactive accounts are using a download of My Demo Applicatiion installed localy.



If I run Google Analytics for the last 12 months I will get a nice analysis of the visits which says the following:

1. 1,001,992 Pageviews

2. 104,510 Visits

3. 9.6 Pages per Visit

4. 8.25 Minutes - Average Time on Site

These statistics do not include the clicks and visits done within the workspace while investigating the code behind the single pages. At peak times the application reaches 6000 pageviews a day.


Saturday 16 May 2009

New Training - September 2009

I was too busy to post about our sucessfull training in March this year. It is nice to see how the apex community is growing. It looks like every company using oracle is sooner or later going to consider using apex to build their applications.

We decided to schedule our next training for September of this year. More details you can find here.

Ich hatte kaum Zeit in den letzten Monaten. Auch nicht, um über unser letztes Training im März zu berichten. Die Anzahl der Teilnehmer übertraf unsere Erwartungen. Die Anzahl derer, die es aus terminlichen Gründen nicht schaffen konnten war ebenfalls sehr gross. Wir haben deswegen entschieden einen weiteren Termin im September zu organisieren. Wenn Sie Interesse haben, können Sie hier weitere Details über dieses Training finden.