Archive for October, 2008

ADF 11g RichFaces – handling the client side double click to invoke a server side operation

 

Selecting a row in a table with search results to drill down to its details is a fairly common operation in web application. I have implemented such functionality many times, in web applications based on JSP/TopLink, JSP/BC4J, JSF/Pojo, ADF 10g Faces/ADF BC. They are all similar, and they are all different. Today, I will do this in ADF 11g RichFaces on top of ADF BC – although the Model implementation is hardly relevant.

I am quite convinced that there are several ways to implement this functionality. I just picked one – and it works. Based on this article, you can easily achieve other results, for example from a single click on a table row (selection event) or a keypress on a row. My implementation will absorb the double click event on a row in the table and take the user to the detail page with the edit form for that record. The double click is captured on the client, transformed to an event that is queued and consumed by a server listener that invokes a managed bean. The method on this bean that retrieves the selected row from the table – the source of the event – and navigates to the Form Page. This page has a BindingContainer that executes the setCurrentRowWithKey to ensure the right (selected) record is presented for editing.
Read the rest of this entry »

ADF 11g RichFaces – creating an alternative re-parent detail records using popup and drag & drop – assigning Employees to another Department in an intuitive way

The context: ADF 11g RichFaces. Reassigning details to another master can be done in several ways. One is through the Shuttle component, another using drag and drop in trees as my colleague Luc Bors demonstrated earlier on this blog. This article discusses yet another method, which involves showing details in a popup window and dragging them from that window to their new master record. Of course I will demonstrate this functionality using Employees and Departments.

In a previous article I demonstrated how you can create a master-table detail-table page for Departments and Employees. I then added a popup window to the page, to show the Employees for the currently selected Department. The popup window can be opened from a button in the table’s toolbar. When we navigate through the departments table, the popup window is synchronized.

We are going to build on top of that article and that application by adding functionality that allows the end user to select one or more Employees in the popup window and drag them to one of the Departments. By doing so, the Employees are reassigned to a new department, the model is updated and they will disàppear from the popup window they were dragged from.

Read the rest of this entry »

ADF 11g: Model driven display properties in Pojo based Data Controls

 

ADF 11g allows us to specify display hints, validation rules and a lot of other declarative settings for Attributes in Pojo based DataControls. These specifications influence the way display items based on these attributes are displayed and how they behave. Note: most of the default display settings based on model based settings can be overridden in the application. Note that this does not apply to for example the Validation Rules.

In a previous post, I suggested that the ViewObject in ADF BC seems to be taking over the role as DataControl – suggesting that even in a Pojo based scenario (for example with WebService proxies) a ViewObject should be used as the ultimate linking pin to the View (see:The rise of the ViewObject – or: isn’t the ViewObject the real Data Control?). The functionality discussed in this article demonstrates that we can do more for Pojos than I realized when writing that article. However, POJOs are still not ViewObjects…

Read the rest of this entry »

ADF 11g RichFaces: implementing a ‘pick which columns to show & hide’ feature for RichTables

 

Just over two years ago I wrote an article on this blog – integrating-adf-faces-and-myfaces-tomahawk-creating-a-popup-with-adf-faces-shuttle-component (supported by Changing the order of columns in a JSF Table Component -in the client, at run-time, by the end user and having-the-end-user-hide-and-display-columns-in-a-jsf-table-component) – on how to implement functionality in ADF 10g applications that allowed the end user to bring up a popup window associated with a table. In this window, she can select the columns to display in the table and determine their other. This means for example that you can define a table with 25 columns, specify only five or so to be displayed when the page is first displayed and have the user select a different set of columns to display. In specific situations this can be very useful functionality – and at the very least it looks cool in demos.

The ADF 10g implementation is not extremely straightforward. It entails using the Apache MyFaces popup component and leveraging the ADF Shuttle Component. Some additional wiring with a managed bean is required. Not too hard, but not very elegant either.

I thought to implement this feature with the ADF 11g RichFaces components. I figured with the native popup component it would be a lot simpler to implement and look better as well.

So I got started. And guess what? …  It is takes two lines of code. It’s already there, in the RichFaces components themselves. Where’s the challenge?

Read the rest of this entry »

ADF 11g RichFaces – Details popping up all around us – Quick introduction to the ADF 11g Popup component

 

One of the valuable new components available in ADF 11g RichFaces is the Popup component. While one must be careful not to overuse all the new tools in the RichFaces library, there seem to be several use cases for the Popup. And using the Popup component is really easy. In this article I will demonstrate how ridiculously simple it is.

Read the rest of this entry »

Kennismaking met Grids – demo & workshop Oracle Coherence (dinsdag 28 oktober, 16.30 uur)

Het is wat laat, maartoch wil ik jullie met nadruk wijzen op en uitnodigen voor de Kennis Centrum sessie die morgen (dinsdag 28 oktober) plaatsvindt bij AMIS. Deze sessie gaat over Grids – een van de hot topics van zowel JavaOne 2008 als Oracle Open World. Grids, zowel Data Grids als Compute Grid, zijn snel in opkomst. Als oplossing voor performance, schaalbaarheid en beschikbaarheid. Voor zowel web applicaties (delen van session scope), (database) persistence oplossingen als SOA architecturen inclusief BPEL en ESB.

