Thursday, October 29, 2009

Integration of Forms and APEX : Calling APEX from Forms

In previous blog posts (like this, this and this one) I explained how you can integrate (or embed) Oracle Forms within an APEX Page. But yesterday I stumbled upon this question on the Oracle APEX Forum. There someone was looking for a solution how to access an APEX Page from an Oracle Form - so exactly the other way round. And, after some trial-and-error I came up with this solution:

1. Copy the basejpi.htm (or whatever html file you're using in the formsweb.cfg) on your application server to (something like) forms2apex-jpi.htm and reference that in your formsweb.cfg.

2. Edit the forms2apex-jpi.htm and add an IFRAME tag just before the closing BODY tag:
<IFRAME src="http://localhost:7778/pls/apex/f?p=104"
       style="width:800px;height:450px;visibility:hidden"  
       name="APEX" 
       id="APEX" 
       scrolling="auto" 
       marginwidth="1" 
       marginheight="1"
       frameborder="1" 
       vspace="1" 
       hspace="1" /> 
where the src references your APEX app.

3. In the same file, add a javascript function between the HEAD-tags, to call the APEX page (in this example it is an IR and I add a parameter to the call):
<script type="text/javascript">
  function ShowApexPage( pPage, pID ){
    vFrame = document.getElementById("APEX");
    vFrame.src = "http://localhost:7778/pls/apex/f?p=104:"+pPage+"::::RP,"+pPage+",RIR:IR_CUSTOMER_ID:"+pID;
     vFrame.style.visibility = "visible"; 
    }
</script>
and save the file.

4. In your Form add some code to a button or - in this example - to the WHEN-NEW-RECORD-INSTANCE trigger:
ShowApexPage( 12, :CUSTOMERS.CUSTOMER_ID ); 
and define that ShowApexProcedure as a Program Unit (in your Form or Library):
 PROCEDURE ShowApexPage
          ( p_page_no number
          , p_id      number 
          ) IS
BEGIN
 web.show_document('javascript:ShowApexPage( '||p_page_no||','||p_id||');', '_self');  
END; 
And now you're ready to roll....

Of course there are some limitations: It works best when you're using SSO or a Public APEX Page, otherwise APEX will present a login screen first...

Wednesday, October 28, 2009

New cool Quest Tools

Yesterday evening guys from Quest presented their latest cool new tools at one of our company locations. They started with Foglight, a tool for Application Management. Using that tool you can see on one page the status of the applications that are running, where users experience some problems (based on thresholds), the number of users affected and where in the application stack the problem occurs. With a few clicks you can drill down to the actual origin of the problem. Foglight supports a number of application types (like Java, .Net, Siebel, SAP), different types of access (o.a. Apache, Citrix, Rich Clients), multiple infrastructures (Windows, Solaris, HP/UX, VMWare) and different databases (SQL Server and - of course - Oracle).
Foglight uses so called "Quest Collectors" on the web-, application- and databaseservers to sample data. That data is collected in the Foglight Management Server. Apart from that you can use an Experience Monitor and Viewer as a network sniffer.
Quest claims it is an end-to-end performance management tool, but actually the scope is somewhat limited to "just" the servers: storage is not included and for network management there is only a diagnosis and no suggested solution.
Foglight is complementary to Spotlight that has been around much longer. Spotlight is also a very nice graphical tool, but is - much more - limited to only one database instance.
Of course everything has it's price. This cool tool costs around 500 euro per CPU socket. A 'normal' implementation will cost you 20 - 200 kEuro (+ 18% support fee a year).
Also some new features of good old TOAD (v10) where addressed, like the enhanced ER Diagrammer, a new sort of Data Grid (with grouping, colors, hide/display columns etc.), an enhanced Data Generator - that can generate sample data with taking care of referential integrity and Unicode support. All the details are on www.toadworld.com.
The last product they showed was Foglight Performance Analyzer, a tool that has overlapping functionality with AWR, ASH and ADDM (but then without the Oracle Diagnostic and Tuning Packs license). The analyzer uses a StealthCollect memory tool to detect changes to the Oracle memory stack (without having an Oracle connection!) and offloads these changes to a data warehouse. So you can analyze and query the use and changes of your Oracle DB, without actually using the DB itself. Also tracking errors or dumps when the database itself is down is a nice functionality.
All in all a nice informative evening, with lots of tools that I definitely would like to try in a real environment (now I have to find a customer who uses or needs this sort of stuff).

Saturday, October 24, 2009

Want to be a presenter at the Oracle Developers conference?


Developers and architects attend Kaleidoscope to find out how to use the new technologies to make their jobs easier. Your expertise and experience are key to our participants getting their questions answered. Click here to submit your abstract to speak at the developer event of the year.

ODTUG Kaleidoscope 2010 at the Marriott Wardman Park Hotel in Washington, D.C. is the conference for Oracle developers and architects. Kaleidoscope has it all - more than 150 technical sessions, day-long symposia, hands-on training, chats with participants and speakers, and even a community service project.

So far the "offical" advertisement. My personal opinion is that Kaleidscope is the place to be for Oracle Developers. Just because it is at a 'somewhat' smaller scale than - for instance - Oracle Open World (last year there where around 700 attendees), you can speak to whoever is there (and 'everyone' is!). Also the content of the presentations is very good. But don't let that discourage you from entering an abstract! If you have a good subject and a good abstract (and a catchy title could help..) you definitely will make a chance!

Hope to see you there (if my abstract gets accepted....).

Thursday, October 22, 2009

Oracle Application Express Forms Converter Book - Review coming up!

Back from OOW I found the Oracle Application Express Forms Converter book in my pile of mail. I received a free copy - just adding the word 'free' in order to prevent a claim from the FTC... ;-) for writing a review on this blog. I haven't had a change to read the book, although it is only 172 pages, significantly less than the other Oracle related books on my shelf. If you are interested in a review now, please read Marc Sewtz's blogpost - he has already read it and wrote a review. I will try to write the review somewhere next week (with the usual disclaimers applied). If you're curious, you can read a preview chapter of the book here.

