Sunday, June 26, 2011

ADF 11g R2 Improvement - ADF Table AutoHeightRows Property

There are lots of new features in ADF 11g R2, one of them improved handling for ADF Table AutoHeightRows property. Read my previous blog post, to understand how this property was supported in ADF 11g R1 - ADF Table AutoHeightRows Property. In ADF 11g R1 it was working only with ContentDelivery set to immediate for table component (otherwise dynamic height resizing was not happening). Good news - it works now with all ContentDelivery modes.

Download sample application migrated to ADF 11g R2 -

ContentDelivery property is set to default - whenAvailable:

AutoHeightRows is set to be 25, dynamic height resizing happens for less than 25 rows in result set:

Maximum 25 rows are shown, when result set size exceeds AutoHeightRows value:

Saturday, June 25, 2011

ODTUG - Oracle ADF 11g – Driving Power for SOA/BPM/WebCenter 11g Integration

Heading to Los Angeles, ODTUG Kscope11 conference:

I will be presenting there:

(1) Oracle ADF 11g - Driving Power for Oracle SOA/BPM/WebCenter 11g Integration (Abstract ID:149)

Andrejus Baranovskis, Red Samurai Consulting
Session 14, 06/29/2011, 1:45 PM-2:45 PM

Fusion Middleware - Web Center


Oracle Fusion Middleware 11g is industry standard for enterprise applications. One of the key technical advantages of Oracle Fusion Middleware 11g is a unified approach for application development. You can implement and reuse Oracle ADF 11g applications across entire Oracle Fusion Middleware 11g stack. This session will explain how to use ADF Faces components for Human Tasks UI implementation. An application will be invoked in Oracle BPM 11g Worklist application. Also how to call Human Worklow service of Oracle SOA/BPM 11g Suite directly without using the Oracle BPM 11g Worklist application will be demonstrated. The presenter will show how to consume Human Worklow services from custom ADF Task Flows, using standard Web Service Data Control. These ADF Task Flows will implement custom screens for Human Workflow functions - initiate, approve, and reject actions. Human Task payload will be populated from ADF Business Components module. Implemented ADF Task Flows will be invoked and demonstrated inside Oracle WebCenter Spaces 11g environment.

(2) Birds of Feather (FMW BoF) session:

Oracle Universal Content Management 11g and Oracle ADF/WebCenter 11g

The Bof’s will take place on Monday Night in Rooms 203A, 203B, or 203C, at the Long Beach Convention Center, from 7:00 p.m. to 8:30 p.m

Looking forward to meet you in LA !

Sunday, June 19, 2011

JDev 11g R2 - ADF BC Dependency Diagram Feature

Most of the projects tend to contain huge number of ADF BC objects and different dependencies between them. It was always very complex job, especially during refactoring, to understand these dependencies and make sure no Association or View Link is lost. With JDeveloper 11g R2, this job becomes much easier - we are given ADF BC diagrammer tool out of the box. This diagrammer tool can visualize ADF BC Association and View Link dependencies between EO's and VO's respectively.

Let's generate ADF BC objects with Associations and View Links for HR schema. Departments EO will be generated among other objects, let's open it:

ADF BC wizards are coming with additional tab - Diagram. It shows relationships between dependent objects for selected EO:

Diagram relationship feature is supported for VO's as well:

Download sample application -

How to Open ADF BC Configuration Wizard in JDev 11g R2

It might be misleading how to open ADF BC configuration wizard in JDev 11g R2. Same menu option exists as in previous JDev releases - right click on AM and choose Configurations. This should open ADF BC configuration wizard, but in latest JDev release it opens bc4j.xcfg file and lists available configurations. However, there is no option to edit existing configurations (only add or remove):

Property inspector displays some settings for selected configuration, but its only subset of all available properties we can define:

In order to open complete ADF BC configuration wizard, you should go through workaround path and open AM module wizard first and then select Configurations section there:

Select edit option for available configuration, ADF BC configuration wizard will be opened, where we can define AM Pool parameters, etc.:

One more thing to learn about JDev 11g R2 - JDBC Data Source is set now by default for AM database connection:

Monday, June 13, 2011

ADF BC 11g R2 - Java Extended For Oracle Data Type Map

There is one fundamental change in ADF BC from 11g R2. It's not recommended anymore to use oracle.jbo.domain.Number type for numeric data types. As per ADF developer guide for 11g R2 - New Fusion web applications should use the default Java Extended for Oracle type. Java Extended For Oracle as Data Type Map is suggested by default, when you want to generate ADF BC, Oracle Domains type is still supported though:

With Java Extend For Oracle we don't have anymore one single type for numbers, but java.math.BigDecimal, java.math.BigInteger, etc. Somehow, I will miss good oracle.jbo.domain.Number, just think how complicated will be now refactoring - if we need to synchronize and change ADF BC based on customer request, we would need to care now about proper type usage. But anyhow, we should follow best practices and use Java Extended For Oracle type with new ADF applications.

