ADF: Cloning personalizations between users – read and write MDS Customization documents

0

In a recent post I wrote how wonderful the ADF support for user level customizations or personalizations is, and then I went on to explain how the user can be enabled to remove her own personalizations (http://technology.amis.nl/2012/09/27/adf-undo-the-users-page-personalizations-query-and-manipulate-mds/). This article a sequel to that story. It will introduce the capability for one user to clone the personalizations from another user. This means at the background that the document that contains the customizations for a page for the ‘source user’ is read and a new document with the exact same contents is written for the ‘target user’ who will then have personalizations that are at that time exactly the same as those of the source user. There is no link between the two documents – they are both on their own. Any pre-existing personalizations for the target user are lost in this process.

Note: I do not talk about the privileges that you want to define in order to not have anyone copying from just anyone else. Also note that I discuss cloning the personalizations for a single page only. Copying all personalizations from one user to another however is a very simple extension of what is discussed below.

The steps for implementing this clone capability in an application that is already personalization enabled are remarkably simple.

The starting point is user SKING who has applied a number of personalizations to the following page:

image

User AHUNOLD
image
did not apply any personalization, so the page to him looks as the developers created it:

image

Alexander Hunold saw the page when his colleague Steven King was working with it, and he thought that amazing! Those superb personalizations had turned the page into a beauty, easy to use and addictive to look at. So Alexander wants his page to look the same as SKING’s. He uses the cloning mechanism:
image

and is informed:

image

After refreshing the page, now for AHUNOLD it too looks like:
image

In the MDS Repository, the document with personal customizations for SKING was copied for AHUNOLD. On the MDS File implementation that looks simply as follows:
image

Note: since both users have their own copy, any additional personalization made by one of them is invisible to the other. At any time though they can again close each other’s personalizations.

Implementation

Using the groundwork described in the previous article – http://technology.amis.nl/2012/09/27/adf-undo-the-users-page-personalizations-query-and-manipulate-mds/ – it is not a lot of work to implement the cloning. It primarily requires details on the MDS API functionality – by and large found here: http://idmclub.wikidot.com/metadata-store.

In the page itself, I have introduced an inputText and a slightly differently configured commandLink:

image

The Java Code in the MDSCoordinator class is as follows:
image

The last lines write the message for the user:
image

Resources

The class MDSCoordinator.

IDMClub Wiki on accessing the MDS API: http://idmclub.wikidot.com/metadata-store

Andreas Koop – ADF: MDS power user layer and “How to control MDS customizations at runtime” – http://multikoop.blogspot.com/2012/01/adf-mds-power-user-layer-and-to-control.html

Share.

About Author

Lucas Jellema, active in IT (and with Oracle) since 1994. Oracle ACE Director for Fusion Middleware. Consultant, trainer and instructor on diverse areas including Oracle Database (SQL & PLSQL), Service Oriented Architecture, BPM, ADF, Java in various shapes and forms and many other things. Author of the Oracle Press book: Oracle SOA Suite 11g Handbook. Frequent presenter on conferences such as JavaOne, Oracle OpenWorld, ODTUG Kaleidoscope, Devoxx and OBUG. Presenter for Oracle University Celebrity specials.

Leave a Reply