From be7dd35a90dd59cb9583f5134ee5da03a2ef6c0c Mon Sep 17 00:00:00 2001 From: Thomas Scheffler Date: Mon, 30 Oct 2023 10:18:10 +0100 Subject: [PATCH] MCR-2966 move Saxon ready stylesheets to /xslt --- .../resources/config/mir/mycore.properties | 50 +- .../{xsl => xslt}/MARC21slimUtils.xsl | 0 .../resources/{xsl => xslt}/convertjson.xsl | 0 .../resources/{xsl => xslt}/marc-tidy.xsl | 0 .../metadata/mods-metadata-page.xsl | 4 +- .../resources/{xsl => xslt}/mods2datacite.xsl | 2 +- .../resources/{xsl => xslt}/mods2marcxml.xsl | 0 .../mycoreobject-datacite-mir.xsl | 0 .../{xsl => xslt}/mycoreobject-podcast.xsl | 0 .../resources/{xsl => xslt}/rules-helper.xsl | 0 .../{xsl => xslt}/sword/jats2mods.xsl | 1038 ++++++++--------- .../sword/mycoreobject2dissemin-status.xsl | 0 .../{xsl => xslt}/sword/ojsmets2mods.xsl | 0 .../java/org/mycore/mir/acl/MIRACLTest.java | 2 +- 14 files changed, 561 insertions(+), 535 deletions(-) rename mir-module/src/main/resources/{xsl => xslt}/MARC21slimUtils.xsl (100%) rename mir-module/src/main/resources/{xsl => xslt}/convertjson.xsl (100%) rename mir-module/src/main/resources/{xsl => xslt}/marc-tidy.xsl (100%) rename mir-module/src/main/resources/{xsl => xslt}/metadata/mods-metadata-page.xsl (98%) rename mir-module/src/main/resources/{xsl => xslt}/mods2datacite.xsl (93%) rename mir-module/src/main/resources/{xsl => xslt}/mods2marcxml.xsl (100%) rename mir-module/src/main/resources/{xsl => xslt}/mycoreobject-datacite-mir.xsl (100%) rename mir-module/src/main/resources/{xsl => xslt}/mycoreobject-podcast.xsl (100%) rename mir-module/src/main/resources/{xsl => xslt}/rules-helper.xsl (100%) rename mir-module/src/main/resources/{xsl => xslt}/sword/jats2mods.xsl (97%) rename mir-module/src/main/resources/{xsl => xslt}/sword/mycoreobject2dissemin-status.xsl (100%) rename mir-module/src/main/resources/{xsl => xslt}/sword/ojsmets2mods.xsl (100%) diff --git a/mir-module/src/main/resources/config/mir/mycore.properties b/mir-module/src/main/resources/config/mir/mycore.properties index 2476e45b80..87ace973f3 100644 --- a/mir-module/src/main/resources/config/mir/mycore.properties +++ b/mir-module/src/main/resources/config/mir/mycore.properties @@ -26,9 +26,35 @@ MIR.User.ShowSimpleDetailsOnly=false # Important overwrites of MyCoRe defaults # ############################################################################## +############################################################################## +# No XSLT3 by default: Xalan-Compatibility MCR-2966 # +############################################################################## # until we are ready to switch to Saxon by default: MCR.LayoutService.TransformerFactoryClass=org.apache.xalan.processor.TransformerFactoryImpl - +MCR.Layout.Transformer.Factory.XSLFolder=xsl + +#required for mycore-solr +MCR.URIResolver.xslImports.solr-document=solr-basetemplate.xsl +MCR.URIResolver.xslImports.solr-document=%MCR.URIResolver.xslImports.solr-document%,mycoreobject-dynamicfields.xsl +MCR.URIResolver.xslIncludes.components=%MCR.URIResolver.xslIncludes.components%,solr-layout-utils.xsl +MCR.ContentTransformer.response.TransformerFactoryClass=org.apache.xalan.processor.TransformerFactoryImpl +MCR.ContentTransformer.response.Stylesheet=%MCR.ContentTransformer.response-prepared.Stylesheet%,xsl/response.xsl +MCR.ContentTransformer.response-browse.Stylesheet=xsl/response-browse.xsl +MCR.ContentTransformer.mycoreobject-solrdocument.Class=org.mycore.common.content.transformer.MCRXSL2JAXBTransformer +MCR.ContentTransformer.mycoreobject-solrdocument.TransformerFactoryClass=org.apache.xalan.processor.TransformerFactoryImpl +MCR.ContentTransformer.mycoreobject-solrdocument.Stylesheet=xsl/mycoreobject-solrdocument.xsl +MCR.ContentTransformer.mycoreobject-solrdocument.Context=org.mycore.solr.index.document.jaxb +MCR.ContentTransformer.response-solrdocument.Class=org.mycore.common.content.transformer.MCRXSL2JAXBTransformer +MCR.ContentTransformer.response-solrdocument.TransformerFactoryClass=org.apache.xalan.processor.TransformerFactoryImpl +MCR.ContentTransformer.response-solrdocument.Stylesheet=xsl/response2batch.xsl,%MCR.ContentTransformer.mycoreobject-solrdocument.Stylesheet% +MCR.ContentTransformer.response-solrdocument.Context=%MCR.ContentTransformer.mycoreobject-solrdocument.Context% +MCR.ContentTransformer.response-prepared.Class=org.mycore.common.content.transformer.MCRXSLTransformer +MCR.ContentTransformer.response-prepared.TransformerFactoryClass=org.apache.xalan.processor.TransformerFactoryImpl +MCR.ContentTransformer.response-prepared.Stylesheet=xsl/response-join-results.xsl,xsl/response-addDocId.xsl,xsl/response-addDerivates.xsl +MCR.URIResolver.xslIncludes.xeditorTemplates=solr-xeditor-templates.xsl + +#required for mycore-mods +MCR.URIResolver.xslImports.solr-document=%MCR.URIResolver.xslImports.solr-document%,mods-solr.xsl ############################################################################## # Configure ACL Checking # @@ -51,7 +77,7 @@ MCR.ACL.AccessKey.Strategy.AllowedSessionPermissionTypes= ############################################################################## MCR.ContentTransformer.rules-helper.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl -MCR.ContentTransformer.rules-helper.Stylesheet=xsl/rules-helper.xsl +MCR.ContentTransformer.rules-helper.Stylesheet=xslt/rules-helper.xsl #MCR.Access.Strategy.Class=org.mycore.access.facts.MCRFactsAccessSystem #MCR.Access.Class=org.mycore.access.facts.MCRFactsAccessSystem @@ -254,7 +280,7 @@ MCR.ContentTransformer.response-mycoreobject.Stylesheet=xsl/response2mycoreobjec MCR.ContentTransformer.response-browse.Class=org.mycore.common.content.transformer.MCRTransformerPipe MCR.ContentTransformer.response-browse.Steps=response-mycoreobject,mycoreobject MCR.ContentTransformer.mods2xeditor.Stylesheet=xsl/editor/mods2xeditor.xsl -MCR.ContentTransformer.mods2marcxml.Stylesheet=xsl/mods2marcxml.xsl,xsl/marc-tidy.xsl +MCR.ContentTransformer.mods2marcxml.Stylesheet=xslt/mods2marcxml.xsl,xslt/marc-tidy.xsl MCR.ContentTransformer.mods2marcxml.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl MCR.ContentTransformer.marcxml.Class=org.mycore.common.content.transformer.MCRTransformerPipe MCR.ContentTransformer.marcxml.Steps=mods,mods2marcxml @@ -264,9 +290,9 @@ MCR.ContentTransformer.oai-mods.Stylesheet=xsl/mods2mods.xsl MCR.ContentTransformer.oai-epicur.Stylesheet=xsl/mods2epicur.xsl MCR.ContentTransformer.oai-xMetaDissPlus.Stylesheet=xsl/mods2xMetaDissPlus.xsl MCR.ContentTransformer.oai-oai_dc.Stylesheet=xsl/mods2oai_dc.xsl -MCR.ContentTransformer.datacite.Stylesheet=xsl/mycoreobject-datacite-mir.xsl +MCR.ContentTransformer.datacite.Stylesheet=xslt/mycoreobject-datacite-mir.xsl MCR.ContentTransformer.datacite.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl -MCR.ContentTransformer.oai-oai_datacite.Stylesheet=xsl/mods2datacite.xsl +MCR.ContentTransformer.oai-oai_datacite.Stylesheet=xslt/mods2datacite.xsl MCR.ContentTransformer.oai-oai_datacite.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl MCR.URIResolver.xslIncludes.datacite=mycoreobject-datacite-mir.xsl @@ -276,7 +302,7 @@ MCR.ContentTransformer.response-resultlist.Stylesheet=%MCR.ContentTransformer.re MCR.Viewer.metadata.transformer = mycoreobject-viewer MCR.ContentTransformer.mycoreobject-viewer.Stylesheet=xsl/mycoreobject-mods.xsl,xsl/mods-pure-viewer.xsl -MCR.ContentTransformer.pica2mods.Stylesheet=xsl/pica2mods.xsl +MCR.ContentTransformer.pica2mods.Stylesheet=xslt/pica2mods.xsl MCR.ContentTransformer.pica2mods.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl # Configure stylesheets used by content transformers @@ -289,7 +315,7 @@ MIR.xMetaDissPlus.person.termsOfAddress2academicTitle=false ############################################################################## # Support for Podcasts # ############################################################################## -MCR.ContentTransformer.mycoreobject-podcast.Stylesheet=xsl/mycoreobject-podcast.xsl +MCR.ContentTransformer.mycoreobject-podcast.Stylesheet=xslt/mycoreobject-podcast.xsl MCR.ContentTransformer.mycoreobject-podcast.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl # Apple requires an image of 3000x3000 MCR.IIIFImage.thumbnail.MaxImageBytes=27000000 @@ -480,7 +506,7 @@ MCR.GoogleSitemap.SolrQuery=worldReadable:true AND ((objectType:mods AND -state: # MCR.Sword.DefaultOJS.State = imported # MCR.ContentTransformer.ojsmets2mods.Class=org.mycore.common.content.transformer.MCRXSLTransformer -# MCR.ContentTransformer.ojsmets2mods.Stylesheet=xsl/sword/ojsmets2mods.xsl +# MCR.ContentTransformer.ojsmets2mods.Stylesheet=xslt/sword/ojsmets2mods.xsl # MCR.ContentTransformer.ojsmets2mods.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl # Goobi @@ -499,7 +525,7 @@ MCR.GoogleSitemap.SolrQuery=worldReadable:true AND ((objectType:mods AND -state: # MCR.ContentTransformer.deepgreenjats2mods.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl # MCR.ContentTransformer.deepgreenjats2mods.Class=org.mycore.common.content.transformer.MCRXSLTransformer -# MCR.ContentTransformer.deepgreenjats2mods.Stylesheet=xsl/sword/jats2mods.xsl +# MCR.ContentTransformer.deepgreenjats2mods.Stylesheet=xslt/sword/jats2mods.xsl # When set to "embed", related host publication (journal) will be embedded. # When set to "link", related host publication (journal) will be created and/or linked via @xlink:href. @@ -515,7 +541,7 @@ MCR.GoogleSitemap.SolrQuery=worldReadable:true AND ((objectType:mods AND -state: # MCR.ContentTransformer.dissemin2mods.Stylesheet=xsl/sword/dissemin-mods2mycore-mods.xsl # MCR.ContentTransformer.mycoreobject2dissemin-status.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl -# MCR.ContentTransformer.mycoreobject2dissemin-status.Stylesheet=xsl/sword/mycoreobject2dissemin-status.xsl +# MCR.ContentTransformer.mycoreobject2dissemin-status.Stylesheet=xslt/sword/mycoreobject2dissemin-status.xsl ############################################################################## @@ -643,7 +669,7 @@ MIR.OADOI.Mail.Address=%MCR.mir-module.MailSender% MCR.MODS.EnrichmentResolver.DataSource.OADOI.IdentifierTypes=doi MCR.MODS.EnrichmentResolver.DataSource.OADOI.doi.URI=xslStyle:import/simplify-json-xml,import/oadoi2mods:xslTransform:json2xml:https://api.oadoi.org/v2/{1}?email=%MIR.OADOI.Mail.Address% MCR.ContentTransformer.dummy-json2xml.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl -MCR.ContentTransformer.dummy-json2xml.Stylesheet=xsl/convertjson.xsl +MCR.ContentTransformer.dummy-json2xml.Stylesheet=xslt/convertjson.xsl MCR.ContentTransformer.json2xml.Class=org.mycore.mir.importer.JSON2XMLTransformer # Embargo auto release @@ -707,7 +733,7 @@ MIR.Workflow.Box=false # new Metadata Layout # ############################################################################## MCR.ContentTransformer.DefaultStep.Stylesheet=%MCR.LayoutTransformerFactory.Default.Stylesheets% -MCR.ContentTransformer.newMetadataStylesheet.Stylesheet=xsl/metadata/mods-metadata-page.xsl +MCR.ContentTransformer.newMetadataStylesheet.Stylesheet=xslt/metadata/mods-metadata-page.xsl MCR.ContentTransformer.newMetadataStylesheet.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl MCR.ContentTransformer.mycoreobject.Class=org.mycore.common.content.transformer.MCRTransformerPipe MCR.ContentTransformer.mycoreobject.Steps=mycoreobject-modsmeta,newMetadataStylesheet,DefaultStep diff --git a/mir-module/src/main/resources/xsl/MARC21slimUtils.xsl b/mir-module/src/main/resources/xslt/MARC21slimUtils.xsl similarity index 100% rename from mir-module/src/main/resources/xsl/MARC21slimUtils.xsl rename to mir-module/src/main/resources/xslt/MARC21slimUtils.xsl diff --git a/mir-module/src/main/resources/xsl/convertjson.xsl b/mir-module/src/main/resources/xslt/convertjson.xsl similarity index 100% rename from mir-module/src/main/resources/xsl/convertjson.xsl rename to mir-module/src/main/resources/xslt/convertjson.xsl diff --git a/mir-module/src/main/resources/xsl/marc-tidy.xsl b/mir-module/src/main/resources/xslt/marc-tidy.xsl similarity index 100% rename from mir-module/src/main/resources/xsl/marc-tidy.xsl rename to mir-module/src/main/resources/xslt/marc-tidy.xsl diff --git a/mir-module/src/main/resources/xsl/metadata/mods-metadata-page.xsl b/mir-module/src/main/resources/xslt/metadata/mods-metadata-page.xsl similarity index 98% rename from mir-module/src/main/resources/xsl/metadata/mods-metadata-page.xsl rename to mir-module/src/main/resources/xslt/metadata/mods-metadata-page.xsl index 204f23b958..f19a9248dc 100644 --- a/mir-module/src/main/resources/xsl/metadata/mods-metadata-page.xsl +++ b/mir-module/src/main/resources/xslt/metadata/mods-metadata-page.xsl @@ -5,8 +5,8 @@ exclude-result-prefixes="mcri18n mcrproperty" version="3.0"> - - + + diff --git a/mir-module/src/main/resources/xsl/mods2datacite.xsl b/mir-module/src/main/resources/xslt/mods2datacite.xsl similarity index 93% rename from mir-module/src/main/resources/xsl/mods2datacite.xsl rename to mir-module/src/main/resources/xslt/mods2datacite.xsl index 8ee062a470..ee0b34857b 100644 --- a/mir-module/src/main/resources/xsl/mods2datacite.xsl +++ b/mir-module/src/main/resources/xslt/mods2datacite.xsl @@ -4,4 +4,4 @@ - \ No newline at end of file + diff --git a/mir-module/src/main/resources/xsl/mods2marcxml.xsl b/mir-module/src/main/resources/xslt/mods2marcxml.xsl similarity index 100% rename from mir-module/src/main/resources/xsl/mods2marcxml.xsl rename to mir-module/src/main/resources/xslt/mods2marcxml.xsl diff --git a/mir-module/src/main/resources/xsl/mycoreobject-datacite-mir.xsl b/mir-module/src/main/resources/xslt/mycoreobject-datacite-mir.xsl similarity index 100% rename from mir-module/src/main/resources/xsl/mycoreobject-datacite-mir.xsl rename to mir-module/src/main/resources/xslt/mycoreobject-datacite-mir.xsl diff --git a/mir-module/src/main/resources/xsl/mycoreobject-podcast.xsl b/mir-module/src/main/resources/xslt/mycoreobject-podcast.xsl similarity index 100% rename from mir-module/src/main/resources/xsl/mycoreobject-podcast.xsl rename to mir-module/src/main/resources/xslt/mycoreobject-podcast.xsl diff --git a/mir-module/src/main/resources/xsl/rules-helper.xsl b/mir-module/src/main/resources/xslt/rules-helper.xsl similarity index 100% rename from mir-module/src/main/resources/xsl/rules-helper.xsl rename to mir-module/src/main/resources/xslt/rules-helper.xsl diff --git a/mir-module/src/main/resources/xsl/sword/jats2mods.xsl b/mir-module/src/main/resources/xslt/sword/jats2mods.xsl similarity index 97% rename from mir-module/src/main/resources/xsl/sword/jats2mods.xsl rename to mir-module/src/main/resources/xslt/sword/jats2mods.xsl index 3ab44819ae..f5f43d6281 100644 --- a/mir-module/src/main/resources/xsl/sword/jats2mods.xsl +++ b/mir-module/src/main/resources/xslt/sword/jats2mods.xsl @@ -1,519 +1,519 @@ - - - - - - - - - - - - - - - - - - - - - - - - - text - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - mir_genres - article - - - - - - - - mir_genres - journal - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - _mods_00000000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - code - marcrelator - - - - text - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - orcid.org/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + text + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + mir_genres + article + + + + + + + + mir_genres + journal + + + + + + + + + + + + + + + + # + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + _mods_00000000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + code + marcrelator + + + + text + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + orcid.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mir-module/src/main/resources/xsl/sword/mycoreobject2dissemin-status.xsl b/mir-module/src/main/resources/xslt/sword/mycoreobject2dissemin-status.xsl similarity index 100% rename from mir-module/src/main/resources/xsl/sword/mycoreobject2dissemin-status.xsl rename to mir-module/src/main/resources/xslt/sword/mycoreobject2dissemin-status.xsl diff --git a/mir-module/src/main/resources/xsl/sword/ojsmets2mods.xsl b/mir-module/src/main/resources/xslt/sword/ojsmets2mods.xsl similarity index 100% rename from mir-module/src/main/resources/xsl/sword/ojsmets2mods.xsl rename to mir-module/src/main/resources/xslt/sword/ojsmets2mods.xsl diff --git a/mir-module/src/test/java/org/mycore/mir/acl/MIRACLTest.java b/mir-module/src/test/java/org/mycore/mir/acl/MIRACLTest.java index ad167c04b0..7c001a8a6d 100644 --- a/mir-module/src/test/java/org/mycore/mir/acl/MIRACLTest.java +++ b/mir-module/src/test/java/org/mycore/mir/acl/MIRACLTest.java @@ -195,7 +195,7 @@ protected Map getTestProperties() { "org.mycore.common.content.transformer.MCRXSLTransformer"); testProperties.put("MCR.ContentTransformer.rules-helper.TransformerFactoryClass", "net.sf.saxon.TransformerFactoryImpl"); - testProperties.put("MCR.ContentTransformer.rules-helper.Stylesheet", "xsl/rules-helper.xsl"); + testProperties.put("MCR.ContentTransformer.rules-helper.Stylesheet", "xslt/rules-helper.xsl"); testProperties.put("MCR.Access.Strategy.Class", "org.mycore.access.facts.MCRFactsAccessSystem"); testProperties.put("MCR.Access.Class", "org.mycore.access.facts.MCRFactsAccessSystem");