I saw on the OTN Forum today, one issue was reported related to java.math.BigInteger type and ADF BC - Bug: JBO-25029: Domain class BigInteger is not found. JDeveloper11. I wanted to reproduce it with test case - created NUMBER(20) type column (BIG_INTEGER) in database:

EO is generated with all three numeric types - java.math.BigDecimal, java.math.BigInteger and java.lang.Integer - not too happy with this (imagine if database column precision will be changed, we would need to change type accordingly inside managed bean method and ADF BC implementation classes for certain attribute). Imagine into what horror we could end up, if we would need to refactor this EO (and 100 others), and change numeric types:

Run application, without doing any change for auto-generated code and you get error reported on OTN forum - domain class BigInteger is not found:

This error happens, because EO attribute of java.math.BigInteger type is not correctly auto-generated by ADF BC - type is not specified correctly:

Change BigInteger into java.math.BigInteger:

It works well:

Download sample application -

Update from Duncan Mills, posted on ADF EMG related to this blog:

In the limited use case that you explain here where the data model is changeable then you probably want to stick with the JBO Number domain. However, this is a corner case and not representative of most systems so the recommendation to use the new default stands. Saying that, we'll not be dropping the old typemap. It will be there forever, there is just way too much code that uses it, so there is no problem with continuing to use it.

Texas A&M Researchers Innovate & Engage with WebCenter - Video

With Oracle WebCenter, researchers at Texas A&M University are able to spend more time innovating and less time on administration, allowing them to collaborate more efficiently and uncover new discoveries:

Red Samurai is excited to deliver Oracle WebCenter platform solution to our customer - Texas A&M TEES.

Saturday, June 11, 2011

ADF BC Application Module Data Control Hints for JDeveloper 11g R2 ADF Libraries

I got a question from blog reader, based on my previous post - How To Reduce Database Connections and Reuse ViewController Layer. This post is based on ADF library dependencies with ADF BC objects - library is not imported directly into project, but is accessed through proxy library with implemented root Application Module - to reduce opened database connections. However, same application fails to work on design time in JDeveloper 11g R2 (latest release from this week) - IDE wizard returns error about missing Data Control objects. It works on runtime though, means there are no issues with ADF runtime, its something with IDE. However, I would not claim this as IDE bug, I believe that IDE applies best practice approach for how we should consume ADF libraries. There are few hints to keep in mind, when working with latest JDev release and consuming ADF libraries with ADF BC objects (specifically Application Modules) inside. This applies only to those cases, when you are reusing Application Modules from ADF Libraries.

Download sample application - This sample contains three ADF applications developed with JDev 11g R2 - SharedLibsApp (ADF BC reusable components), ADFBCLibsImportsApp (demo how to consume ADF BC libs on ViewController), ADFBCLibsImportsModelApp (demo how to consume ADF BC libs on Model).

SharedLibsApp contains one project with reusable ADF BC objects and Application Module - LibModule, both packaged into reusable ADF library. This library is not referenced directly from other projects, but through RootLibModule AM (another project), which is also compiled into ADF library (same scenario as from blog mentioned above):

Root module library contains root Application Module, it nests modules from another ADF libraries:

Consumer application imports root module library:

However, what happens in newest JDev release in this scenario, for example when navigating through Page Definition elements (referenced from imported nested library through root module) - Data Control iterator is not found (this error is reported in the loop and practically kills JDev, you need restart). This happen for ADF apps implemented with previous JDev versions, its not current IDE bug:

From project structure we can see, there is Library Dependency file - it points to these libraries not imported directly, but referenced from directly imported ones (in our case it points to adflibModelLib):

If we open Data Control tab and try to expand nested module, it also fails to be loaded:

This clearly indicates that, ADF Library dependency fails to bring dependent library into context, its why we can't see it through Data Control.

In order to fix this, you only need to add required library dependency directly:

Now restart JDeveloper - good news JDev 11g R2 restarts really fast, so you don't need to wait that much as before.

No ADF Library dependency file available anymore:

Data Control is constructed correctly this time:

Page Definition objects are loaded correctly as well and are accessible:

Page is loaded on runtime as well:

This case is clear now, lets explore one more scenario - ADF library with ADF BC imports into Model project. Let say our ADF library contains two Application Modules:

Library is imported into Model project and both Data Control instances are appearing correctly:

However, once we enable ADF BC support for local Model project:

Data Control instances are disappearing:

If we double check imported objects, both AM's are present:

It may look wrong for you, but I would assume its correct behavior in JDev 11g R2, even same was working in previous release. If we import AM instances into ADF BC Model project, it would not be a best practice to reference different AM's separately through Data Control - lots of database connections would be opened. Instead of exposing imported AM instances directly through Data Control, we can nest them into local AM:

Now both imported AM's are accesible from Data Control through root local AM:

If you dont want badly to nest imported AM instances into local AM, there is still a trick you can apply - but I don't recommend it. You can open Model.jpx file and add imported AM instance there manually:

However, this would be a bad practice - Model.jpx gets regenerated quite often automatically and you will loose your manual changes. And as I already explained, its good to nest imported AM's, to prevent large number of open database connections. When Model.jpx is changed manually, imported AM instance becomes visible - until Model.jpx is not regenerated by JDev:

Tuesday, June 7, 2011

WebCenter 11g PS3/PS4 Aggregating Multiple WebLogic LDAP Security Providers (Virtualize = True)

There is one tricky thing about WebCenter 11g PS3/PS4 services you should definitely know. Its related to WebLogic LDAP security providers. WebCenter always consumes only first WebLogic security provider from available providers list. Even SUFFICIENT flag is set for security provider, WebCenter still is using only first one. Thats sounds like a huge limitation, indeed it was before WebCenter 11g PS3/P4 - it was documented. But know situation is much better, we are not constrained anymore with only one single LDAP security provider configuration on WebLogic. I will describe in this blog post, how you can enable virtual aggregator for all defined security providers in WebLogic, so WebCenter will be able to retrieve user data from multiple LDAP servers. For additional info, I would recommend to read WebCenter Developer Guide - 28.7 Aggregating Multiple Identity Store LDAP Servers Using libOVD and Oracle FMW Security Guide Configuring Multi-LDAP Lookup.

Sample application is based on WebCenter People Connections service - Profile:

In case if we would authenticate with user from 2nd or 3rd LDAP security provider, WebCenter service would fail to retrieve user larry information:

However as you can see, ADF authentication is completed successfully - this means security providers are configured correctly. ADF authentication works well, because first security provider is set to be SUFFICIENT, however same rule is not working for WebCenter services:

User larry is defined inside StudentsProvider, however WebCenter is always using only first provider - ProffesorsProvider to look for users info:

Let's fix this, according WebCenter PS3/PS4 and Oracle FMW Security documentation instructions. These instructions looks complex, but at the end it all fairly simple. Open Oracle FMW Enterprise Manager and select WebLogic domain, where your WebCenter application is deployed - wc_domain. From menu go to WebLogic Domain -> Security -> Security Provider Configuration:

Expand Identity Store Provider and press Configure button:

Add new property to Identity Store Configuration - virtualize = true:

This will virtually merge available security providers into one and WebCenter will be able to retrieve user information, no matter where it is defined.

New property is successfully added, all security providers will be virtualized into one now - no matter what order is defined:

Restart WebLogic server and here we go - we are cool again - user information is retrieved from LDAP, defined as second provider in the list:

Download sample application -

Monday, June 6, 2011

Hard Core Advanced ADF Training - Last Minute Call

There are only few seats left for Hard Core Advanced ADF Training in Portugal on the 20th - 24th June with Frank Nimphius. Make sure you will not miss this event.

If you are not scared of hard core training and ready to complete ADF exercises - this training is for you. No ADF newbies accepted - only customers/partners with ADF production systems.

Official training info from Juergen Kress:

For Oracle Specialized partners who are working on the following projects / opportunities, we offer these advanced summer camps:image
All training sessions will be from HQ product management. The sessions will take place from June 20th until June 24th 2011 Lisbon – Portugal 2011. Participation is limited to two people per company. Registration is handled by first come first serve, please pay attention to the skill requirements, the pre-requisitions and the follow up! We will not accept people onto the training who do not match the criteria!
To receive future training invitation become a member in the SOA Partner Community: Visit and sign up for the SOA Community (OPN account required)

Thursday, June 2, 2011

Understanding ADF BC View Object Instances

Its quite easy topic, but sometimes is confusing, especially for ADF newbies. I will try to explain today, how View Object instance works and what you should know when using the same View Object instance across different ADF task flows.

Sample application contains two bounded ADF task flows, both of them are referencing the same View Object instance - EmployeesView:

Same View Object instance is accessed programmatically as well, from custom Application Module method:

As described above, Application Module is exposing single View Object instance:

This is most typical mistake, when developers want to access the same View Object from different forms, they are assuming they can access the same View Object instance. However, this may be conflicting behavior.

First ADF task flow is loaded, first record is shown:

Open second tab, to load second ADF task flow and filter data for First Name:

Go back to first tab - open first ADF task flow, data will be filtered as well:

This means, even we are using two different ADF task flows - same View Object instance is sharing same data.

Custom method from Application Module is returning same results, View Instance is filtered and first row is not pointing anymore to original first row:

Let's fix this data conflict behavior and add one more same View Object instance into Data Control:

Application Module custom method is changed to consume newly added View Object instance as well:

Page Definition from one of the ADF task flows is refactored, now Iterator points to new View Object instance from Data Control:

Second ADF task flow is filtered:

Differently than before, now first ADF task flow is not affected anymore by changes from another ADF task flow - it still brings all records, as we would expect when using different View Object instance:

Programmatic method returns expected results as well - data is not filtered from another View Object instance:

As you can see, if different ADF task flows are using same View Object, you should avoid using same View Object instance - unless its expected behavior to maintain same set of rows in both task flows (which is not often practical use case).

Download sample application -