In deze sessie gaat Peter Ebell resultaten delen van vele uren uitzoeken, denkwerk, navragen bij product managers en overleggen met grid specialisten op diverse plekken in de wereld. We zullen kijken naar en discussieren over de plek van Grids in architecturen – wat gaat de rol van Grids zijn in de komende jaren. Wat kan een Grid doen voor Web Applicatie en/of SOA Applicatie omgevingen.

Daarnaast gaan we ook hands-on aan de slag: hoe integreer je een grid in je eigen applicatie? Hoe zet je objecten in het grid en hoe query je data vanaf het grid. Welke design patterns spelen een rol?

De sessie maakt gebruik van Oracle Coherence voor de hands-on. Open source alternatieven als TerraCotta en GridGain werken op vergelijkbare manieren, dus je krijgt een goed beeld van hoe je grids vanuit je eigen code kan aanspreken.

Deze sessie is zeer de moeite waard voor (technisch) architecten, infrastructuur-specialisten en ervaren Java ontwikkelaars. Ook beginnende Java ontwikkelaars kunnen prima meedoen – het gebruik van Coherence vanuit Java code is zeker niet het meest ingewikkelde wat je ooit hebt gedaan!

Heb je interesse – je kunt je aanmelden via http://www.amis.nl/activiteiten.php?id=644 – dan zorgen wij voor een warme maaltijd.

Creating a Salary Heat Map with the ADF 11g Faces PivotTable component

 

A heat-map according to the definition found in Wikipedia is "a graphical representation of data where the values taken by a variable in a two-dimensional map are represented as colors." This representation is used to quickly interpret a potentially large number of values in what can be sizable grid of values. Heat-maps are used to find hot-spots and cool areas – to determine for example deviations from the average or threshold value.

This article shows how the PivotTable in the ADF 11g RichFaces Data Visualization Tags library can be used to create such a Heat Map. In just a small number of simple steps, this heat-map can be realized. We will see this in an example: a heat-map based on the grid of Job vs. Department with average Salary in the cells. The heat-map should quickly tell us which jobs and which departments pay well or lousy.

Read the rest of this entry »

Advanced Concurrency control in BPEL Flow – controlling the execution of parallel branches

 

In a previous article I discussed the parallel execution of activities in BPEL, more specifically in Oracle BPEL PM 11g (TP4). This article concluded that true parallellism hardly exists. The branches within a Flow get their chance in turns to execute their next step. Not until an activity is complete in one branch can the next branch take over and make one step. The only exception I was able to determine was the Receive activity that waits for an Asynchronous Service to call in with its results – when a branch is executing the Receive (waiting!), other branches can continue with their next step. It seemed that normal Wait operations and Synchronous calls (with nonBlockingInvoke set) should also free the lock the current branch has and allow others to run, but I could not observe that behavior in Technical Preview 4.

I hinted in that article that we can take more control over the way the activities in the parallel branches are executed. Right now it seems that when a Flow executes, the BPEL PM determines when which branch gets a chance to run, whereby it seems – though I do not know whether that is guaranteed behavior – that the branches (BPEL sequence activities) get a turn in the order in which they are defined in the BPEL process and one activity at a time. In this article we discuss the <link> element that gives us a little more control over when an activity is ready to run. It allows us to define dependencies between activities in different branches in the Flow. Read the rest of this entry »

The Composite Service engine – The future role of BPEL – filling the niche between Enterprise Service Bus and BPM engine?

 

One question that keeps me awake at night is not exactly the position of BPEL within SOA in time to come. However, during the day, that question does keep popping up in my head. In today’s SOA technology landscape, it is not a trivial question. In fact, I heard on Oracle ACE Director quote as having declared: "BPEL is dead", referring to BPA/BPM as the extinguishers. While I am not prepared to make such extreme statements, the position of BPEL is one that justifies some deliberations.

A few years back, SOA in my mind was almost synonomous to BPEL. Read the rest of this entry »

Investigation into the true parallellism of the Oracle BPEL PM Flow activity in 11g (Technical Preview 4) – on flow, sequence, wait and (a)synchronous calls

 

The Flow activity is used to configure parallel activity in BPEL processes. In theory, activities contained in two or more branches (sequence containers) inside a Flow activity are executed in parallel. However, some sections in the BPEL PM documentation raise some doubt: "By default, Oracle BPEL Process Manager executes in a single thread, executing the branches sequentially instead of in parallel". I am not sure exactly what this means. But it certainly suggests that what I assumed to be pure parallel branches are in fact activity sequences that are both carried out, but sequentially! Time to investigate…

In this article, we will go through a number of steps to ascertain what exactly the parallellism for the Flow activity is. Note that I did this research in the 11g TP4 release of the SOA Suite. I will repeat the analysis in the 10g stack – as some findings seem erroneous and are perhaps due to the status of the Technical Preview. Read the rest of this entry »