Tuesday, March 29, 2011

Oracle ADF Insider Essentials - Build Your ADF Skills

Make sure to read latest blog post from Grant Ronald - Learning the essential Oracle ADF skills, about ADF Insider Essentials.

Year ago or so, I was discussing with Grant different approaches of helping developers to learn ADF easier. Based on my ADF training experience, I have suggested that standard Oracle training material in most of the cases is too dry and lacks real world examples. Some sort of practical tasks for after class exercises would be great. Nice to see this idea is implemented and available for community now.

I recommend to go through and complete exercises from ADF Insider Essentials after you will pass in class ADF training lectures.

Sunday, March 27, 2011

Automated Single Sign-On through WebCenter PS3 External Application Connection

Every company maintains multiple Web applications, internal or external. In order to make these applications to work together, usually we need to enable Single Sign-On (SSO) for authentication. Typically, this can be very costly and requires advanced configurations. If you are building portal solution with WebCenter PS3, you may avoid complexity by leveraging External Application Connection feature. Read more about this feature from WebCenter Developer and Administration guides - 63.13 Working with External Applications and 25 Managing External Applications. As you can read from developer guide, automated SSO feature is supported for J2EE security container login method j_security_check for authentication. We did several tests with third-party Struts application, where custom made security check was implemented. It also works well, I will share our test results with you in this post.

Download sample Struts application, we are using it as a third-party secured application with its own Login page - struts-blank.zip. There is WebCenter PS3 application, it defines External Application Connection and integrates external Struts application into portal - ExternalAppAccess.zip. You can deploy Struts application on WebLogic server, just extract downloaded archive and point installation wizard to extracted Web folder. All required Struts libraries are already included into sample archive:


To trigger external application automatic authentication, WebCenter menu link must point to ADF external application login servlet. As per documentation, menu link must be defined as following: /adfextapplogin?extappid=applicationName. In my case, applicationName=myExtApp:


This menu item is set to be visible only to authenticated users:


We can deploy and login into our portal application - menu link will be present. However, when user will try to click on it, message saying that external application is not found will be shown to the user:


Its possible to specify External Application Connection during design time, with JDeveloper wizard or directly on runtime. Let's do this on runtime, through WebCenter application administration console. User must be granted at least ConnectionManager role, but in this example let's grant Administrators role. We can do this on runtime as well, no need to redeploy WebCenter application. Just open Enterprise Manager and select WebCenter application - ExternalAppAccess in our case:


Go to the security section and add user redsam to Administrators role:


Now go to WebCenter administration screen, Services -> External Applications section - add new connection:


Application Name must be same as we have defined on WebCenter menu. For User ID and User Password check HTML source code of Login page, in my example it will be user_id and pswd respectively. For Login URL, check form tag and use action property with Login URL string:


In my example, Login URL will have this format: http://server-ip:server-port/Web/LoginSubmit.do. Where Web is Struts application name and LoginSubmit.do is action property value. Authentication method will be POST, as you can see from Login page HTML source. Complete connection information:


If needed, we can provide additional variable values for hidden fields, however our example is not using such fields.

Registered External Application Connection:


Let's login now as normal user, not administrator - redsam1:


Click on external application link - if you will try to access external application for the first time for current user, WebCenter will render automatically External Application Login Information ADF task flow to collect login credentials:


Sample Struts application accepts oracle/oracle for username and password, let's type it and press Login. Make sure you allow WebCenter to remember Login credentials - once authenticated, provided credentials wil remain mapped with current WebCenter authenticated user:


Authentication is completed successfully, external Struts application welcome page is loaded inside our portal:


Now we can logout and login again with the same user, to test if external application login credentials were stored in WebCenter security store:


Click on external application link - authentication for external Struts application is completed automatically this time, the same as it would be done with SSO solution:


WebCenter solution for portal allows to access external third-party application and standard ADF application task flows from the same portal - example of ADF task flow accessed in the same portal:


Now let's logout and login with another user, this time - redsam2. This user was never authenticated with external application, WebCenter asks to provide login credentials:


We can uncheck "Remember My Login Information" check-box and process with Login, in this case username and password will not be stored inside WebCenter security store. But authentication will be completed successfully:


If we logout and login again with the same user redsam2, since login credentials for external application were not stored inside WebCenter security store, user will be requested to provide them again:


You may ask, what we should do, if external application username or password data will be changed. Thats not a problem at all, there is out-of-the-box WebCenter PS3 ADF task flow - External Applications Change Password, we can use it:


Drag and drop it into any fragment or page, reference that fragment or page from WebCenter menu model:


On runtime, login as user redsam1, you will see there is second level menu item will be available - Change Password (as we have specified in WebCenter menu model). Click on it and you will get standard Change Password ADF task flow from WebCenter:


Let's change User Name with wrong value, for test purposes:


Try to access external Struts application, automatic login will fail - we have set not existing user name:


Change user name back to one existing inside Struts application:


User will be successfully automatically authenticated through WebCenter External Application Connection:


Friday, March 25, 2011

WebCenter 11g PS3 Performance Tuning and Iterative Development Mode

If you didn't know already, new WebCenter 11g PS3 supports by default Iterative Development mode. This mode allows more rapid development by reducing redeployment cycles, basically WebCenter catalog and MDS repository information is reloaded and reconstructed on each request. This makes all changes visible almost instantly. Iterative Development mode is supported only when running on embedded JDeveloper 11g WebLogic server. This means, even you will do deployment on standalone WebLogic server with Iterative Development mode enabled, it will be disabled automatically. However, it often happens when we need to do demo or run prototype from embedded JDeveloper 11g WebLogic server. If you are not aware about Iterative Development mode, most probably you will be wondering - 'why it works so slow'. Keep in mind, you should disable Iterative Development mode for better performance, when running on embedded JDeveloper 11g WebLogic server - 1.5.4 Turning Off Iterative Development. At the same time Iterative Mode is very useful during development phase, just don't forget to switch it off, when you will do demo to your boss ;-)

