Is there a way to generate from a ECore model code that is not Java? I have a meta-model that represent a html layout (forms, inputs, buttons) and I want to generate the html.
How can I do this? What other tools must I use? A link to a tutorial would be perfect because i haven't found one yet.
I think the best way to approach this is to create your meta model in Ecore as you already have done, then generate the Java code and probably also an EMF tree editor to create models. (Note that the Java code for the meta model needs to be generated so that the resulting models can be traversed and interpreted by the EMF tooling. So you don't generate other languages directly from the Ecore -- that is done in a separate step as described below),
Next, use XPand -- the Xtext templating language -- to generate HTML code from your models. Here is a blog post that explains how to do create an HTML form from a model:
http://www.peterfriese.de/getting-started-with-code-generation-with-xpand/
You can likely skip the step "creating the metamodel" and just use the one you have created already. This article is a good introduction to XPand, which is a very powerful language and which some beleive is better than Jet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With