incubator-odf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian C <>
Subject Re: The generator, the center of the source --- (earlier Re: Fwd: Can't get codegen running)
Date Thu, 21 Jun 2012 12:42:45 GMT
Hi Svante,

thanks, for that great reply.

The reason I am interested in the generation of code from schema is
that I am doing a part-time masters degree by research at a local
university here in Australia.

Anyway, my idea was to help out the AOO project, and any other ODF
users, by providing a test
mechanism which measures/quantifies how much of the schema a given
document uses. Accumulating that information over many documents will
then also help to provide feedback on how well AOO handles different
documents and infer other areas that need to be tested. I also have
some thoughts trying to quantify document complexity, but nothing

At this stage I am unsure as to the real usefulness of such an
approach. Hence wrapping it in a research project, using the odf
schema as a test. And perhaps applying it to others too.

So I am sure you can see why the generation mechanism is of interest
to me. I intend to change/extend the templates to generate 'gauge'
classes (not sure on their content yet) to provide feedback as above.

I have been interested in self generation of code and tests etc for
some time now. So this is just an extension of that.

And you are right to call it the jewel of the toolkit. There are many
applications I see that could benefit from a similar approach.

Thanks again, and if you have any thoughts on my ideas please let me
know. I would love to dicuss them.

And of course I will also feedback to the ODF-Dev any issues I find
along the way.

Enjoy your weekend too. You have much more of it left than I.



On Sun, Jun 17, 2012 at 7:25 PM, Svante Schubert
<> wrote:
> Interesting, I was not aware of that possibility, I usually started the
> generation process with "mvn compile -P codegen" or "mvn install -P
> codegen".
> Be aware that for some time now there is a - most likely 3rd party
> influenced - regression in the code generation, that causes us trouble
> If the code after generation will not build through it happens to the
> above reason.
> Nevertheless the most precious part of this ODF Toolkit is - or better
> will be - this generator.
> The ability to load your own XML schema, be it of type RelaxNG (or
> DTD, W3C XML Schema (subset Part1) or TREX,  RELAX (Namespace & Core)
> functionality) into a unified RelaxNG model - using the MultiSchema
> Validator (MSV).
> And the Apache Velocity template engine to access the model (actually we
> in addition build a simplified access model on top of the MSV).
> Therefore step 1) Abstract from existing schema jungle
> Providing templates for a typed DOM - allowing developers to know more
> about the schema by the type classes, providing guidance.
> Or providing generated documentation, still prototyp even the archetype
> selfhtml - see (don't
> mind the German - <commercial>Chrome Browser as mouse context menu
> language transition</commercial>).  Even with using selfhtml like
> velocity template - basically a text file with syntax to write any
> arbitrary Java source code within accessing a context (the our MSV
> model) - ODF needs some BNF to express child abilites.. And AFAIK
> sequence and choice are the missing pieces to be implemented in the code
> generation.
> Therefore step 2) Collect information from custom schema and rebuild it
> to human friendly documentation or source code (typed DOM tree)
> Pretty sure that in the next one/two year(s) this problems will start to
> itch in a way that I am able to find a patron to scratch it...
> PS: Please satisfy my curiosity and tell me why you are interested in
> the jewel of the toolkit?
> Enjoy your week-end, Ian!
> Svante
> On 17.06.2012 12:44, Ian C wrote:
>> Ok I figured it out in the end...
>> mvn generate-sources -P codegen
>> does the business... and isn't that a neat little command...
>> Cheers,
>> Ian C

View raw message