Wednesday, October 21, 2009

New article : Integration of Oracle Forms and APEX

When I opened my mail after a week in San Francisco I discovered that my article was published in the latest release of WeLoveIT (a free magazine for Oracle & Java users and developers). If you can read Dutch (or want to try), you can read it either here or here.

Sunday, October 18, 2009

OOW 2009 : Thursday and wrap up

The day started easy: The first session had similar content as the last one of yesterday - which I didn't like too much - and the second one got cancelled. So a late start, what was fairly convenient because of yesterday's party...
The first one was by Arup Nanda about 11g New Features for DBA's. Since 11g is already 'old school', I didn't learned that much: physical / logical / snapshot standby databases (quite handy for testing in a real production environment, performing rolling upgrades and reporting); partition by reference (where you can easily keep master and detail data in the same partition) etc. I was hoping for more R2 stuff, but maybe it is just to early as that version was released just a couple of weeks ago.
The second one was all about Data Security. There are so many features and options regarding that subject. To name a few: VPD, FGA, Encryption, Data Masking, Advanced Security, Audit Vault, Database Vault, Label Security, Secure Backup.... I think it is time for a new SQL command: "alter database set security = high".
The last session of this years OpenWorld was done by Rich Niemiec. He is a great entertainer (throwing candy, bars, chips etc. in the audience, lots of funny stories) and managed to put over 200 slides in 1.5 hour - what was only half an hour over time. This session was also called "11g New Features" - but this time not only for DBA's. And again, not many things that I haven't heard before.
That night Andreas surprised his housemates with a real gourmet dinner (with bison steak). And that was a really good closure of what should become a tradition: the Holland ACE House! Thank you Andreas, Jacco and Marko for your great company this week. And of course a special big THANK YOU for Anjo: He made this all possible!

Typed on my iPod in a shaking plane...

Thursday, October 15, 2009

OOW 2009 : Wednesday

