See the proposed solution.
Proposed Solution:
I desire that we introduce an option in the XafApplication class that would provide at least three predefined methods of storing the model user differences:
- in the file system for Win and Web applications (this is the Model.User.xafml file in a Windows Forms application, or a folder with the ID of the current user on the server in a Web Forms application)
- in the database ( How to: Store Model Differences in Database ) for both platforms
- in a custom store (as in the browser cookies for a Web application)
In the meantime, I suggest you take less than 1 minute to watch a video about the DatabaseUserSettings module I recently developed.
The DatabaseUserSettings module provides the capability to store user settings in the database instead of the file system by default. Note that this module is security system type insensitive.
If security system is on, you also get the capability to manage all users settings via a service Configurator user and a special UI.
You can export user settings into a file system, reset them or even import user setting from one user to others. You can also edit required user settings via standard XAF CRUD forms.
Further details are available in the A reusable XAF module for storing model settings in the database (security system type insensitive!) forum thread.
Join this discussion and share your feedback and suggestions on this module!
Thanks,
Dennis
I'm using the DatabaseUserSettings and I've got a question. Before the adoption of this module, the presence of the Model.xafml file was not mandatory. Now I receive this error "Cannot load user settings from the Model.xafml file". Moreover, the application use a custom ModelDifferenceFilePath, but this property is not taken into account and the DatabaseUserSettingsModule looks at the file in the root. Is there a way to avoid this behavior? I see that the exception is raised in the GetConfiguratorUserSettings function. I haven't implemented the configurator account and don't want to deal with it in the next future. Thank you very much.
@Matteo: Sure, you are free to modify this example code as your business needs dictate.
Which part of the function can I comment out without risk to introduce a misbehavior? Thank you.
@Matteo: I am afraid it is not a "comment one line" solution and I do not have ready guidelines specially for your particular scenario. I suggest you research and understand the code of this example if you are going to base your own solution on it. The code that reads settings from the Model.XAFML file is placed in the GetConfiguratorUserSettings method. Drop me a line if you experience any further questions.
Probably, it will be easier to implement your task from scratch by handling the CreateCustomUserModelDifferenceStore and CreateDatabaseModelDifferenceStore events of the XafApplication class. If you wish to discuss this further, it is better to create a separate ticket in the Support Center. Thanks.