XAF - Merge User Differences from a Custom Model Storage

XAF Team Blog
22 April 2011

Recently, we announced a new Model Merge feature that will be available with the v2011 vol 1 release.  There was a lot of positive feedback in comments, thanks for that. But the question was - if it is possible to merge a user model stored in a database (this approach is described in the K18137 knowledge base article). The answer is YES, it is possible. All you need is to add a simple Controller that contains Export User Differences and Import User Differences actions.

ImportExportUserDifferencesController

The Export User Differences action exports user model differences from a database (or another custom storage) to a regular XAFML file that can be opened in the Model Merge Tool at design time. The capability to import XAFML files is provided by the Import User Differences action. We will have updated the K18137 article by the upcoming release to illustrate this Controller implementation.

Application administrators can use the Model Merge feature too.  Of course they have no access to the application source. But they can merge differences into a common model layer that is typically stored in the Model.xafml file in the application folder. This can be done via the Merge Differences command available in Model Editor at runtime.

RuntimeMerge

So, an administrator can customize a View, and then provide it to all users without disturbing the application developer. In this instance, the Model.xafml file must be shared among all end-users. If terminal server deployment is used, this file is shared initially. Otherwise, an administrator needs to re-deploy the Model.xafml file for all users.  However, database storage can be also implemented for the shared model layer, by handling the XafApplication.CreateCustomModelDifferenceStore event. We will have updated the K18137 article by the upcoming release to show how to handle this event.

5 comment(s)
James Zhong
James Zhong

Very useful article! XAF is being actively improved ...

22 April, 2011
Nate Laff
Nate Laff

That's exactly what I needed! Brilliant!

Merging those admin changes down into other users when they're stored in the DB is huge!!! Thank you!

22 April, 2011
Dennis (DevExpress)
Dennis (DevExpress)

Guys, thank you for the feedback. We are glad to hear that you enjoyed this new feature and a small addition to it!

22 April, 2011
Robert Fuchs
Robert Fuchs

Finally!

22 April, 2011
Thomas Wieser
Thomas Wieser

Is this possible for the designed.diff.xafml's to?

3 August, 2011

Please login or register to post comments.