I started off with a good breakfast with my roomies Marco and Jacco. Because there wasn't any interesting session in the first timeslot (or I couldn't find it), I attended the Exhibition Hall - which is mainly the same as previous years. Everyone wants to 'scan your badge' so they can spam you afterwards.
Next there were two sessions I really liked, and - it may or may not be a coincidence - both were 30 minutes 'power sessions'. The first one was by Mark Drake, the Product Manager for XML DB, about Managing XML Content with APEX. Very good job, although having live demo's obviously are a risk...and that's why I like them!
The next one was about Row Level Security / VPD and APEX. The presenter had a good demo and explained the stuff nicely.
I followed the keynote from the OTN Lounge (it is less boring with a beer). It wasn't a surprise anymore that The Governator would attend. Arnold emphasized that technology will deliver the solution for CO2 reduction - he didn't say that technology was also the cause of all kinds of pollution...
Larry's story - the only presentation from Oracle without the safe harbor slide - didn't contain anything astonishing new: Oracle has Linux and VM (that's a three year old story); has an Exadata machine thats an (undefined) number of times faster than the one form IBM (Sunday's news..); My Oracle Support will get better; Fusion Apps are on their way (with demo).
The last real session of the day was Building a Mashup with APEX. The presenter painted out an architecture where you create webservices on your database objects, and consume those in APEX on XE. The reasons for doing so was that
- you don't need a license for XE (that's true, but you do need a license for the underlying database, so that's a non-argument)
- he thought that APEX itself would have a negative impact on the performance of his database (which is obviously also a non-argument, as APEX adds only a very little bit of overhead - and creating extra layers as he suggested will create more overhead)
- the DBA's didn't like the idea for having an 'application in the database': the database is for data, not for applications... (An misconception that some old school DBA's hang on to).

And at night : The Appreciation Event with Aerosmith. And they rocked - especially when you know that Steven Tyler (the leadsinger) is 61!

OOW 2009 : Tuesday

This day started easy by skipping the keynotes. So the first session I attended was at 11:30, called The Life of a Query in which the presenter revealed the details on the internal processing of the Oracle database.
Next was Giving your Application Express a Web 2.0 Facelift. Not that many new things, but Raj is always very entertaining to watch. The most interesting thing I saw was a new prototype of the APEX Developer page on Patrick Wolfs laptop: Instead of the current Page Definition view (with Page, Regions, Items, Processes and so on), the same information was presented in an DHTMLX tree view! Patrick showed how you can easily re-order Items, copy buttons etc by just dragging them around in the tree. And on every object you can do a right mouse click that would present the actions you can do with that object. It looked very slick! We shortly discussed whether or not you should expand that tree with one level (Page) or even two (Application), to make it even easier to copy and move Pages or Regions around. Imagine something like the tree view of your application in Oracle Designer - but then better looking. I guess this prototype won't make it to APEX 4.0, but it shows that the product is still evolving - even after APEX 4.0!
After that Understanding Real Application Clusters for Developers was on the program - I guess using Dummies instead of Developers was to offensive. However it was a reasonable good overview about RAC, but didn't associate about anything that a developer might have to do with it. And the presenter ran seriously out of time....
The last one of the day: Oracle Performance by Design. A presentation full of half truths and generalizations. So no further comments....
In thee evening there were three meet-ups to attend: The Blogger MeetUp, Benelux Cocktail Party and the APEX MeetUp. I had to pick and did the first and the last. Alex G., who organized the Blogger thing this year, also introduced a nice competition. He/she with the most names on their new T-shirt (with the text "I met more bloggers than you"), would win a netbook! So there was a lot of signing going on! Good job, thank you Alex!
And of course, at the APEX meetup al the usual suspects where there. And - as every time - it was really nice to meat each other again!

Tuesday, October 13, 2009

OOW 2009 : Monday

Still suffering from the jet lag I woke up at 6 AM today. Due to all kinds of other 'obligations' I only attended one session today about "How to get 10x improvement of your PL/SQL Application performance time". And that one was all about TimesTen (a.k.a. IMDB - In Memory Database Cache). The session started with a small - alas pre-recorded - demo that indeed showed a 10x performance benefit. But before you all start to move all your applications to TimesTen, be aware that there are 'some' limitations:
- Not all standard PL/SQL packages are available in TimesTen
- You can't call PL/SQL from SQL
- You can't use triggers in TimesTen
- You can't join between tables in TimesTen and the 'real' database
So due to this limitations, you can't run all PL/SQL applications (like APEX!) in a TimesTen database. However it would be extremely cool if you could use TimesTen for APEX (imagine APEX running 10x faster!). So maybe somewhere in the future, but not with the current release.
Next a had a (long) lunch with 16 Logica attendees from all over the world, very well organized by my US colleagues.
After that, I headed to the demogrounds, to take a close look at APEX 4.0. Mark and Anthony where so kind to show me a (private) deep dive into the new features, like enhanced tabular forms (with field validations), Team Development (a sort of integrated packaged application for registering enhancements and bugs, assignments etc), Dynamic Actions and Plug-Ins. This all looks very promising and opens up a whole new set of functionality, that would require a lot of handcraft in the current version. APEX 4.0 is (still) planned for production somewhere in 2010 (I hope it will be in the first quarter!).
Next I went to a hotel where a bus picked me up for a ride to the HP Pavilion in San Jose to see my first ice hockey game: San Jose Sharks v.s Phoenix Coyotes. Very nice to see that sport live in an American ambiance! Thanks to my French colleagues for organizing this!
At the moment of writing this - Tuesday morning - it is very rainy and windy in San Francisco. Rather different from my previous visits at OOW, where the sun always shined... Time to get my umbrella!

Monday, October 12, 2009

OOW 2009 : SUN-rise on a SUN-day

This week I am in San Francisco for my third Oracle Oracle Open World. Because it was my second consecutive visit I received an "Oracle Alumni" tag (for my badge) and a nice jacket during registration.
This Sunday the first session (at 800 AM! - OOW is really hard work...) was by...me! There were around 50 to 60 attendees, and IMHO that's not too bad for a session at that time. The session seemed to be interesting enough for 111 people to include in their schedule, but I guess for a few of them it was too early after all...
The session went ok, not great, but ok. I would rather do a session after being a couple of days in the US, because then you're more used to the language. This one was within 20 hours of arrival.
Right after my session - and a well deserved cup of Starbucks coffee with Edwin - I went back to the "Holland ACE House", where I am staying with Marco, Andreas and Jacco, to drop off my laptop. BTW the house, rented by Anjo (thanks mate!), is very nice. You can see the pictures here. Right after that I went back to the Moscone for some sessions within the ODTUG track. They were all about migration to APEX. One company moved from Access to APEX, another from PowerBuilder / Cobol / to APEX. Another proof that APEX is suitable for smaller (Access like) apps as well as Enterprise level applications.
After that on to the Hilton for a presentation by "Mr PL/SQL" : Bryn Llewellyn, about OnLine Application Upgrade. Bryn thoroughly explained the goal and the use of the new 11gR2 feature "Edition Based Redefinition".
Meanwhile I missed the APEX 4.0 session (I have seen the major part of it at last June's ODTUG), but it was very well received. If you're interested you should take a look at Lucas' blog post.
Then off to the impressive Hall D for the opening keynote of this year's OOW by Scott McNealy, the chair man of Sun. He did a good job presenting two top tens - in an almost Oracle-red sweater. Also on stage came James Goslin, the inventor of Java. Dresses in an old jeans and a baggy T-shirt he perfectly fitted the description of a Java nerd. Scott introduced "his hero" (what sounded a little bit sarcastic): Larry Ellison. Larry, again, stated that Oracle will spend more money on the development of SPARC, Solaris and MySQL than Sun would do. Apple already proved that the combination of delivering hardware and software can be successful, so why can't Oracle do something similar?
The main part of Larry's talk was aimed at IBM. Larry stated that IBM is more expensive, uses more electricity (that's why they call it the "POWER" processor ;-) ) and not fault tolerant. Suns runs Oracle twice as fast than IBM. Larry also announced a new chapter in the Oracle - IBM competition: If your database doesn't run two times faster on Oracle/Sun than you'll win 10,000,000!

In the evening the ACE dinner was organized on a nice location near the Bay Bridge.

Friday, October 02, 2009

Forms / APEX Integration video

I just uploaded a video with a small demo of the integration of Oracle Forms and APEX. The quality is not quite what I wanted, but it gives - some kind - of idea. If you want to see the real (high res) demo, you can visit my presentation at Oracle Open World (at Sunday morning 8:00...) - or at the upcoming UKOUG.