TEIC / TEI

The Text Encoding Initiative Guidelines
https://www.tei-c.org
Other
271 stars 88 forks source link

Need to update ODD transformation scenarios #2251

Closed laurentromary closed 1 year ago

laurentromary commented 2 years ago

Since Oxygen is using Saxon 10, there is a need to update the library components of the transformation scenarios, as documented in https://www.oxygenxml.com/forum/common-problems/topic24081.html (Thanks @ttasovac). I have experienced another issue with the DTD transformation scenario which now fires the following error: Build file: /Users/romary/Library/Preferences/com.oxygenxml/extensions/v24.1/frameworks/tei/tei/xml/tei/stylesheet/dtd/build-to.xml Engine name: ANT Severity: fatal Description: Transformation failed. /Users/romary/Library/Preferences/com.oxygenxml/extensions/v24.1/frameworks/tei/tei/xml/tei/stylesheet/common/teianttasks.xml:388: java.lang.reflect.InvocationTargetException which also did not happen with the previous versions of Oxygen. Any hint? Thanks in advance.

martindholmes commented 2 years ago

Yes, we do need to do this; I've done one of them that caught me out, but I'll do the others too.

laurentromary commented 2 years ago

Thanks. The answer is actually the comment by Radu on Oxygen 24.1 breaks transforms because we have Saxon 9 hard-coded

martindholmes commented 2 years ago

@laurentromary I've pushed the changes to Saxon to the master branch, so the stable plugin and the bleeding-edge plugin should rebuild with those changes; on the log4j issue, I'm waiting to hear from @raducoravu about possible impacts for older Oxygen versions.

We don't currently have a mechanism by which the Oxygen team can let us know about breaking changes they introduce to the software. What happens right now is that they silently update their version of the TEI plugin before releasing a new Oxygen, but we don't know about the changes until something breaks in our stable and bleeding edge plugin builds; then we have to figure out what changed and fix it. I wish we had a better way of doing this.

martindholmes commented 1 year ago

I believe this is done and working, so I'm closing it.

raducoravu commented 1 year ago

@martindholmes btw we are releasing Oxygen 25 in a couple of days and it comes bundled with Saxon 11, this would mean adding references to "${oxygenHome}/lib/saxon11*.jar" in all those places. Should I add a new issue for this or can this be fixed on this issue?

martindholmes commented 1 year ago

@raducoravu I'll reopen this and make it urgent, since we have a TEI release coming out soon too. Thanks for flagging this up. I guess because of Saxon 6 we can't use a wildcard to cover all saxons?

raducoravu commented 1 year ago

@martindholmes good question, so for jtei you have some two ANT transformations there, one for jtei to ODT and one for jtei to PDF. In the "xml/tei/stylesheet/common/teianttasks.xml" file you define a bunch of xslt transformations, all of them imposing the ""net.sf.saxon.TransformerFactoryImpl"" Saxon 9 and later factory. Meaning that you do not need some explicit order between Saxon 6 and the Saxon later jars in the classpath. Meaning that when you refer to the JAR libraries in the framework file, these references:

    <String>${oxygenHome}/lib/*saxon*10*.jar</String>
    <String>${oxygenHome}/lib/*saxon*9*.jar</String>
    <String>${oxygenHome}/lib/saxon.jar</String>

could probably be replaced with:

             <String>${oxygenHome}/lib/xmlresolver*.jar</String>
            <String>${oxygenHome}/lib/*saxon*.jar</String>

That extra "xmlresolver" is a JAR library necessary for Saxon 11. Same for "teip5.framework", "teip5jtei.framework", "teip5odd.framework".

But you still have a nasty list of class path entries, maybe we can go all the way, replace all library references only with only this entry:

                            <field name="extensionURLs">
                                <String-array>
                                    <String>${oxygenHome}/lib/*.jar</String>
                                </String-array>
                            </field>

We added wildcard support in Oxygen 19 when referencing libraries, in Oxygen 21 we extracted some patches from our main Oxygen library, overall I suspect this single reference would work well with Oxygen version 21 and newer. So the TEI framework you ship would no longer be compatible with Oxygen 20 and older. But all .framework files would look much simpler and would be easier to maintain:

I will probably make this change in the TEI framework files distributed with Oxygen, attaching my changes: Archive.zip

martindholmes commented 1 year ago

@raducoravu Will we need to change the version of oxygen.jar that the plugin is built with? I think my current one dates from 2017. Actually I see we're pulling two files at build time from Oxygen's maven repo:

<get src="https://www.oxygenxml.com/maven/com/oxygenxml/oxygen/18.1.0.3/oxygen-18.1.0.3.jar" dest="lib/oxygen.jar"/>
    <get src="https://www.oxygenxml.com/maven/com/oxygenxml/oxygen-annotations/18.1.0.3/oxygen-annotations-18.1.0.3.jar" dest="lib/oxygen-annotations.jar"/>

Presumably we'll now have to pull from:

https://www.oxygenxml.com/maven/com/oxygenxml/oxygen/21.0.0.0/

Are there any additional files we'll need, other than oxygen.jar and oxygen-annotations.jar, for building?

martindholmes commented 1 year ago

@raducoravu I went ahead with the two files above, but I get:

error: cannot find symbol
    [javac] import ro.sync.util.TypedMaps;
    [javac]                    ^
    [javac]   symbol:   class TypedMaps
Can you give me the list of additional jar files we'll need to pull from the Oxygen maven repo now in order to do the build?
raducoravu commented 1 year ago

Shouldn't this entire issue have been logged and discussed in the Oxygen TEI framework project instead? https://github.com/TEIC/oxygen-tei

@martindholmes to accomplish the objective of simplifying the path references in the ANT transformation scenarios you do not need to change the oxygen.jar which you are using to compile the framework Java extensions, just changing the Oxygen .framework files should be enough. The TEI framework has a bunch of Java extensions (extensions used for complex actions in the Author mode like "Insert table\Join table cells", ideally you should compile the Java extensions with the corresponding oxygen.jar library version. So as you used the "oxygen.jar" from Oxygen 18, you are probably also using the framework files from that version.

If you decide to support with the Oxygen TEI framework distributed by you only Oxygen 21 or newer, I think you should add this information on this issue which seems to be opened on the Oxygen TEI framework: https://github.com/TEIC/oxygen-tei/issues/27 and maybe my colleague Alex can find the time for that larger commit which involves more resource changes to make the Oxygen TEI framework distributed by you compatible with Oxygen 21 and newer.

martindholmes commented 1 year ago

I see. I tried to use the framework files you provided. I'll roll back that change later today, but I don't have time to do any more now, so I'll have to leave this for the TEI Council to deal with.

raducoravu commented 1 year ago

@martindholmes I understand my attached .framework files were from the Oxygen 25 release, probably you should have implemented the suggested library path simplifications changes directly in the .framework files bundled with the TEI maintained add-on.

martindholmes commented 1 year ago

I think this is done by @martinascholger, @sydb and myself as of today; there is a remaining issue relating to the location of CSS files which actually seems to be a bug in the Stylesheets rather than the Oxygen plugin.

raducoravu commented 1 year ago

@martindholmes the changes look good to me.

ebeshero commented 1 year ago

@martindholmes @martinascholger @sydb Have we completed work on this ticket?

martindholmes commented 1 year ago

As far as I know.