For experiment, I did comparison of both times - when running with Iterative Development mode enabled and without. Download sample application test case, where Iterative Mode is already disabled - WebCenterPerformance.zip.

If you will open Application Properties -> Run -> WebCenter, by default Iterative Development mode will be enabled:


Before I will start explaining different time statistics, let me share with you one technical hint from provided sample application, related to WebCenter Composer. By default, WebCenter Composer Change Model link is enabled always, even when composer editor screen is activated. To prevent this, you can use #{!composerContext.inEditMode} expression language, and render Change Mode link only when its needed:


Sample application imports ADF Library with bounded ADF Task Flows and implements WebCenter menu navigation model:


Imported task flows are enabled for authenticated role:


I will run sample application in Iterative Mode on embedded WebLogic server and will report time statistics. Time statistics are taken on second page load, this means when page was already compiled on runtime. Login action and default home page are loaded in 1.9 sec:


Click on Edit link to change Composer mode, WebCenter Composer load time is 1.16 sec:


Invoke WebCenter menu navigation model by clicking on Departments link - ADF task flow is loaded in 984 ms:


Detail task flow for employees data with read-only table is loaded in 1.8 sec:


Let's switch off Iterative Development mode and test again:


Login action is completed and default page is loaded in 1.18 sec, its much faster comparing to 1.9 sec with Iterative Mode on:


Composer is loaded much faster now, just in 180 ms comparing to 1.16 sec:


ADF task flow is loaded in 172 ms comparing to 984 ms:


Detail read-only table task flow is loaded in 360 ms comparing to 1.8 sec:


You can see that, there is significant performance differences. Similar performance you will get when deploying to standalone WebLogic server. You should be aware of Iterative Development feature and turn it off, when needed.

I don't have goal to compare different browsers, but you should be aware that application performance can depend on which browser you are using. Previous timings were produced with Firefox 3, now I will run sample application (Iterative Development mode is off) in Google Chrome 10. You should take into account and test your application on different browsers for better performance.

In Google Chrome, login action is done and the same default page is loaded just in 376 ms, thats a big difference comparing to 1.18 sec with Firefox:


Composer is opened in 168 ms, a bit faster as well comparing to 180 ms:


ADF task flow is loaded in 146 ms comparing to 172 ms in Firefox:


ADF task flow with detail read-only table is loaded in 227 ms comparing to 360 ms in Firefox:


Thats all about performance statistics. Now let me show you one great feature of WebCenter Portal Framework - external page support. With WebCenter Composer we can add external Web page frame:


External Web page is loaded inside WebCenter/ADF screen - this can be any external page or your corporate third-party Web application:


In my future posts, I will show how you can do automatic login into secured third-party Web applications through WebCenter External Application connection.

Because our default landing page is granted with anonymous public access, even after logout - we still can see resource that was added through WebCenter Composer:


Sunday, March 20, 2011

Video - ADF/WebCenter 11g integration with BPM Suite 11g (SOA & E2.0 Partner Community Forum)

I'm happy to post my video recording for ADF/WebCenter 11g integration with BPM Suite 11g session from SOA & E2.0 Partner Community Forum in Netherlands. By watching this session, you will learn how Oracle Fusion allows to integrate latest SOA/BPM 11g PS3 domain with WebCenter Spaces 11g PS3 domain and how Oracle ADF framework plays key role in this integration. My goal for this session was to provide comprehensive technical information about E2.0 Portal enabled with SOA/BPM ADF Task Flows.

Once again, thanks to Juergen Kress from Oracle SOA Partner adoption in EMEA region for his introduction and enjoy provided material.

ADF/WebCenter 11g integration with BPM Suite 11g (1):



ADF/WebCenter 11g integration with BPM Suite 11g (2):



ADF/WebCenter 11g integration with BPM Suite 11g (3):



ADF/WebCenter 11g integration with BPM Suite 11g (4):



ADF/WebCenter 11g integration with BPM Suite 11g (5):



ADF/WebCenter 11g integration with BPM Suite 11g (6):



ADF/WebCenter 11g integration with BPM Suite 11g (7):



ADF/WebCenter 11g integration with BPM Suite 11g (8):

Saturday, March 19, 2011

Exception Handler for Method Calls inside ADF Task Flows with Pages

I have described specifics of handling exception for ADF Bounded Task Flows with Fragments - Exception Handler for Method Calls inside ADF Task Flows with Fragments. We will look today what are the differences when using ADF Bounded Task Flows with Pages.

Download sample application - MethodCallExceptionHandler2.zip. This sample contains only pages, no fragments. We can press Process Data button to simulate JboException in Method Call activity:


In this case, our application will crash completely:


Process Data button invokes Method Call activity from ADF Bounded Task Flow:


In order to handle JboExceptions, ADF Task Flow Template should have Method Call activity marked as Error Handler:


Make sure your ADF Task Flow is based on ADF Task Flow template with Error Handler activity defined:


Error Handler Method Call activity invokes Java method from Managed Bean, where catched exception can be logged and reported. Its a difference with ADF Bounded Task Flows based on fragments, exception data is shown inside popup automatically. But for ADF Bounded Task Flows based on pages we need to show error popup manually:


There is no browser error anymore, instead user is informed with popup message: