Skip to content

Conversation

@svanteschubert
Copy link
Contributor

After about 11 years ODFDOM classes are now being regenerated.

The generator submodule has been wholly refactored, similar to the Maven plugin, which is now being used from ODFDOM to generate, copy and format the Java classes of the 3 XML grammars:

  • ODF XML manifest
  • ODF XML digital signature
  • ODF XML schema

over the existing source code via mvn clean install -Dcodegen

The newly generated files have not been committed to being able to use Git for comparison.

…BUILDING YET as still some changes have to be applied manually to be backward compatibility to earlier releases
…umbers, added pluginManagement but this only influences direct pom.xml children
… for releases but with every build/deployment, which results under Windows annoying typing in the pwd)
…nital code generation of Maven plugin artefacts
…gument, as we need to instantiate the iteration of generation at schema2template to have all-generation-embracing variables like the changes in XML grammar version history
…erence (disabled the test as only required when generating sources
@svanteschubert
Copy link
Contributor Author

There are improvements of various kind and here are only some highlights:

Maven

  1. For Maven the dependencyManagement and pluginManagement functionality is being used more strictly to define version numbers for Maven dependencies and plugins only once in the root project.
  2. The signing of artefacts is no longer required for every build only for releases.
  3. The latest released & overworked Multi Schema Validator (MSV) is being used. ODF element children as GraphML and MSV RunTime dumps are additional regression tests of the Toolkit's generator.

Generation & Templates

  1. There are now tests for all ODF generation examples (ODFDOM Java, OdfReference and some Python alpha work).
    Only all ODFDOM Java sources are being compared by line with the references, as others have still some variations with the numbering of multiple definitions. Likely, not all tests will be kept active to allow quick build/tests and must only be activated when generator, grammar, XML dependencies (as MSV) is being altered (or before releases).
  2. The history feature has been fixed. Allowing the tagging/versioning of newly inserted ODF XML nodes in the documentation. That is the reason why all ODF versions are being generated - I realised the need for previous grammar for this feature late, otherwise, the Maven plugin might allow a list of grammar. Nevertheless, the given list of generations is being ordered by module and version tag from the generator.
  3. The base class feature has been fixed. When a base class is defined in the generation configuration, which is required in addition to the XML grammar, all elements with the same base class will have their union attributes and child elements moved into that base class.
  4. Prior manual added functionality to the generated source has been moved into a Velocity Macro file (to ease reading the template - likely best done with VSCode extension for Velocity) and is triggered by certain attributes (e.g. elements with xhtml:content require special handling for RDF metadata) or by configuration (e.g. some elements are being duplicated by a repetition attribute, which is now being explicitly named) to allow to add the functionality for repetition and split to the XML classes.

ODF JSON Changes (Collaboration)

Whenever a sequence (like a hyperlink) should be added/merged into an existing element (e.g. paragraph containing other elements and text), there were two issues being fixed:

  1. FIX1: Text styles/format as part of the ODF Paragraph style (style:text-properties) are overtaken during a merge as span element as long as the paragraph. Unfortunetely, only a few nodes were added to this span, as the logical length of ODF was mixed up with the length of XML nodes.

  2. FIX2: When the prior described merge was initiated the first node (often a text node) was unnecessary split. This was fixed by adding a second end parameter when the sequence have to end. These fixes lead to several positive side effects and updates of the JSON references.

@svanteschubert
Copy link
Contributor Author

When updating the JavaDoc (and building/generating prior to all sources) I incidentally added/committed the generated files. 🙈
If you like to generate them over existing checkout 1b2f717 prior to the JavaDoc updates.

The JavaDoc can be viewn at my temporary fork to activate GitHub Pages:
https://svanteschubert.github.io/odftoolkit/api/

In addition, I have added the output of an API change tool: https://siom79.github.io/japicmp/
Which result I will discuss in detail on the mailing list:
https://svanteschubert.github.io/odftoolkit/api/ODFDOM_API_CHANGES_odf-codgen_branch.html

@svanteschubert
Copy link
Contributor Author

@svanteschubert
Copy link
Contributor Author

fixes #182

…lass (as not commonly usable) + several small documentation updates
…ccording to human semantic) and ordering is like when MSV Expression.hashCode() will be fixed (without Class.hasCode() bringing randomness inbetween process calls)
@mistmist
Copy link
Contributor

okay so the snyk check was not relevant as it complained about a pre-existing dependency only used at build time, and the conflicts had to be resolved anyway so i've merged manually -> closing this PR

@svanteschubert
Copy link
Contributor Author

I have got three action items till next release:

  1. Update our documentation
  2. Add the previous listed updates of these PR in the release notes
  3. Limit the amount of regression tests of code generation for common builds, and perhaps generated the code base for all ODF releases (etc) only when code was new generated or before release or perhaps do it for GitHub cloud builds...

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 this pull request may close these issues.

setStyleNumberWrappedParagraphsAttribute("no-limit") not valid Regeneration of ODFDOM DOM sources for ODF 1.2

3 participants