This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi there, I would like to know if there is a way to persist the current models to a database and then to generate the classes via nVelocity templates?
Kind regards and a Merry Christmas and Happy new year.
Johan |
|
|
Hello Johan, I'm not sure I understand the question. This sounds like doing an Update Database in the designer (or running a migration), but you're obviously after something more than that. Is it that you want to be able to use different templates based on the user locale, and therefore generate the classes at run-time? |
|
|
Hi Ivan, What I would like to do is to save the whole model to a database so that I can see all the validation error messages. This will just make the whole localization process easier. Kind regards, Johan |
|
|
If you look in the install\Localization folder, there's a file named Resources.resx which includes all the LightSpeed messages, including the validation ones. I would use that rather than trying to generate the error messages by doing a save. |
|
|
Hi Ivan, The localization message are for my entities and their validation messages (Custom Message) not the lightspeed messages. Maybe I'm just not getting how the localization work :)
Kind regards, Johan |
|
|
Okay, I think I understand. I don't think you can do this in the way that you're asking, by saving to a database. However the .lsmodel file is just a XML file so you could extract the custom messages using XSLT or a scripting language or grep. As for getting the localised messages into your classes, you could generate classes 'by hand' using NVelocity, but another possibility is to generate classes from the .lsmodel file using lsgen.exe. So you could use XSLT or something to create a copy of your "real" .lsmodel file with localised messages, and then generate from that using lsgen -- this might be easier than running NVelocity by hand. Does that help? |
|
|
Hi Ivan, Yes thank you. Will try the the XSLT method.
Kind regards, Johan |
|