MDS functionality in Oracle Fusion 11g is really cool, and it makes Oracle ADF very competitive comparing to other development frameworks. You can read about personalization and customization support - Applying Personalization and Customization in Oracle ADF 11g and Oracle WebCenter 11g. However, most of the customers are asking, how they can manage MDS metadata repository effectively. In the current release of Oracle Fusion 11g, we don't have MDS metadata repository browser, its not easy to track who and when did MDS personalizations or customizations. Because of lack of MDS browser/editor, people sometimes can see a risk to implement systems with MDS functionality, no one wants to have black box as part of IT infrastructure. I have provided this feedback to Oracle Product Managers, I'm sure in the future we will have MDS browser/editor tool. I will explain, what functionality we can use today, for MDS repository management.
As a sample application for this post, I will use one application from my OOW'10 session - MDSManagement.zip. This sample contains WebCenter 11g application and two separate applications with ADF Regions, these regions are consumed from WebCenter 11g Composer component.
I'm deploying sample application on standalone WebLogic server, with WebCenter framework libraries installed. Also I have created my own MDS repository in database - mds-customapp. I'm using this repository for current blog post article:
First I will test WebCenter personalization scenario and login into application as user john:
You can use WebCenter Composer to add one of available custom ADF Task Flows - Employees Graph:
Graph is rendered fine, personalization information is stored in MDS repository:
Let's do MDS test now - I will refactor Employees Graph ADF Task Flow path and redeploy the same application. This should break my application for user john personalizations. It will happen, because MDS will store old ADF Task Flow path and will fail to load it from refactored application - we will see it now. This is valid real life scenario, it might happen that we will need to do refactoring for custom ADF Task Flow:
We can refactor it into another folder and redeploy application:
Now when we try to open redeployed application for user john, it breaks and generates exception - funny one (its because this user have personalized refactored ADF Task Flow):
I'm sure you saw this exception while developing applications with WebCenter Composer - oracle.adf.share.exceptionViewScopeException. This exception may happen, if MDS repository metadata is out of synch with application structure, its what happened in my example.
Now we need to open Oracle Enterprise Manager and navigate to MDS repository screen for our sample application:
The main goal is not to break personalizations of other users, so we don't want to clear entire MDS repository, but we want only to remove corrupted personalizations of user john. Because we don't have MDS browser/editor, its a bit complicated, but still possible. I will describe MDS repository recovery for specific user through series of steps:
1. MDS export
We need to know MDS repository structure, in order to know it - we need to export MDS repository and browse it folder structure. Export MDS repository into archive file:
Export is done successfully - 3 documents were exported:
2. MDS Labels
It is a good practice to create MDS label. This will allow us to revert MDS repository in the future, if there will be a need. However, it reverts complete repository for every user, so its not really useful in practice, when multiple users have different personalizations - these personalizations will be lost. Anyway, its a good practice to create MDS repository back up, before changing it - let's do it.
You should open Runtime MDS Browser (its not really a browser, just set of MDS commands, we can't see real MDS repository structure):
Go to Operations tab and select createMetadataLabel command:
Provide meaningful name and create MDS label:
You can invoke listMetadataLabels command to see all labels available:
List of labels we could revert in the future:
3. MDS repository structure
We don't want to revert our MDS repository blindly to initial MDS label and loose all users personalizations. We want only to clean broken personalization for one user - john. So, we need to know what MDS documents we should delete. Because there is no MDS browser, we need to check this manually through exported MDS folder structure. There are two places available with user john personalizations. First one is page definition:
And then page itself:
Remember both paths, you will need them for the next step.
4. WLST Script for MDS Management
In previous step, we have identified two MDS documents to be deleted. Will run WLST command - deleteMetadata, to delete them. Need to provide three parameters - application name, server and document to be deleted names:
Make sure you delete both documents related to user john:
MDS repository was cleaned up, now application should work for user john as well. Of course all user john personalizations are lost, but at least we didn't lost every user personalizations:
In my next post, I will describe how you can use MDS labels to revert your MDS repository in case of global system failure.