ADF & JHeadstart
Intercepting user customization – such as column reordering in tables – in ADF 11g change persistence
Feb 4th
The requirement I was facing was simple: act on column reordering through user drag and drop in a rich table. More specifically: invoke a method in a managed bean whenever the user changes the position (or side or visibility) of a column.
At first it seemed trivial – just use an AttributeChangeListener. When that turned out not to work – this listener does not get triggered for column reordering – the challenge turned almost unsurmountable. Finally I ran into the ADF Change Persistence framework and more specifically into the concept of a ChangeManager. See for some background this article that I wrote a long time ago: http://technology.amis.nl/blog/4595/adf-11g-persisted-run-time-user-ui-personalization-or-impatient-mans-mds. Some background can also be found here: http://docs.oracle.com/cd/E15523_01/web.1111/b31974/ad_persist.htm (Fusion Middleware Fusion Developer’s Guide for Oracle Application Development Framework 11g – 35 Allowing User Customizations at Runtime).
In short: enable user customizations and configure a custom class that extends from ChangeManager to intercept the customizations.
Sharing session state between JEE web applications through WebLogic session descriptor of sharing-enabled
Jan 18th
Session state in Java Web application is associated with a single (user) browser session on the one hand and typically with a specific web application on the other (server side) hand. Session state is created and maintained in the context of a usually a single web application. However…
We ran into a situation where our web application was assuming gigantic proportions. To complex to quickly deploy or even easily build, compile and test. On closer inspection, it was quickly revealed that the application really consisted of a number of relatively independent modules – say one for each of the options in the main menu and one for the entry point – main menu, login, manage user preferences etc. From a functional point of view, the big web app monster was by and large a collection of almost individual web applications. Almost because a substantial number of navigations took place between pages in these modules. And some context data – including credentials – should be passed on these navigations. The application was developed with such information stored in the session scope – as all modules always have access to a (shared) session scope, it was thought.
We got to the point where for many reasons we would like the big fat web application to be split in one web application per module. This would allow much easier development, administration, release management etc. However, we could not resolve this issue of shared session state that should be maintained across the web applications-per-module.
We contemplated moving this shared session state to a memory grid – but the impact on the existing application would be quite substantial (although an interesting challenge: introduce a new scope for managed beans (superapplication, cross-application or application-cluster) and create an EL resolver that knows where to find beans referred to with expressions like #{super-application.bean.property}; find a way for all applications in the applicationcluster to identify a user session in the same way to ensure the bean instance associated with the current session in the current application is retrieved).
An easier solution presented itself – after briefly conferring with Mike Lehmann of Oracle’s Application Server team – in the form of WebLogic Server’s session sharing capabilities.
Using custom functions in EL expressions in JSF 1.x
Jan 17th
EL expressions are one of the main driving forces for JavaServer Faces. Most dynamic characteristics of pages and widgets are governed by EL expressions. In JSF 1.x, there are some limitations for EL expressions that can at times be a little frustrating. One of the limitations is the fact that no custom functions or operators can be used in EL expressions. Quite some time ago, I wrote this article – http://technology.amis.nl/blog/622/how-to-call-methods-from-el-expressions-pre-jsp-20-trick-for-jsps-with-jstl – to demonstrate a trick for using a Map interface implementation to access custom functionality from EL expression after all.
However, things can even be better. Rather than jumping through the somewhat elaborate hoops of implementing the Map and consructing complex EL expressions, there are two other approaches. One is to create a custom EL Resolver can configure it in the faces-config.xml. Another is discussed in this article. It involves registering custom Java methods as eligible for use in EL expressions. And that really makes life a lot easier. It allows us to create EL expressions such as:
#{cel:concat (cel:upper( bean.property), cel:max(bean2.property, bean3.property), cel:avg(bean4.list))}
or
#{cel:substr(bean.property, 1, 5)}
Weird ADF 11g requirement addressed with left outer join and modern SQL join syntax
Dec 13th
The functional requirement was a little unusual. The page should either show all master-records or – depending on the value of a parameter – it should show exactly one master-record joined with exactly one detail-record. The use case was valid – that was exactly the functionality that was required.
In terms of EMP and DEPT -I like to always simplify things to express them in EMP and DEPT terms – , we should either see all Departments (and no Employee data) or we should see the data for a specific Employee joined with the data for its corresponding Department. And of course we just one to create a single page, and make it as simple as possible to create that page.
A simplistic page that supports this functionality could like this:

when a specific Employee is requested and

when all Departments should be shown, because no single Employee is asked for.
The Future of Forms is ….. Forms (and some friends) (UKOUG, 2011 – with Grant Ronald)
Dec 11th
Slides for the presentation I did with Grant Ronald during UKOUG 2011, last week in Birmingham. The abstract for this presentation: “Many organizations run enterprise Oracle Forms applications created in the 90s. They now wonder about the future of their application.This session tells how modernization of the application landscape could take place, using a mix of the latest version of Forms and other technologies like SOA, ADF and perhaps APEX.
Forms 11g integration and extension points are discussed and demonstrated. Forms applications serving internal, professional user groups today are typically by and large suitable for continued use. Modernization of these applications therefore typically focuses on integration – with a SOA environment and Event infrastructure and with new user interfaces and Portals – and to some extent to enhancing user experience and functionality of the application.
This session shows how Forms 11g – part of Fusion Middleware and running on WebLogic Server – can be integrated in a modern Service Oriented Architecture and how it can be embedded in Web 2.0 Portals and Applications. The audience will see how Forms can quite easily get a face-lift – to bring it on par UI wise with other modern applications. The session will also discuss when other technologies such as ADF or APEX might come into mix.”
ADF 11g – close popup with taskflow inside or complete taskflow inside popup
Dec 1st
Sometimes apparently complex things turn out to be very simple to achieve using ADF. And occasionally it is the other way round: things that seem to simple that you never gave it a second thought are in actual fact not so straightforward after all.
One example of this is the situation when a taskflow is embedded in a popup component through a region binding. The taskflow is of course not aware of the fact that is part of a popup. When the taskflow completes, the popup should probably close. Vice versa, when the popup is closed, the taskflow should probably be completed (to ensure that when the popup is next launched, the taskflow starts in the initial activity and not with the siuation and state that existed at the time of closing the popup). However, how can the embedding page in which the taskflow is embedded and that contains the popup inform the taskflow of the fact that it should complete?
Respond to end of download in ADF 11g – using poll, clientListener and fileDownloadActionListener
Nov 30th
The situation: in an ADF Faces 11g page, we have a popup with two buttons: one to start a download and one to cancel the popup. When the users presses the download button, a fileDownloadActionListener is activated, the corresponding server side method is invoked to start producing the content to be downloaded and eventually the browser will prompt the user to open or save (or cancel in the case of IE) the download.

The challenge: when the download commences, the download and cancel buttons should be disabled and perhaps an animated gif should be shown to suggest progress (we want to at least prevent the user from clicking the download button or getting frustrated in other ways while she is waiting for the report to be produced on the server side). When the download is complete – that means: when through the browser interaction the user has saved, opened or canceled the actual content download to the browser – the buttons should be enabled again and the animated gif can be removed.
In short: we want to be able to react – both to the beginning of the download as well as to the completion.
Synchronize ViewObject Queryies by dynamically linking bind parameters
Nov 28th
The functional requirement for my ADF application was fairly simple: the values used for the bind parameters in one ViewObject should be reflected for a second ViewObject. In more functional terms the requirement was the following: when we filter the master records – Employees – by begin year and end year (to only show employees that were hired between the begin and end year) the details – Job History – should also fall within the perioded limited by begin year and end year. The end users complained that when they had set the begin year and/or the end year, they did not like to get job history records that were completely outside that range (even though stricly speaking that is correct).
A similar requirement would be for example when a page shows both orders and complaints for a specific customer and the orders are filtered by date to also have the complaints filtered by that same date.
It is possible to resolve this in the web tier – to retrieve the value of the bind parameters for both ViewObjects from the same bean property. However, when the model based query component is used, the value of the bind parameter is not readily accessible from the web tier.
Fortunately, and often easier to realize, the value of one bind parameter can be bound to a bind parameter on a different ViewObject.
Manage Agility through Manage-ability – Introducing Design Time at Run Time in Oracle Fusion Middleware
Nov 10th
Below is my presentation from the OGH DBA, SOA & BPM Day on November 8th. My talk was about achieving instant agility with application, through the ability to manipulate behavior and look & feel of applications at run time. And also to provide various flavors – parallel versions – of the application through customization.
Oracle Fusion Middleware has built-in infrastructure to provide run time agility as well as customization. This infrastructure is commonly referred to as ‘design time at run time’ (and lately also the Fusion Extension Platform). It is based on MDS (meta data services) Repository and a bunch of run time, WYSIWYG tools: the composers.
To make agility work through design time at run time, it is adamant that organizations clearly define the roles and the process associated with it. And finding staff to play the role of ‘run time application editor’ will not be easy.

