×

Notice

The forum is in read only mode.
×
Getting new Releases

To get notified on new releases you may follow us on twitter @expandframework or subscribe in our main RSS feed.

Topic-icon ModeldifferenceModule: Prevent storing application model to database

  • endif
  • endif's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
1 year 2 months ago #11458 by endif
Hi Tolis,

is it possible to prevent storing the application model to the database? Just Usermodeldifferences and rolemodeldufferences should go there.
What is the reason of storing the application model in the db by the way?

Reason of the question is that i add a different layer to my applicationmodel on every login. That leads to broken application layouts because the different layers influence each other. in earlier versions that worked flawlessly but since you built in support for mobile models that doesnt work anymore. deleting the application model in db and logging in solves the problem but unfortunately only for this login, not for others. perhaps there is also a better approach for doing this but it seems that simply skip storing the app model to db would solve the issue.

thanks!
Andi
More
1 year 2 months ago - 1 year 2 months ago #11459 by Tolis
Hi

It is not clear where is the problem, maybe I do not understand what you means by storing the application model to the database. To my understanding the application model is stored in the ModelDifferenceObject and that feature was always there from the beginning. This is a shared layer for all users and is blank unless you modify it. Can you elab a bit more please to avoid the confusion. maybe you speak about the file differences controlled from the Model.Options.ModelToUpdateFromFileCriteria and the related attributes. If so can't you just blank them so they will not be used.

looking forward for your details to understand the case better

To get notified on new releases follow us on twitter @expandframework or subscribe RSS feed. I am also available @tolisss . Also see How to debug eXpand
Last edit: 1 year 2 months ago by Tolis.
  • endif
  • endif's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
1 year 2 months ago #11460 by endif
Tolis, thanks a lot for your quick reply.
I analyzed what gets stored to the application model and from what you wrote it gives a more complete picture now:
XAF or ModelDifferenceModule seems to interpret the layer that I load to the application model as differences and thus stores it to the database (which either did not happen before or at least didn't appear as bug)

The purpose of adding another layer is that on login the user gets a combobox where he can choose one of more "modules" he wants to log into. It's basically different applications with some shared data. They look different and serve different purposes.

What I do is the following to achieve this:
In my WebApplication (derived from XpandWebApplication) I subscribe to ModelDifferenceBaseModule's CreateCustomModelDifferenceStore event and there I call ((CreateCustomModelDifferenceStoreEventArgs)e).AddExtraDiffStore(new ModuleModelStore());
I've attached the source of ModuleModelStore but in general I just overwrite Name property (I discovered that it only gets loaded if the name fits to the one in the database) and I overwrite GetStream which simply opens up a xafml file which just holds the differences to the main applicationmodel that are necessary to display the bit of functionality for the module the user has choosen at login time.

I've also attached the application model that is stored in the database and one the model diff files that leads to that content if that's of any help.

Thanks again for your help!

This message has attachments files.
Please log in or register to see it.

More
1 year 2 months ago #11461 by Tolis
It makes no sense why you use the ModelDifferenceBaseModule's CreateCustomModelDifferenceStore as this event belong to the MDO module and your case from what I understand is different. Can you try the XafApplication related events (CreateCustomModelDifferenceStore, CreateCustomUserModelDifferenceStore)

To get notified on new releases follow us on twitter @expandframework or subscribe RSS feed. I am also available @tolisss . Also see How to debug eXpand
  • endif
  • endif's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
1 year 2 months ago #11462 by endif
This was due to lack of knowledge on my side.
Your suggestion works perfectly! (I'm using CreateCustomUserModelDifferenceStore now since I need the point in time after login).

Thanks! You are awesome!
Moderators: expand
Time to create page: 0.201 seconds