Oracle Open World – Larry’s keynote: some announcements

Larry talks first about Fusion Apps.
After a controlled test period, it’s now officially available.

And now for really the first announcement…
Larry Ellison: “Everybody has a cloud, we too need a cloud”
So here it is Oracle Public Could.
Great to see Apex is strongly supported.

You can move your application and data from your datacenter to the cloud and back without a problem.
The Oracle Cloud is based on industry standards(Java, XML, Web services,…).
Pricing is based on monthly subscription, and that’s all, no extra licenses.

A second announcement: Oracle Social Network.
Collaborate, share, application integration, BI Navigation, …
He even gave a live demo of the Oracle Social Network.

All things Oracle

There’s a new Oracle source available:  All Things Oracle.

The aim of All Things Oracle is to provide a gateway to the wealth of information and material available for Oracle developers and DBAs.
The site brings articles and other resources of Oracle experts.
Just to name a few:

All very experienced experts that will bring interesting articles!

I will also contribute to this site.
My specialities are SQL, PL/SQL, Forms and Forms Modernization, so expect articles on these topics in the near future on All Things Oracle.

Get triggering element in dynamic action

Last week, I ran into a problem with a dynamic action in APEX 4.0.

I have a series of 8 images of persons which I generate with PL/SQL. They are all speakers on a conference. Every image is clickable and should insert the name of the speaker in the database.

I gave a class “speaker” to every image. The ID of the image is the primary key of the person in our database. By doing this, I am able to create a dynamic action which I can bind to the JQuery selector ".speaker".

In this case, I wanted to use AJAX to perform my actions so I created an AJAX callback insert_speaker which contained the PL/SQL block with the insert command. Based on the PK of the person, the name of the speaker will be inserted into the database, together with some extra information.

In my dynamic action, I added a true action of type “Execute JavaScript code”. Here, I ran into a problem: how do I get the ID of the image the user clicked on?

On the internet, I found two solutions with JQuery to get the ID of the triggering element of an event:

$(this).attr("id");

and

event.target.id;

There is a little difference between these two, found it out here, so I tested both and concluded I needed event.target.id.

I completed the JavaScript block with the AJAX request, the ID parameter and the other lines and tested the page.
Everything worked perfectly. Well done, I tought…
…untill I tested my page with Mozilla Firefox. Firebug returned an error ‘event is not defined’.

Hmm…and it all worked fine in Google Chrome (I use this browser for application development)? Strange.
After a while of searching, I figured out there is another solution, something specific to APEX:

this.triggeringElement.id;

Sounds logical, but it isn’t when you have no idea this line can be used in APEX.

The only official documentation I could find about this, is the help text of the textarea labeled “Value” in the When block of a dynamic action.
Help text

When I changed

event.target.id;

to

this.triggeringElement.id;

in my code, the page works fine in both Google Chrome and Mozilla Firefox.

For further development with APEX 4.0: make sure you test your pages in multiple browsers!
The example above states  very well that not all browsers interpret code the same way!

Pictogram: APEX Developer – Plug-In Developer

Not every APEX developer should be a Plug-In developer.
The APEX developer uses the Plug-In a Plug In developer has created.

Following photo shows the pictograms we used during our presentation @ OBUG APEX SIG :

Pictogram Plug-In developer APEX developer

Pictogram Plug-In developer APEX developer

During the demo we showed our little green man while we created and elaborated the plug-in via the shared components.

When we implemented the plug in in a page, we showed the pictogram of the little red man.

As you can see the red guy brings different elements of the puzzle together: standard components (red) and a plug-in (the green piece).

UKOUG: Forms Migration

There were a lot of sessions on forms, most of them handled about migration.
So, here’s a little wrap up of the forms migration sessions I followed on the UKOUG conference.

When thinking about migration, you need to think again before making a decision.
Do it for the right reasons, make a good analysis and plan everything upfront.
The right reason is not because there’s a migration tool that migrates everything.
Such tool does not exist.
This is what most experienced people will tell you, unless they sell a migration tool.
Allthough, this is even told by Steven Davelaar(Oracle The Netherlands), who gave two sessions:
– Guidelines for moving from Forms to ADF and SOA
– JHeadstart Forms2ADF generator: Moving form Oracle Forms to a best practice ADF application
Two very interesting sessions on migration.

The first session was about making the decision, the strategy and the pitfalls.
Before you even want to migrate, ask yourself the proper questions and make an analysis:

  • current situation: forms version, designer, how is it used(standard or “creative forms”),…
  • current functionality: integration with standard functionalities
  • current DB model & future plans
  • current UI: need for a redesign?
  • current documentation: if there is none, what are you going to migrate?
  • current end users:  how are they using the application, are they happy?
  • current IT staff: are they eager to learn? (everything will be new)
  • what direction to you want to move to: richer ui, customization & personalization,…

And start with the beginning: pull out the logic from forms!
Well do this anyway, this will leave all options open, no matter what presentation layer.

Migration has a lot of pitfalls, so watch out!
When migrating, a re-design and re-implementation is probably needed.
Steven ended that session with the following sentence:

Make lasagna (layered approach) and/or ravioli (service oriented approach) instead of spaghetti (like most forms application with code and business logic in forms and on the database)

The second session was about the tool JHeadstart and how it can help you in a best practice migration.
He reminded us on the monday session: define a strategy before you start!
He explained what JHeadstart was (not a migration tool!): an ADF generator and a best practice toolkit.
It generates metadata(XML), not code.
A part of JHeadstart is the Forms2ADF generator, it generates metadata from your forms application.
The demo he gave was pretty impressive, he took an old forms application (that he made in 2002) and generated a new ADF application.
But watch out, it doesn’t migrate everything: not one line PL/SQL is converted, it’s only documented though in JHeadstart.
You have to choose by yourself where to implement that code(business logic on the database, forms logic in the different ADF layers).
What are the JHeadstart benefits: autocreated ADF business components, metadata, best practice architecture.
Steven mentioned also OraFormsFaces, this an integration module to let your forms run in a JSF web application.
Definitly check this tool when you’re thinking about moving/integrating forms to/into ADF.

Another session on migration: “Is Apex the new forms?”
Not a great session, but they started also with the same idea as Steven: analyse before migrating and put all Business logic on the database.
The session was given by an employee of PITTS, so of course the migration tool of the company was shown.
This tool takes a form as input and creates an Apex import script.

It was not as detailed as the demo that Steven did about JHeadstart, but maybe it can be used as best practice.
The tool didn’t convince me…it even didn’t convince the speaker, as his conclusion was simple: “Is Apex the new forms?  No!  Or at least not yet.”
At least he was honest: the tool is no silver bullet and there are limitations.

Conclusion: when doing a migration, think…and think again.
Do you have good reason to migrate?
Then analyse.
Don’t try to find the silver bullet…

New Patch available for ApEx 4.0

ApEx 4.0.1 is available for download, if you are running ApEx 4.0 then I suggest you upgrade as soon as possible.

- If you are already running ApEx 4.0 then download the patch from Oracle support, look for patch nr 9976149.
– If you are still running and older version then 4.0 then download ApEx from apex.oracle.com.

The new version nr of APEX is 4.0.1.00.03.