Monday, April 2, 2012

Red Samurai MDS Cleaner V2.0

Here we go, you can download Red Samurai MDS Cleaner V2.0. This tool is designed to work with plain ADF applications, as well as with WebCenter Portal or WebCenter Spaces applications. It allows to delete and edit corrupted or obsolete MDS entries. Functionality summary - search, view, edit and delete MDS customizations for ADF/WebCenter applications. Why we need such tool - MDS is black box and is really hard to revert to correct state when user creates corrupted MDS customizations or MDS breaks by itself. Red Samurai MDS Cleaner is designed to help Oracle Fusion administrators to resolve MDS related issues quickly. There are many ways how to break MDS, user don't need to be Chuck Norris to break it, you know it. We are here to help you.


Key features:

0. Works with ADF/WebCenter 11g PS1 - PS5

1. Plug&Play ADF Task Flow concept. Integrate into any ADF or WebCenter project, assign ADF security permission and you are ready to perform MDS housekeeping

2. Allows to search for MDS entries by package path or file name. Supports wildcard search options

3. Allows to delete one or many MDS files during single transaction

4. Allows to view MDS file content

5. Allows to edit and save updated MDS file content

In order to add MDS Cleaner into your project, register MDS Explorer JAR as ADF Library within JDeveloper:


You will find MDS Cleaner ADF Task Flow inside this JAR, reference it from your project:


Add MDS Explorer ADF Library to the project:


If you want to test MDS Cleaner functionality, make sure ADF application is enabled with MDS functionality:


One of the most typical use cases for MDS, when working with plain ADF application - table column reordering - changed column order is stored in MDS:


Now if you want to review applied MDS customization, open Red Samurai MDS Cleaner and search for employeesView.jsff fragment customization - %employee%:


Press Edit Source XML - it will load customization content for selected file. Here we can see custom order for table columns:


Let's say we want to clear applied customizations completely - so, just delete customization file:


Confirm delete - file is removed and customization entry is cleared completely:


Now if you go back to ADF page with table component, column order will be reset to original one as it was designed by developer.

Let's have a look now into WebCenter Portal application. Red Samurai MDS Cleaner is integrated into WebCenter Portal navigation model:


Don't forget to grant ADF Security permission (any permission, even authenticated role will work) to Red Samurai MDS Cleaner - otherwise it will not be rendered:


We can access Red Samurai MDS Cleaner from WebCenter Portal and view customizations for any portal resource:


I will present WebCenter Composer use case. Assume we have WebCenter Composer, and user added couple of ADF Task Flows:


User decides to edit Composer entry and types invalid EL expression:


This action caused error and WebCenter Composer view is corrupted:


How to fix this? You can export entire MDS package, look through the files - fix files and try to upload entire MDS package again. This is bad practice - because it will conflict in concurrent environment, if other users are doing MDS customizations right now. Answer - use Red Samurai MDS Cleaner, search for Composer page - %comp%:


Open customization file - remove region reference:


Changes will be stored into MDS, do same for Composer Page Definition file. MDS repository was updated:


Go back to the Composer page - it works now, corrupted MDS entries gone away. Let's do one more test:

1. Reorder table columns
2. Deactivate table filter


Search MDS customizations for jobs fragment - %jobs%:


Edit and remove only custom column reordering - save MDS change through Red Samurai MDS Cleaner:


Go back to ADF Task Flow - column order is reset back to the original, table filter remains deactivated as expected:



Next release plan:

1. Option to set MDS label from ADF/WebCenter application

Sunday, March 25, 2012

Red Samurai Tool Announcement - MDS Cleaner V2.0

This is announcement post: very soon, we are going to publish free Red Samurai tool available to everyone - Red Samurai MDS Cleaner V2.0. This tool is designed to work with plain ADF applications, as well as with WebCenter Portal or WebCenter Spaces applications. It allows to delete and edit corrupted or obsolete MDS entries.

You know how often we need to clean corrupted MDS entries, so there is no point to explain offered benefits.

Key features:

0. Works with ADF/WebCenter 11g PS1 - PS5

1. Plug&Play ADF Task Flow concept. Integrate into any ADF or WebCenter project, assign ADF security permission and you are ready to perform MDS housekeeping

2. Allows to search for MDS entries by package path or file name. Supports wildcard search options

3. Allows to delete one or many MDS files during single transaction

4. Allows to view MDS file content

5. Allows to edit and save updated MDS file content



Hopefully this will be life saver for MDS administrators, as there is no such tool available from Oracle (at least for now).

Stay tuned.

ADF BC AM Class Variables - Why To Avoid Them

ADF BC AM class variables - not harmful thing from the first sight. Only until we remember how AM pooling works, keep in mind - AM instance can be reused by different users through AM pool. AM instance object will keep initialized AM class variables from one user to another. This means private data of one user, will be visible to another user. This is not a bug, it just bad development practice to use class variables inside AM instance, when pooling is enabled.

Here is simple diagram, it will help you to understand described use case for sample application - SecurityFormLogin_v3.zip:


Sample application contains AM implementation class:


This class declares private variable - userName of String type:


There is pretty simple custom method, it accepts current user name as parameter and is initializing private variable (if not null). This is important - if not null, means if local variable was already initialized - it will not assign new value. If variable value will be stored inside AM instance object for different users - it will not be null for another user, who will reuse same AM instance. Method returns variable value:


This method is exposed through Client Interface:


Method is invoked from Page Definition, current logged user name is passed as argument:


Let's test it now. Login as first user - redsam:


AM variable was initialized correctly, it shows redsam as user name:


ADF Logger report correct value:


Now logout and login as scott, available AM instance is not destroyed yet and it will be reused from previous user - redsam:


And what we see - after login, still redsam is returned as user name from AM variable. This means AM variable was not null and it was not reinitialized - same AM instance object was used by two different users:


ADF logger reports the same:


If we wait some time, AM instance timeout happens and AM variable will be reinitialized for newly created AM instance - user scott is assigned:


Tuesday, March 20, 2012

Testing ADF BC Proxy User DB Connection in Multi-User Environment

I had a blog post about ADF BC Proxy User DB connection - Extending Application Module for ADF BC Proxy User DB Connection. It was quite interesting to test, how this approach works in multi-user environment, when passivation/activation happens. Good news - I didn't found any problems, all works well, I would like to describe my experiment today.

Sample application - AMExtendApp_v2.zip implements such use case - different users are connecting from the Web, ADF BC creates DB proxy, on stress load - PS_TXN table is used for passivation/activation:


In order to test how proxy user works, I have 3 DB users (APPUSER, HR and REDSAM). Both REDSAM and HR have EMPLOYEES table:


With different data:


Proxy user - APPUSER, doesn't have any tables:


For the stress test, I have disabled AM pool - this will simulate passivation/activation environment:


ADF BC internal connection is left as default - blank, this means it will create PS_TXN table inside proxy APPUSER schema (you can change it to different data source):


There are two users defined in the local security store:


Once page is opened, we set Bind Variable value for VO SQL statement. Bind Variable is set from onload popup (read here for onload popup technique - Opening ADF PopUp on Page Load). Bind Variable is set to 5000 for the first user:


To 50 for the second user:


When navigating through the rowset, passivation/activation happens correctly - bind variable value is not lost:



As expected, PS_TXN table is created inside proxy user schema:


I have tested as well with database connection pooling enabled (read more - Stress Testing Oracle ADF BC Applications - Do Connection Pooling and TXN Disconnect Level). ADF BC proxy user works well with database connection pooling enabled:


TXN Disconnect Level = 1: