URGENT-Generating gwt web pages

87 views
Skip to first unread message

vanessa vanessa

unread,
Apr 21, 2012, 12:33:19 PM4/21/12
to google-we...@googlegroups.com
Hello ,

I have to create a generator that generates gwt code from a model as an entry.
Can any one help me how to proceed ? And which template engine to choose ?
Is velocity a good solution .

Thanks a lot.
Regards

Freddie Jefferson

unread,
Apr 22, 2012, 7:50:54 PM4/22/12
to google-we...@googlegroups.com, google-we...@googlegroups.com
Vanessa, 
 
I don't understand your first statement. As far as the template engine goes, velocity is a great templating engine.

Regards,
Freddie Douglas Jefferson 
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/0Nq42Ig-6FcJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Kanagaraj M

unread,
Apr 23, 2012, 1:11:12 AM4/23/12
to google-we...@googlegroups.com
what you mean by entry. Are you trying to generate gwt models from what?

Velocity would be the right choice.

If you are gonna write complex template Freemarker would be a better one.

vanessa vanessa

unread,
Apr 23, 2012, 4:14:00 AM4/23/12
to google-we...@googlegroups.com
Ok i'll provide further information. i have to create a generator that uses the velocity engine ,it will generate a GWT 
code which will be in turn compiled .

The entry of my generator is an xml file which i'm supposed to transform  to a model object . I'll generate therefore
the code from this model object .I wish i made my self clear.

Thanks for your help.


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.

Thomas Broyer

unread,
Apr 23, 2012, 4:26:47 AM4/23/12
to google-we...@googlegroups.com


On Monday, April 23, 2012 10:14:00 AM UTC+2, vanessa vanessa wrote:
Ok i'll provide further information. i have to create a generator that uses the velocity engine ,it will generate a GWT 
code which will be in turn compiled .

The entry of my generator is an xml file which i'm supposed to transform  to a model object . I'll generate therefore
the code from this model object .I wish i made my self clear.

The fact that the generated code will be compiled by GWT doesn't change anything to your generating process.

So, write a Java program (with a main() et al.)  that reads XML and outputs Java code. What kind of help are you looking for?

vanessa vanessa

unread,
Apr 23, 2012, 4:34:47 AM4/23/12
to google-we...@googlegroups.com
How it doesn't change anything ?
I!'m looking for some documentation and some recommendation .. I didn't find through the net 
someething that fits my needs .

Thanks a lot . 

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.

Alan Chaney

unread,
Apr 23, 2012, 10:36:21 AM4/23/12
to google-we...@googlegroups.com
On 4/23/2012 1:34 AM, vanessa vanessa wrote:
How it doesn't change anything ?
I!'m looking for some documentation and some recommendation .. I didn't find through the net 
someething that fits my needs .

The input to GWT is Java code. As Thomas said, you are looking for something that takes XML and converts it to Java source.

Velocity (and Freemarker, for that matter) take Java models and convert them to a textual representation, such as HTML or XML or just plain text (for example, I generate the text of emails using Freemarker) so they are not really much use in your case.

I suggest that you look at JAXB which "binds" XML to java -- in other words, generates the java code required to represent an XML description.

There's also XStream and many others.

Your requirement means you will have to learn about XML binding and GWT. The GWT developer docs are at https://developers.google.com/web-toolkit/ and you can go to http://jaxb.java.net/ for stuff on JAXB - or just search Google using the search term ' xml binding java ' which will give you lots of information and alternatives.

Finally, problems with converting XML --> Java are not really relevant to this list, but if you have problems compiling the generated Java with the GWT compiler, then this would be the place to ask on specific debugging issues. There are limitations on the Java source that GWT will compile - see https://developers.google.com/web-toolkit/doc/latest/DevGuideCodingBasicsCompatibility for more information.


Regards

Alan

vanessa vanessa

unread,
Apr 23, 2012, 11:35:32 AM4/23/12
to google-we...@googlegroups.com
Hi Alan ,
Thank you for your help and for your collaboration.
I think i didn't make my self clear enough.My problem isn't converting XML to Java 
i'm not needing marshalling and unmarshalling .I have a model which contains data(an xmile file) which i've already
converted to a model object.
I 'll have to implement a generator that uses this data to create automatically gwt classes.I'll have to generate 
all the packages i mean by that the client package ,the shared package and the server one automatically.

Since velocity is a good solution , i'll generate theses classes with velocity from scratch.I was searching if anyone
implemented such a gnerator before and so can help me with some advice.
Thanks a lot again.And good luck every body.

Martin Trummer

unread,
Apr 24, 2012, 8:10:54 AM4/24/12
to google-we...@googlegroups.com
>I have a model which contains data(an xmile file) which i've already converted to a model object.
and why don't you use this existing generation process to also generate the packages, that you mention?

vanessa vanessa

unread,
Apr 24, 2012, 9:15:21 AM4/24/12
to google-we...@googlegroups.com
You mean the existing Generation tools of GWT ... i have to implement a generator using a template engine 
the existing tools don't fit my needs.

Le 24 avril 2012 13:10, Martin Trummer <ds.marti...@gmail.com> a écrit :
>I have a model which contains data(an xmile file) which i've already converted to a model object.
and why don't you use this existing generation process to also generate the packages, that you mention?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
Reply all
Reply to author
Forward
0 new messages