Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regeneration of ODFDOM DOM sources for ODF 1.2 #135

Closed
svanteschubert opened this issue Nov 17, 2021 · 2 comments
Closed

Regeneration of ODFDOM DOM sources for ODF 1.2 #135

svanteschubert opened this issue Nov 17, 2021 · 2 comments
Milestone

Comments

@svanteschubert
Copy link
Contributor

There had been an OASIS ODF 1.3 release, but before generating the DOM classes from the XML schema (RNG grammar), it might be a good idea to regenerate the classes for ODF 1.2 again to easily spot the differences between ODF 1.2 and 1.3 (reduce the noise & be sure still everything works as it is expected).

That was supposed to be a quick task, but I had to realize that the generation was not done for a long time and many manual changes were made upon these classes.

I have created the branch odf12-codegen and addressed all the problems that I found worthy to be addressed for the next release - still, some build problems have to be fixed now manually.

There are some fundamental problems in some new hand-written classes, where some low-level XML related class is inheriting from a semantic high-level class (in theory the syntax is exchangeable and an implementation detail), which should be addressed later latest for a 1.0.

@wetneb
Copy link
Contributor

wetneb commented Nov 17, 2021

Wow! I had no idea code generation was used in this project. Not knowing anything about the code base, here are some random thoughts.

If manual edits have been made on classes created by code generation, then I would really avoid replacing those classes by their newly re-generated versions. I think the approach you are adopting (running code generation independently for ODF 1.2 and 1.3 and spotting the differences) is good: those changes then need to be backported manually to the code base.

In any case this sounds like a really significant project which should really not be a prerequisite for releasing what you have already.

@svanteschubert svanteschubert added this to the 0.11.0 milestone Nov 26, 2021
@svanteschubert
Copy link
Contributor Author

Basics of Code Generation Update

Currently, the Code generation can only be triggered by the following Java test
generator/schema2template/src/test/java/schema2template/example/odf/OdfGenerationTest.java
Only the generation of ODF 1.2 is enabled - the generation of ODF 1.0, 1.1 and 1.3 is being temporarily disabled (at the bottom of the test class).

The generated output - the ODF dom and pkg Java sources - can be found within:
generator/schema2template/target/generated-sources/java/odf1.2

The Apache velocity templates, which are being used to generate the ODFDOM Java sources, are from now only with the related (ODFDOM) project:
odfdom/src/codegen/resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants