Core - Provide an easy way to store administrator and user model differences in a custom store (e.g., in a database)
https://www.devexpress.com/Support/Center/Question/Details/S32444/core-provide-an-easy-way-to-store-administrator-and-user-model-differences-in-a-custom
E968: How to handle distribution of new Model.xafml file?
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:
1. 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)
2. in the database ( How to: Store Model Differences in Database ) for both platforms
3. in a custom store (as in the browser cookies for a Web application)
- Dennis (DevExpress Support)6 years ago
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 - Matteo Lazzari4 years ago
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.
- Dennis (DevExpress Support)4 years ago
@Matteo: Sure, you are free to modify this example code as your business needs dictate.
- Matteo Lazzari4 years ago
Which part of the function can I comment out without risk to introduce a misbehavior? Thank you.
- Dennis (DevExpress Support)4 years ago
@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.
1 Solution
Implemented:
- v2014 vol 2.3 : Download official update
Additional information:
End-user UI settings (model differences) can now be stored in the application’s database (both WinForms and ASP.NET). This allows you to synch settings for users across multiple devices, share settings modified by administrators and prohibit unauthorized changes. This functionality is implemented in the system module and it is activated automatically when you enable the Security System in the Solution Wizard.
You can allow application administrators to manage user settings across user accounts - create, copy, export and reset model differences. For this purpose, run the Model Editor and create a new Navigation Item for the ModelDifference_ListView List View.
Online documentation:
eXpressApp Framework > Task-Based Help > How to: Store the Application Model Differences in the Database
How to: Enable the Administrative UI for managing Users' Model Differences
eXpressApp Framework > Concepts > Application Model > Model Difference Storages
- Carlitos3 years ago
Nice! What about sharing models via roles?
- Dennis (DevExpress Support)3 years agoThanks for your interest, Carlitos. I've just answered the same question to Martin in my blog post.
- Martin Praxmarer - DevExpress MVP3 years ago
Dennis - on the blog i asked if i can edit those diffs at runtime, and you said:
@Noxe: Yes, you can do this using the CRUD interface of the XAF app (see the screenshot) - currently, the simplest and the official way to edit these settings;-)
I meant i can select an model diff - and edit those diffs via the model editor? as far i can see i can only edit the plain XML content. The pro Version of this would be that i select for example the "Shared Model Difference", and then edit this part in the model Editor (as xpand does ;) )
- Dennis (DevExpress Support)3 years agoThanks for your clarification, Noxe! This option is not currently implemented and we will take your feedback into account.
- Carlitos3 years ago
Hopefully we will have Role Diffs one day! :)
- Mario Blatarić3 years ago
Are there new tickets where we can vote for role diffs and editing models using Model Editor?
- Dennis (DevExpress Support)3 years ago@Mario: No, for now this feedback is logged via our internal feature cards.
- Nate Laff3 years ago
Can we get a run through of using the new tools from an end user perspective? It seems like they should NOT modify the "Shared Model Difference" object that gets created, that comes from Model.xafml it seems and if you copy current user's diffs to that it erases any changes in your highest level model. If changes are made to Model.xafml do we need to update that "Shared Model Difference" manually? Delete it and let it get recreated?
The first thing I did (from the seat of an end user) was copy the Administrator model to the "Shared Model Difference" object. I wanted all users to get the changes made.
The biggest issue with that is the My Details item, which is generated there. Any attempt to move it to another nav group eventually has that change erased and it ends up back in the default group. I try not to make changes to my Model.xafml but that's the only one that is necessary, and always ends up right back when it started.
Also, can we (easily) override the behavior of "Create Model Differences" action? I have built-in users (Workflow Service), inactive users, etc.. that I do not want to appear during this process. I would like them to be filtered out.
- Nate Laff3 years ago
Also, do all users need read/write access to ModelDifference and ModelDifferenceAspect in order to store their user settings? It all seems to be working without it, but wondering how it circumvents security.
- Konstantin B (DevExpress)3 years ago> If changes are made to Model.xafml do we need to update that "Shared Model Difference" manually? Delete it and let it get recreated?
Yes. If you delete the "Shared Model Difference" object , it will be recreated on restart and initialized using the content of the Model.xafml file (and its aspects if any). Alternatively, you can manually update xml code in the ModelDifferenceAspect detail view.> The biggest issue with that is the My Details item, which is generated there. Any attempt to move it to another nav group eventually has that change erased and it ends up back in the default group.
I have just tested this scenario. The navigation group change is correctly applied after I delete the "Shared Model Difference" object and restart.> Also, can we (easily) override the behavior of "Create Model Differences" action?
Yes, you can inherit the ModelDifferenceViewController and override its CreateModelDifferences method.> Also, do all users need read/write access to ModelDifference and ModelDifferenceAspect in order to store their user settings?
Yes.> It all seems to be working without it, but wondering how it circumvents security.
It works while you use UI-level security. If you switch to the Integrated mode (i.e, use SecuredObjectSpaceProvider) or use the Middle Tier server, user differences will not be loaded/saved unless you grant read/write permissions to ModelDifference and ModelDifferenceAspect. - Nate Laff3 years ago
The Shared Model Difference is nice, but still not user friendly because any changes you make to it wipe out the Model.xafml (My Details). It's almost like there needs to be a hidden "Application Model Differences" where the model.xafml contents always reside, and shared model diffs can look at it, too to pull in those changes.
- Dennis (DevExpress Support)3 years ago@Nate: I appreciate your feedback. I have devoted a separate thread to this usability problem: ModelDifferenceDbStore - Always take into account the latest changes made to the Model.XAFML file at design time. Thanks.
- Nate Laff3 years ago
Thanks Dennis.
Can we also get some property to customize the name of "Shared Model Difference" object to something more appropriate for end users? That would be helpful :)
- Dennis (DevExpress Support)3 years agoYes, it is already possible by changing the Localization | Texts | SharedModelDifferenceName node value via the Model Editor. We are also discussing the capability to pass any string identifier into the ModelDifferenceDbStore constructor.
P.S.
Please create separate tickets in the Support Center if you have any questions or suggestions on this feature, not to mix everything within a single thread. Thanks for your understanding. - Willem de Vries3 years ago
Please remove the solution and refer to the knowledge base article https://documentation.devexpress.com/#Xaf/CustomDocument3698 instead.
Willem
- Carlitos3 years ago
This is not functional: "Currently, the simultaneous use of the database model differences storage in both a WinForms and ASP.NET application by the same user account is not recommended. In general, model differences of WinForms and ASP.NET applications are incompatible. As a workaround, you can create two separate accounts for a user who works in both WinForms and ASP.NET applications."
- Dennis (DevExpress Support)3 years ago@Willem: I have updated the ticket description, thanks.
@Carlos: Thanks for your feedback, we have registered Application Model - Make it easier to store user settings in the database for WinForms and Web applications separately to simplify this process.
@All: Please create separate tickets in the Support Center if you have any questions or suggestions on this feature, not to mix everything within a single thread. Thanks for your understanding. - Brian L3 years ago
Should this view be auto-generated if you upgrade and use the project converter on an existing project?
- Dennis (DevExpress Support)3 years ago@Brian: No, it should not. Please follow the eXpressApp Framework > Task-Based Help > How to: Store the Application Model Differences in the Database article to learn more on how to add it.
Core - Provide an easy way to store administrator and user model differences in a custom store (e.g., in a database)的更多相关文章
- CoreData修改了数据模型报错 The model used to open the store is incompatible with the one used to create the store
在iOS 6 – Core Data 应用程序的开发过程中, App启动时出现如下异常信息: reason = “The model used to open the store is incompa ...
- iOS/Xcode异常:reason = “The model used to open the store is incompatible with the one used to create the store”
reason=The model used to open the store is incompatible with the one used to create the store 出现上述异常 ...
- The model used to open the store is incompatible with the one used to create the store
说什么数据不兼容,,,,这时删除模拟器的应用,,,重新启动测试.
- Ext JS 6学习文档–第1章–ExtJS入门指南
Ext JS 入门指南 前言 本来我是打算自己写一个系列的 ExtJS 6 学习笔记的,因为 ExtJS 6 目前的中文学习资料还很少.google 搜索资料时找到了一本国外牛人写的关于 ExtJS ...
- Ext Js v6.2.0.103 Sencha Cmd 命令
Sencha Cmd v6.2.0.103 Sencha Cmd 提供几种全局开关命令. 在大多数案例中, 第一步是在Sencha SDK基础上创建应用 例如 Ext JS 或 Sencha Touc ...
- the core of Git is a simple key-value data store The objects directory stores all the content for your database
w https://git-scm.com/book/en/v1/Git-Internals-Plumbing-and-Porcelain Git is a content-addressable f ...
- External Configuration Store Pattern 外部配置存储模式
Move configuration information out of the application deployment package to a centralized location. ...
- Oracle 12.1.0.2 New Feature翻译学习【In-Memory column store内存列存储】【原创】
翻译没有追求信达雅,不是为了学英语翻译,是为了快速了解新特性,如有语义理解错误可以指正.欢迎加微信12735770或QQ12735770探讨oracle技术问题:) In-Memory Column ...
- ExtJS笔记 Store
The Store class encapsulates a client side cache of Model objects. Stores load data via a Proxy, and ...
随机推荐
- Linode VPS主机套餐方案降低处理方法且不影响数据
使用Linode VPS主机产品经历过512MB内存升级至1GB内存,再升级至2GB内存,以及目前推出1GB内存方案月付10美元.比如我们在使用Linode 2GB内存方案的时候占用资源不是太多,其实 ...
- VMware 11 安装苹果系统
没事研究了一下虚拟机安装苹果系统 1.下载需要的软件- F, c1 X: e- o1 }& V/ o9 J 1.1 VMware 11 下载和安装* P( R; O6 v1 N! ...
- 解决windows10下无法安装.net framework 3.5,错误代码0x800F081F
1.下载 NET Framework 3.5的安装包netfx3.cab: http://download.windowsupdate.com/d/msdownload/update/software ...
- c++与matlab联合编程,调用Deploytool 生成exe文件和dll文件(转)
转自:http://www.cnblogs.com/xlw1219/archive/2012/12/25/2832222.html 首先必须知道联合编程需要知道的一些命令解释: mcc 的作用是将 . ...
- 寒假短期学习计划 - C++
寒假短期学习计划 - C++ 一.所选课程 && 相关 0.选以下课的理由: 选课理由0: 只是短期的计划,先选些短视频感受:之后再视情况选其他课: 选课理由1: 难度低,以前自学过一 ...
- DSU on Tree浅谈
DSU on tree 在之前的一次比赛中,学长向我们讲了了这样一个神奇的思想:DSU on tree(树上启发式合并),看上去就非常厉害--但实际上是非常暴力的一种做法;不过暴力只是看上去暴力,它在 ...
- [JSOI2018]潜入行动
题目 我好菜啊,嘤嘤嘤 原来本地访问数组负下标不会报\(RE\)或者\(WA\),甚至能跑出正解啊 这道题还是非常呆的 我们发现\(k\)很小,于是断定这是一个树上背包 发现在一个点上安装控制器并不能 ...
- Day13 泛型
泛型 泛型定义 在一个类型(类,接口,方法)之后,定义一个类型参数. 原生类型:类型后面没有指定具体的类型参数. 好处 使用泛型的好处在于,它在编译的时候进行类型安全检查,并且在运行时所有的转换都是强 ...
- pytest 框架自动化Selenium 之yield 使用
环境 python 3.7 由于3.0-3.5以下部分pytest可能有部分兼容问题安装建议2.7-2.9,3.5-最新 pip install pytest专属 pytest框架包 pip inst ...
- STL容器与拷贝构造函数
所有容器提供的都是“value语意”而非“reference语意”.容器内进行元素的安插操作时,内部实施的是拷贝操作,置于容器内.因此STL容器 的每一个元素都必须能够拷贝.---<<C+ ...