From 6aef2a672f3bb9a18cc8e0e2fc79a3084c885028 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Mon, 18 Sep 2023 18:51:59 +0200 Subject: [PATCH 01/21] MCR-2966 xslt folder move saxon xsls to xslt folder, add configuration variable for default xsl folder --- .../{xsl => xslt}/functions/accesskey.xsl | 0 .../xml/MCRLayoutTransformerFactory.java | 3 ++- .../org/mycore/common/xml/MCRURIResolver.java | 18 +++++++++++++----- .../main/resources/config/mycore.properties | 5 ++++- .../MyCoReLayout.xsl} | 0 .../MyCoReWebPage.xsl} | 2 +- .../{xsl => xslt}/default-parameters.xsl | 0 .../resources/{xsl => xslt}/functions/acl.xsl | 0 .../{xsl => xslt}/functions/classification.xsl | 0 .../{xsl => xslt}/functions/derivate.xsl | 0 .../resources/{xsl => xslt}/functions/i18n.xsl | 0 .../{xsl => xslt}/functions/layoututils.xsl | 0 .../{xsl => xslt}/functions/mcrversion.xsl | 0 .../{xsl => xslt}/functions/property.xsl | 0 .../{xsl => xslt}/functions/stringutils.xsl | 0 .../resources/{xsl => xslt}/functions/url.xsl | 0 .../classificationBrowser.xsl} | 0 .../classificationBrowserData-bootstrap.xsl} | 0 .../classificationBrowserData.xsl} | 0 .../classificationEditor.xsl} | 2 +- .../classificationEditorBase.xsl} | 0 .../components/iview2/config/mycore.properties | 4 ++-- .../{xsl => xslt}/functions/iview2.xsl | 0 .../iview2-solrresponse.xsl} | 0 .../mcr-module-startIview2.xsl} | 0 .../components/mods/config/mycore.properties | 2 +- .../resources/{xsl => xslt}/crossref/mods.xsl | 0 .../{xsl => xslt}/crossref/mods2book.xsl | 0 .../{xsl => xslt}/crossref/mods2journal.xsl | 0 .../resources/{xsl => xslt}/functions/mods.xsl | 0 .../solr/indexing/mods-dynamicfields.xsl} | 4 ++-- .../solr/indexing/mods-solr.xsl} | 6 +++--- .../utils/mods-enhancer.xsl} | 0 .../utils/mods-utils.xsl} | 4 ++-- .../components/solr/config/mycore.properties | 10 +++++----- .../resources/{xsl => xslt}/functions/solr.xsl | 0 .../indexing/mycoreobject-dynamicfields.xsl} | 4 ++-- .../indexing/mycoreobject-solrdocument.xsl} | 0 .../solr/indexing/solr-basetemplate.xsl} | 2 +- .../solr/response/response-addDerivates.xsl} | 0 .../solr/response/response-addDocId.xsl} | 0 .../solr/response/response-browse.xsl} | 4 ++-- .../solr/response/response-join-results.xsl} | 0 .../solr/response/response-utils.xsl} | 0 .../solr/response/response.xsl} | 4 ++-- .../solr/xeditor/solr-xeditor-templates.xsl} | 0 ...lassificationBrowserData-roleSubselect.xsl} | 0 .../{xsl/login-3.xsl => xslt/login.xsl} | 2 +- .../{xsl/roles-3.xsl => xslt/roles.xsl} | 4 ++-- .../{xsl/user-3.xsl => xslt/user.xsl} | 2 +- .../users-subselect.xsl} | 2 +- .../{xsl/users-3.xsl => xslt/users.xsl} | 2 +- .../components/viewer/config/mycore.properties | 2 +- .../IViewConfig-3.xsl => xslt/IViewConfig.xsl} | 0 .../altoChanges-3.xsl => xslt/altoChanges.xsl} | 0 .../{xsl/wcms2-3.xsl => xslt/wcms2.xsl} | 0 .../webtools/config/mycore.properties | 2 +- .../msie-warning.xsl} | 2 ++ .../processingGUI.xsl} | 0 .../sessionListing.xsl} | 0 .../frontend/xeditor/MCRPostProcessorXSL.java | 4 +++- .../xeditor-templates.xsl} | 0 62 files changed, 56 insertions(+), 40 deletions(-) rename mycore-acl/src/main/resources/{xsl => xslt}/functions/accesskey.xsl (100%) rename mycore-base/src/main/resources/{xsl/MyCoReLayout-3.xsl => xslt/MyCoReLayout.xsl} (100%) rename mycore-base/src/main/resources/{xsl/MyCoReWebPage-3.xsl => xslt/MyCoReWebPage.xsl} (99%) rename mycore-base/src/main/resources/{xsl => xslt}/default-parameters.xsl (100%) rename mycore-base/src/main/resources/{xsl => xslt}/functions/acl.xsl (100%) rename mycore-base/src/main/resources/{xsl => xslt}/functions/classification.xsl (100%) rename mycore-base/src/main/resources/{xsl => xslt}/functions/derivate.xsl (100%) rename mycore-base/src/main/resources/{xsl => xslt}/functions/i18n.xsl (100%) rename mycore-base/src/main/resources/{xsl => xslt}/functions/layoututils.xsl (100%) rename mycore-base/src/main/resources/{xsl => xslt}/functions/mcrversion.xsl (100%) rename mycore-base/src/main/resources/{xsl => xslt}/functions/property.xsl (100%) rename mycore-base/src/main/resources/{xsl => xslt}/functions/stringutils.xsl (100%) rename mycore-base/src/main/resources/{xsl => xslt}/functions/url.xsl (100%) rename mycore-classbrowser/src/main/resources/{xsl/classificationBrowser-3.xsl => xslt/classificationBrowser.xsl} (100%) rename mycore-classbrowser/src/main/resources/{xsl/classificationBrowserData-bootstrap-3.xsl => xslt/classificationBrowserData-bootstrap.xsl} (100%) rename mycore-classbrowser/src/main/resources/{xsl/classificationBrowserData-3.xsl => xslt/classificationBrowserData.xsl} (100%) rename mycore-classeditor/src/main/resources/{xsl/classificationEditor-3.xsl => xslt/classificationEditor.xsl} (98%) rename mycore-classeditor/src/main/resources/{xsl/classificationEditorBase-3.xsl => xslt/classificationEditorBase.xsl} (100%) rename mycore-iview2/src/main/resources/{xsl => xslt}/functions/iview2.xsl (100%) rename mycore-iview2/src/main/resources/{xsl/iview2-solrresponse-3.xsl => xslt/iview2-solrresponse.xsl} (100%) rename mycore-iview2/src/main/resources/{xsl/mcr-module-startIview2-3.xsl => xslt/mcr-module-startIview2.xsl} (100%) rename mycore-mods/src/main/resources/{xsl => xslt}/crossref/mods.xsl (100%) rename mycore-mods/src/main/resources/{xsl => xslt}/crossref/mods2book.xsl (100%) rename mycore-mods/src/main/resources/{xsl => xslt}/crossref/mods2journal.xsl (100%) rename mycore-mods/src/main/resources/{xsl => xslt}/functions/mods.xsl (100%) rename mycore-mods/src/main/resources/{xsl/solr/indexing/mods-dynamicfields-3.xsl => xslt/solr/indexing/mods-dynamicfields.xsl} (96%) rename mycore-mods/src/main/resources/{xsl/solr/indexing/mods-solr-3.xsl => xslt/solr/indexing/mods-solr.xsl} (98%) rename mycore-mods/src/main/resources/{xsl/utils/mods-enhancer-3.xsl => xslt/utils/mods-enhancer.xsl} (100%) rename mycore-mods/src/main/resources/{xsl/utils/mods-utils-3.xsl => xslt/utils/mods-utils.xsl} (99%) rename mycore-solr/src/main/resources/{xsl => xslt}/functions/solr.xsl (100%) rename mycore-solr/src/main/resources/{xsl/solr/indexing/mycoreobject-dynamicfields-3.xsl => xslt/solr/indexing/mycoreobject-dynamicfields.xsl} (98%) rename mycore-solr/src/main/resources/{xsl/solr/indexing/mycoreobject-solrdocument-3.xsl => xslt/solr/indexing/mycoreobject-solrdocument.xsl} (100%) rename mycore-solr/src/main/resources/{xsl/solr/indexing/solr-basetemplate-3.xsl => xslt/solr/indexing/solr-basetemplate.xsl} (99%) rename mycore-solr/src/main/resources/{xsl/solr/response/response-addDerivates-3.xsl => xslt/solr/response/response-addDerivates.xsl} (100%) rename mycore-solr/src/main/resources/{xsl/solr/response/response-addDocId-3.xsl => xslt/solr/response/response-addDocId.xsl} (100%) rename mycore-solr/src/main/resources/{xsl/solr/response/response-browse-3.xsl => xslt/solr/response/response-browse.xsl} (97%) rename mycore-solr/src/main/resources/{xsl/solr/response/response-join-results-3.xsl => xslt/solr/response/response-join-results.xsl} (100%) rename mycore-solr/src/main/resources/{xsl/solr/response/response-utils-3.xsl => xslt/solr/response/response-utils.xsl} (100%) rename mycore-solr/src/main/resources/{xsl/solr/response/response-3.xsl => xslt/solr/response/response.xsl} (98%) rename mycore-solr/src/main/resources/{xsl/solr/xeditor/solr-xeditor-templates-3.xsl => xslt/solr/xeditor/solr-xeditor-templates.xsl} (100%) rename mycore-user2/src/main/resources/{xsl/classificationBrowserData-roleSubselect-3.xsl => xslt/classificationBrowserData-roleSubselect.xsl} (100%) rename mycore-user2/src/main/resources/{xsl/login-3.xsl => xslt/login.xsl} (99%) rename mycore-user2/src/main/resources/{xsl/roles-3.xsl => xslt/roles.xsl} (93%) rename mycore-user2/src/main/resources/{xsl/user-3.xsl => xslt/user.xsl} (99%) rename mycore-user2/src/main/resources/{xsl/users-subselect-3.xsl => xslt/users-subselect.xsl} (97%) rename mycore-user2/src/main/resources/{xsl/users-3.xsl => xslt/users.xsl} (99%) rename mycore-viewer/src/main/resources/{xsl/IViewConfig-3.xsl => xslt/IViewConfig.xsl} (100%) rename mycore-viewer/src/main/resources/{xsl/altoChanges-3.xsl => xslt/altoChanges.xsl} (100%) rename mycore-wcms2/src/main/resources/{xsl/wcms2-3.xsl => xslt/wcms2.xsl} (100%) rename mycore-webtools/src/main/resources/{xsl/msie-warning-3.xsl => xslt/msie-warning.xsl} (97%) rename mycore-webtools/src/main/resources/{xsl/processingGUI-3.xsl => xslt/processingGUI.xsl} (100%) rename mycore-webtools/src/main/resources/{xsl/sessionListing-3.xsl => xslt/sessionListing.xsl} (100%) rename mycore-xeditor/src/main/resources/{xsl/xeditor-templates-3.xsl => xslt/xeditor-templates.xsl} (100%) diff --git a/mycore-acl/src/main/resources/xsl/functions/accesskey.xsl b/mycore-acl/src/main/resources/xslt/functions/accesskey.xsl similarity index 100% rename from mycore-acl/src/main/resources/xsl/functions/accesskey.xsl rename to mycore-acl/src/main/resources/xslt/functions/accesskey.xsl diff --git a/mycore-base/src/main/java/org/mycore/common/xml/MCRLayoutTransformerFactory.java b/mycore-base/src/main/java/org/mycore/common/xml/MCRLayoutTransformerFactory.java index b412d65cb4..fefd6eabc6 100644 --- a/mycore-base/src/main/java/org/mycore/common/xml/MCRLayoutTransformerFactory.java +++ b/mycore-base/src/main/java/org/mycore/common/xml/MCRLayoutTransformerFactory.java @@ -151,7 +151,8 @@ private String getResourceName(String id) { * Builds the filename of the stylesheet to use, e. g. "playlist-simple.xsl" */ private String buildStylesheetName(String id) { - return String.format(Locale.ROOT, "xsl/%s.xsl", id.replaceAll("-default$", "")); + final String xslFolder = MCRConfiguration2.getStringOrThrow("MCR.Layout.Transformer.Factory.XSLFolder"); + return String.format(Locale.ROOT, "%s/%s.xsl", xslFolder, id.replaceAll("-default$", "")); } } diff --git a/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java b/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java index 3a4243285f..354cb51cbf 100644 --- a/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java +++ b/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java @@ -266,7 +266,8 @@ private HashMap getResolverMapping() { static String getParentDirectoryResourceURI(String base) { if (base == null) { // the file was not included from another file, so we need to use the default resource directory - return "resource:xsl/"; + final String xslFolder = MCRConfiguration2.getStringOrThrow("MCR.Layout.Transformer.Factory.XSLFolder"); + return "resource:" + xslFolder + "/"; } else { String resolvingBase = null; @@ -370,7 +371,9 @@ private Source tryResolveXSL(String href, String base) throws TransformerExcepti } // new relative include did not work, now fall back to old behaviour and print a warning if it works - Source oldResolveMethodResult = SUPPORTED_SCHEMES.get("resource").resolve("resource:xsl/" + href, base); + final String xslFolder = MCRConfiguration2.getStringOrThrow("MCR.Layout.Transformer.Factory.XSLFolder"); + Source oldResolveMethodResult = SUPPORTED_SCHEMES.get("resource") + .resolve("resource:" + xslFolder + "/" + href, base); if (oldResolveMethodResult != null) { LOGGER.warn("The Stylesheet {} has include {} which only works with an old absolute include " + "mechanism. Please change the include to relative!", base, href); @@ -1218,9 +1221,10 @@ public Source resolve(String href, String base) throws TransformerException { } private MCRXSLTransformer getTransformer(String... stylesheet) { + final String xslFolder = MCRConfiguration2.getStringOrThrow("MCR.Layout.Transformer.Factory.XSLFolder"); String[] stylesheets = new String[stylesheet.length]; for (int i = 0; i < stylesheets.length; i++) { - stylesheets[i] = "xsl/" + stylesheet[i] + ".xsl"; + stylesheets[i] = xslFolder + "/" + stylesheet[i] + ".xsl"; } return MCRXSLTransformer.getInstance(stylesheets); } @@ -1329,10 +1333,12 @@ public Source resolve(String href, String base) { .orElseGet(Collections::emptyList); } + final String xslFolder = MCRConfiguration2.getStringOrThrow("MCR.Layout.Transformer.Factory.XSLFolder"); for (String include : propValue) { // create a new include element Element includeElement = new Element("include", xslNamespace); - includeElement.setAttribute("href", include.contains(":") ? include : "resource:xsl/" + include); + includeElement.setAttribute("href", + include.contains(":") ? include : "resource:" + xslFolder + "/" + include); root.addContent(includeElement); LOGGER.debug("Resolved XSL include: {}", include); } @@ -1366,7 +1372,9 @@ public Source resolve(String href, String base) throws TransformerException { return new JDOMSource(root); } LOGGER.debug("xslImport importing {}", importXSL); - return fallback.resolve("resource:xsl/" + importXSL, base); + + final String xslFolder = MCRConfiguration2.getStringOrThrow("MCR.Layout.Transformer.Factory.XSLFolder"); + return fallback.resolve("resource:" + xslFolder + "/" + importXSL, base); } } diff --git a/mycore-base/src/main/resources/config/mycore.properties b/mycore-base/src/main/resources/config/mycore.properties index b4ae981304..383f82dab3 100644 --- a/mycore-base/src/main/resources/config/mycore.properties +++ b/mycore-base/src/main/resources/config/mycore.properties @@ -91,6 +91,9 @@ MCR.BatchEditor.BaseLevel.object=/mycoreobject # Define the LayoutFactory class MCR.Layout.Transformer.Factory=org.mycore.common.xml.MCRLayoutTransformerFactory +# Default folder for XSL files, switch to XSLT for XSLT-3 applications +MCR.Layout.Transformer.Factory.XSLFolder=xsl + # The format of the session ID # MCR.Session.Param=;jsessionid= @@ -470,7 +473,7 @@ MCR.Startup.Class=org.mycore.backend.jpa.MCRJPABootstrapper,org.mycore.datamodel MCR.Website.ReadAccessVerification=true MCR.URIResolver.xslIncludes.MyCoReWebPage=classificationBrowser.xsl -MCR.URIResolver.xslIncludes.MyCoReWebPage-3=classificationBrowser-3.xsl +MCR.URIResolver.xslIncludes.MyCoReWebPage-3=classificationBrowser.xsl MCR.URIResolver.xslIncludes.functions=functions/acl.xsl,functions/classification.xsl,functions/derivate.xsl,functions/i18n.xsl,functions/mcrversion.xsl,functions/property.xsl,functions/stringutils.xsl,functions/url.xsl,functions/layoututils.xsl ############################################################################## diff --git a/mycore-base/src/main/resources/xsl/MyCoReLayout-3.xsl b/mycore-base/src/main/resources/xslt/MyCoReLayout.xsl similarity index 100% rename from mycore-base/src/main/resources/xsl/MyCoReLayout-3.xsl rename to mycore-base/src/main/resources/xslt/MyCoReLayout.xsl diff --git a/mycore-base/src/main/resources/xsl/MyCoReWebPage-3.xsl b/mycore-base/src/main/resources/xslt/MyCoReWebPage.xsl similarity index 99% rename from mycore-base/src/main/resources/xsl/MyCoReWebPage-3.xsl rename to mycore-base/src/main/resources/xslt/MyCoReWebPage.xsl index 359174db5e..2771766370 100644 --- a/mycore-base/src/main/resources/xsl/MyCoReWebPage-3.xsl +++ b/mycore-base/src/main/resources/xslt/MyCoReWebPage.xsl @@ -12,7 +12,7 @@ > &html-output; - + diff --git a/mycore-base/src/main/resources/xsl/default-parameters.xsl b/mycore-base/src/main/resources/xslt/default-parameters.xsl similarity index 100% rename from mycore-base/src/main/resources/xsl/default-parameters.xsl rename to mycore-base/src/main/resources/xslt/default-parameters.xsl diff --git a/mycore-base/src/main/resources/xsl/functions/acl.xsl b/mycore-base/src/main/resources/xslt/functions/acl.xsl similarity index 100% rename from mycore-base/src/main/resources/xsl/functions/acl.xsl rename to mycore-base/src/main/resources/xslt/functions/acl.xsl diff --git a/mycore-base/src/main/resources/xsl/functions/classification.xsl b/mycore-base/src/main/resources/xslt/functions/classification.xsl similarity index 100% rename from mycore-base/src/main/resources/xsl/functions/classification.xsl rename to mycore-base/src/main/resources/xslt/functions/classification.xsl diff --git a/mycore-base/src/main/resources/xsl/functions/derivate.xsl b/mycore-base/src/main/resources/xslt/functions/derivate.xsl similarity index 100% rename from mycore-base/src/main/resources/xsl/functions/derivate.xsl rename to mycore-base/src/main/resources/xslt/functions/derivate.xsl diff --git a/mycore-base/src/main/resources/xsl/functions/i18n.xsl b/mycore-base/src/main/resources/xslt/functions/i18n.xsl similarity index 100% rename from mycore-base/src/main/resources/xsl/functions/i18n.xsl rename to mycore-base/src/main/resources/xslt/functions/i18n.xsl diff --git a/mycore-base/src/main/resources/xsl/functions/layoututils.xsl b/mycore-base/src/main/resources/xslt/functions/layoututils.xsl similarity index 100% rename from mycore-base/src/main/resources/xsl/functions/layoututils.xsl rename to mycore-base/src/main/resources/xslt/functions/layoututils.xsl diff --git a/mycore-base/src/main/resources/xsl/functions/mcrversion.xsl b/mycore-base/src/main/resources/xslt/functions/mcrversion.xsl similarity index 100% rename from mycore-base/src/main/resources/xsl/functions/mcrversion.xsl rename to mycore-base/src/main/resources/xslt/functions/mcrversion.xsl diff --git a/mycore-base/src/main/resources/xsl/functions/property.xsl b/mycore-base/src/main/resources/xslt/functions/property.xsl similarity index 100% rename from mycore-base/src/main/resources/xsl/functions/property.xsl rename to mycore-base/src/main/resources/xslt/functions/property.xsl diff --git a/mycore-base/src/main/resources/xsl/functions/stringutils.xsl b/mycore-base/src/main/resources/xslt/functions/stringutils.xsl similarity index 100% rename from mycore-base/src/main/resources/xsl/functions/stringutils.xsl rename to mycore-base/src/main/resources/xslt/functions/stringutils.xsl diff --git a/mycore-base/src/main/resources/xsl/functions/url.xsl b/mycore-base/src/main/resources/xslt/functions/url.xsl similarity index 100% rename from mycore-base/src/main/resources/xsl/functions/url.xsl rename to mycore-base/src/main/resources/xslt/functions/url.xsl diff --git a/mycore-classbrowser/src/main/resources/xsl/classificationBrowser-3.xsl b/mycore-classbrowser/src/main/resources/xslt/classificationBrowser.xsl similarity index 100% rename from mycore-classbrowser/src/main/resources/xsl/classificationBrowser-3.xsl rename to mycore-classbrowser/src/main/resources/xslt/classificationBrowser.xsl diff --git a/mycore-classbrowser/src/main/resources/xsl/classificationBrowserData-bootstrap-3.xsl b/mycore-classbrowser/src/main/resources/xslt/classificationBrowserData-bootstrap.xsl similarity index 100% rename from mycore-classbrowser/src/main/resources/xsl/classificationBrowserData-bootstrap-3.xsl rename to mycore-classbrowser/src/main/resources/xslt/classificationBrowserData-bootstrap.xsl diff --git a/mycore-classbrowser/src/main/resources/xsl/classificationBrowserData-3.xsl b/mycore-classbrowser/src/main/resources/xslt/classificationBrowserData.xsl similarity index 100% rename from mycore-classbrowser/src/main/resources/xsl/classificationBrowserData-3.xsl rename to mycore-classbrowser/src/main/resources/xslt/classificationBrowserData.xsl diff --git a/mycore-classeditor/src/main/resources/xsl/classificationEditor-3.xsl b/mycore-classeditor/src/main/resources/xslt/classificationEditor.xsl similarity index 98% rename from mycore-classeditor/src/main/resources/xsl/classificationEditor-3.xsl rename to mycore-classeditor/src/main/resources/xslt/classificationEditor.xsl index 9448602f11..eaeeb69e31 100644 --- a/mycore-classeditor/src/main/resources/xsl/classificationEditor-3.xsl +++ b/mycore-classeditor/src/main/resources/xslt/classificationEditor.xsl @@ -5,7 +5,7 @@ version="3"> - + diff --git a/mycore-classeditor/src/main/resources/xsl/classificationEditorBase-3.xsl b/mycore-classeditor/src/main/resources/xslt/classificationEditorBase.xsl similarity index 100% rename from mycore-classeditor/src/main/resources/xsl/classificationEditorBase-3.xsl rename to mycore-classeditor/src/main/resources/xslt/classificationEditorBase.xsl diff --git a/mycore-iview2/src/main/resources/components/iview2/config/mycore.properties b/mycore-iview2/src/main/resources/components/iview2/config/mycore.properties index ccfb9d2b55..f3a883d67b 100644 --- a/mycore-iview2/src/main/resources/components/iview2/config/mycore.properties +++ b/mycore-iview2/src/main/resources/components/iview2/config/mycore.properties @@ -20,9 +20,9 @@ MCR.Module-iview2.MaxResetCount=3 MCR.CLI.Classes.Internal=%MCR.CLI.Classes.Internal%,org.mycore.iview2.frontend.MCRIView2Commands MCR.URIResolver.ModuleResolver.iview2=org.mycore.iview2.services.MCRIview2URIResolver MCR.URIResolver.xslIncludes.components=%MCR.URIResolver.xslIncludes.components%,mcr-module-startIview2.xsl -MCR.URIResolver.xslIncludes.components-3=%MCR.URIResolver.xslIncludes.components-3%,mcr-module-startIview2-3.xsl +MCR.URIResolver.xslIncludes.components-3=%MCR.URIResolver.xslIncludes.components-3%,mcr-module-startIview2.xsl MCR.URIResolver.xslIncludes.solrResponse=%MCR.URIResolver.xslIncludes.solrResponse%,iview2-solrresponse.xsl -MCR.URIResolver.xslIncludes.solrResponse-3=%MCR.URIResolver.xslIncludes.solrResponse-3%,iview2-solrresponse-3.xsl +MCR.URIResolver.xslIncludes.solrResponse-3=%MCR.URIResolver.xslIncludes.solrResponse-3%,iview2-solrresponse.xsl MCR.URIResolver.xslIncludes.functions=%MCR.URIResolver.xslIncludes.functions%,functions/iview2.xsl MCR.Hibernate.Mappings=%MCR.Hibernate.Mappings%,org.mycore.iview2.services.MCRTileJob diff --git a/mycore-iview2/src/main/resources/xsl/functions/iview2.xsl b/mycore-iview2/src/main/resources/xslt/functions/iview2.xsl similarity index 100% rename from mycore-iview2/src/main/resources/xsl/functions/iview2.xsl rename to mycore-iview2/src/main/resources/xslt/functions/iview2.xsl diff --git a/mycore-iview2/src/main/resources/xsl/iview2-solrresponse-3.xsl b/mycore-iview2/src/main/resources/xslt/iview2-solrresponse.xsl similarity index 100% rename from mycore-iview2/src/main/resources/xsl/iview2-solrresponse-3.xsl rename to mycore-iview2/src/main/resources/xslt/iview2-solrresponse.xsl diff --git a/mycore-iview2/src/main/resources/xsl/mcr-module-startIview2-3.xsl b/mycore-iview2/src/main/resources/xslt/mcr-module-startIview2.xsl similarity index 100% rename from mycore-iview2/src/main/resources/xsl/mcr-module-startIview2-3.xsl rename to mycore-iview2/src/main/resources/xslt/mcr-module-startIview2.xsl diff --git a/mycore-mods/src/main/resources/components/mods/config/mycore.properties b/mycore-mods/src/main/resources/components/mods/config/mycore.properties index 5c5c61ed66..255532af2d 100644 --- a/mycore-mods/src/main/resources/components/mods/config/mycore.properties +++ b/mycore-mods/src/main/resources/components/mods/config/mycore.properties @@ -82,7 +82,7 @@ MCR.URIResolver.xslIncludes.functions=%MCR.URIResolver.xslIncludes.functions%,fu MCR.URIResolver.xslIncludes.datacite=mycoreobject-datacite.xsl MCR.URIResolver.xslIncludes.schemaorg= MCR.URIResolver.xslImports.solr-document=%MCR.URIResolver.xslImports.solr-document%,mods-solr.xsl -MCR.URIResolver.xslImports.solr-document-3=%MCR.URIResolver.xslImports.solr-document-3%,solr/indexing/mods-solr-3.xsl,solr/indexing/mods-dynamicfields-3.xsl +MCR.URIResolver.xslImports.solr-document-3=%MCR.URIResolver.xslImports.solr-document-3%,solr/indexing/mods-solr.xsl,solr/indexing/mods-dynamicfields.xsl MCR.URIResolver.redirect.editor-mods-external=webapp:editor/editor-mods-external.xml # URIResolver to sort MODS diff --git a/mycore-mods/src/main/resources/xsl/crossref/mods.xsl b/mycore-mods/src/main/resources/xslt/crossref/mods.xsl similarity index 100% rename from mycore-mods/src/main/resources/xsl/crossref/mods.xsl rename to mycore-mods/src/main/resources/xslt/crossref/mods.xsl diff --git a/mycore-mods/src/main/resources/xsl/crossref/mods2book.xsl b/mycore-mods/src/main/resources/xslt/crossref/mods2book.xsl similarity index 100% rename from mycore-mods/src/main/resources/xsl/crossref/mods2book.xsl rename to mycore-mods/src/main/resources/xslt/crossref/mods2book.xsl diff --git a/mycore-mods/src/main/resources/xsl/crossref/mods2journal.xsl b/mycore-mods/src/main/resources/xslt/crossref/mods2journal.xsl similarity index 100% rename from mycore-mods/src/main/resources/xsl/crossref/mods2journal.xsl rename to mycore-mods/src/main/resources/xslt/crossref/mods2journal.xsl diff --git a/mycore-mods/src/main/resources/xsl/functions/mods.xsl b/mycore-mods/src/main/resources/xslt/functions/mods.xsl similarity index 100% rename from mycore-mods/src/main/resources/xsl/functions/mods.xsl rename to mycore-mods/src/main/resources/xslt/functions/mods.xsl diff --git a/mycore-mods/src/main/resources/xsl/solr/indexing/mods-dynamicfields-3.xsl b/mycore-mods/src/main/resources/xslt/solr/indexing/mods-dynamicfields.xsl similarity index 96% rename from mycore-mods/src/main/resources/xsl/solr/indexing/mods-dynamicfields-3.xsl rename to mycore-mods/src/main/resources/xslt/solr/indexing/mods-dynamicfields.xsl index 3e601b802a..5fe0dc2b60 100644 --- a/mycore-mods/src/main/resources/xsl/solr/indexing/mods-dynamicfields-3.xsl +++ b/mycore-mods/src/main/resources/xslt/solr/indexing/mods-dynamicfields.xsl @@ -6,9 +6,9 @@ xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:mcrmods="http://www.mycore.de/xslt/mods"> - + - + diff --git a/mycore-mods/src/main/resources/xsl/solr/indexing/mods-solr-3.xsl b/mycore-mods/src/main/resources/xslt/solr/indexing/mods-solr.xsl similarity index 98% rename from mycore-mods/src/main/resources/xsl/solr/indexing/mods-solr-3.xsl rename to mycore-mods/src/main/resources/xslt/solr/indexing/mods-solr.xsl index 5ad3bef8eb..396426fc96 100644 --- a/mycore-mods/src/main/resources/xsl/solr/indexing/mods-solr-3.xsl +++ b/mycore-mods/src/main/resources/xslt/solr/indexing/mods-solr.xsl @@ -8,11 +8,11 @@ exclude-result-prefixes="xlink mods fn mcrmods"> - + - - + + diff --git a/mycore-mods/src/main/resources/xsl/utils/mods-enhancer-3.xsl b/mycore-mods/src/main/resources/xslt/utils/mods-enhancer.xsl similarity index 100% rename from mycore-mods/src/main/resources/xsl/utils/mods-enhancer-3.xsl rename to mycore-mods/src/main/resources/xslt/utils/mods-enhancer.xsl diff --git a/mycore-mods/src/main/resources/xsl/utils/mods-utils-3.xsl b/mycore-mods/src/main/resources/xslt/utils/mods-utils.xsl similarity index 99% rename from mycore-mods/src/main/resources/xsl/utils/mods-utils-3.xsl rename to mycore-mods/src/main/resources/xslt/utils/mods-utils.xsl index a306eb0a03..72b1f35da8 100644 --- a/mycore-mods/src/main/resources/xsl/utils/mods-utils-3.xsl +++ b/mycore-mods/src/main/resources/xslt/utils/mods-utils.xsl @@ -36,8 +36,8 @@ - - + + diff --git a/mycore-solr/src/main/resources/components/solr/config/mycore.properties b/mycore-solr/src/main/resources/components/solr/config/mycore.properties index ef4a85da35..c947bbd3e3 100644 --- a/mycore-solr/src/main/resources/components/solr/config/mycore.properties +++ b/mycore-solr/src/main/resources/components/solr/config/mycore.properties @@ -9,7 +9,7 @@ MCR.EventHandler.MCRPath.100.Class=org.mycore.solr.index.MCRSolrIndexEventHandle MCR.URIResolver.ModuleResolver.solr=org.mycore.solr.common.xml.MCRSolrQueryResolver MCR.URIResolver.xslImports.solr-document=solr-basetemplate.xsl -MCR.URIResolver.xslImports.solr-document-3=solr/indexing/solr-basetemplate-3.xsl +MCR.URIResolver.xslImports.solr-document-3=solr/indexing/solr-basetemplate.xsl MCR.Module-classbrowser.QueryAdapter=org.mycore.solr.search.MCRSolrQueryAdapter @@ -58,7 +58,7 @@ MCR.ContentTransformer.mycoreobject-solrdocument.Stylesheet=xsl/mycoreobject-sol MCR.ContentTransformer.mycoreobject-solrdocument.Context=org.mycore.solr.index.document.jaxb MCR.ContentTransformer.mycoreobject-solrdocument-3.Class=org.mycore.common.content.transformer.MCRXSL2JAXBTransformer -MCR.ContentTransformer.mycoreobject-solrdocument-3.Stylesheet=xsl/solr/indexing/mycoreobject-solrdocument-3.xsl +MCR.ContentTransformer.mycoreobject-solrdocument-3.Stylesheet=xslt/solr/indexing/mycoreobject-solrdocument.xsl MCR.ContentTransformer.mycoreobject-solrdocument-3.Context=org.mycore.solr.index.document.jaxb MCR.ContentTransformer.mycoreobject-solrdocument-3.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl @@ -69,7 +69,7 @@ MCR.ContentTransformer.response-solrdocument.Context=%MCR.ContentTransformer.myc MCR.ContentTransformer.response-prepared-3.Class=org.mycore.common.content.transformer.MCRXSLTransformer MCR.ContentTransformer.response-prepared-3.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl -MCR.ContentTransformer.response-prepared-3.Stylesheet=xsl/solr/response/response-join-results-3.xsl,xsl/solr/response/response-addDocId-3.xsl,xsl/solr/response/response-addDerivates-3.xsl +MCR.ContentTransformer.response-prepared-3.Stylesheet=xslt/solr/response/response-join-results.xsl,xslt/solr/response/response-addDocId.xsl,xslt/solr/response/response-addDerivates.xsl MCR.ContentTransformer.response-prepared.Class=org.mycore.common.content.transformer.MCRXSLTransformer MCR.ContentTransformer.response-prepared.TransformerFactoryClass=org.apache.xalan.processor.TransformerFactoryImpl @@ -89,9 +89,9 @@ MCR.Solr.JoinQueryFields=%MCR.Solr.ContentBaseFields%,%MCR.Solr.AVExtenderFields MCR.CLI.Classes.Internal=%MCR.CLI.Classes.Internal%,org.mycore.solr.commands.MCRSolrCommands MCR.URIResolver.xslImports.solr-document=%MCR.URIResolver.xslImports.solr-document%,mycoreobject-dynamicfields.xsl -MCR.URIResolver.xslImports.solr-document-3=%MCR.URIResolver.xslImports.solr-document-3%,solr/indexing/mycoreobject-dynamicfields-3.xsl +MCR.URIResolver.xslImports.solr-document-3=%MCR.URIResolver.xslImports.solr-document-3%,solr/indexing/mycoreobject-dynamicfields.xsl MCR.URIResolver.xslIncludes.xeditorTemplates=%MCR.URIResolver.xslIncludes.xeditorTemplates%,solr-xeditor-templates.xsl -MCR.URIResolver.xslIncludes.xeditorTemplates-3=%MCR.URIResolver.xslIncludes.xeditorTemplates-3%,solr/xeditor/solr-xeditor-templates-3.xsl +MCR.URIResolver.xslIncludes.xeditorTemplates-3=%MCR.URIResolver.xslIncludes.xeditorTemplates-3%,solr/xeditor/solr-xeditor-templates.xsl # MCR.Module-solr.Classification.Core=classification diff --git a/mycore-solr/src/main/resources/xsl/functions/solr.xsl b/mycore-solr/src/main/resources/xslt/functions/solr.xsl similarity index 100% rename from mycore-solr/src/main/resources/xsl/functions/solr.xsl rename to mycore-solr/src/main/resources/xslt/functions/solr.xsl diff --git a/mycore-solr/src/main/resources/xsl/solr/indexing/mycoreobject-dynamicfields-3.xsl b/mycore-solr/src/main/resources/xslt/solr/indexing/mycoreobject-dynamicfields.xsl similarity index 98% rename from mycore-solr/src/main/resources/xsl/solr/indexing/mycoreobject-dynamicfields-3.xsl rename to mycore-solr/src/main/resources/xslt/solr/indexing/mycoreobject-dynamicfields.xsl index bebd18e140..234cae7d45 100644 --- a/mycore-solr/src/main/resources/xsl/solr/indexing/mycoreobject-dynamicfields-3.xsl +++ b/mycore-solr/src/main/resources/xslt/solr/indexing/mycoreobject-dynamicfields.xsl @@ -5,9 +5,9 @@ xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:mcrsolr="http://www.mycore.de/xslt/solr"> - + - + diff --git a/mycore-solr/src/main/resources/xsl/solr/indexing/mycoreobject-solrdocument-3.xsl b/mycore-solr/src/main/resources/xslt/solr/indexing/mycoreobject-solrdocument.xsl similarity index 100% rename from mycore-solr/src/main/resources/xsl/solr/indexing/mycoreobject-solrdocument-3.xsl rename to mycore-solr/src/main/resources/xslt/solr/indexing/mycoreobject-solrdocument.xsl diff --git a/mycore-solr/src/main/resources/xsl/solr/indexing/solr-basetemplate-3.xsl b/mycore-solr/src/main/resources/xslt/solr/indexing/solr-basetemplate.xsl similarity index 99% rename from mycore-solr/src/main/resources/xsl/solr/indexing/solr-basetemplate-3.xsl rename to mycore-solr/src/main/resources/xslt/solr/indexing/solr-basetemplate.xsl index da525e6a57..535453b82b 100644 --- a/mycore-solr/src/main/resources/xsl/solr/indexing/solr-basetemplate-3.xsl +++ b/mycore-solr/src/main/resources/xslt/solr/indexing/solr-basetemplate.xsl @@ -6,7 +6,7 @@ xmlns:fn="http://www.w3.org/2005/xpath-functions"> - + diff --git a/mycore-solr/src/main/resources/xsl/solr/response/response-addDerivates-3.xsl b/mycore-solr/src/main/resources/xslt/solr/response/response-addDerivates.xsl similarity index 100% rename from mycore-solr/src/main/resources/xsl/solr/response/response-addDerivates-3.xsl rename to mycore-solr/src/main/resources/xslt/solr/response/response-addDerivates.xsl diff --git a/mycore-solr/src/main/resources/xsl/solr/response/response-addDocId-3.xsl b/mycore-solr/src/main/resources/xslt/solr/response/response-addDocId.xsl similarity index 100% rename from mycore-solr/src/main/resources/xsl/solr/response/response-addDocId-3.xsl rename to mycore-solr/src/main/resources/xslt/solr/response/response-addDocId.xsl diff --git a/mycore-solr/src/main/resources/xsl/solr/response/response-browse-3.xsl b/mycore-solr/src/main/resources/xslt/solr/response/response-browse.xsl similarity index 97% rename from mycore-solr/src/main/resources/xsl/solr/response/response-browse-3.xsl rename to mycore-solr/src/main/resources/xslt/solr/response/response-browse.xsl index d7bdae9e79..20965e769a 100644 --- a/mycore-solr/src/main/resources/xsl/solr/response/response-browse-3.xsl +++ b/mycore-solr/src/main/resources/xslt/solr/response/response-browse.xsl @@ -6,8 +6,8 @@ xmlns:mcri18n="http://www.mycore.de/xslt/i18n" exclude-result-prefixes="xlink mcri18n xsl"> &html-output; - - + + diff --git a/mycore-solr/src/main/resources/xsl/solr/response/response-join-results-3.xsl b/mycore-solr/src/main/resources/xslt/solr/response/response-join-results.xsl similarity index 100% rename from mycore-solr/src/main/resources/xsl/solr/response/response-join-results-3.xsl rename to mycore-solr/src/main/resources/xslt/solr/response/response-join-results.xsl diff --git a/mycore-solr/src/main/resources/xsl/solr/response/response-utils-3.xsl b/mycore-solr/src/main/resources/xslt/solr/response/response-utils.xsl similarity index 100% rename from mycore-solr/src/main/resources/xsl/solr/response/response-utils-3.xsl rename to mycore-solr/src/main/resources/xslt/solr/response/response-utils.xsl diff --git a/mycore-solr/src/main/resources/xsl/solr/response/response-3.xsl b/mycore-solr/src/main/resources/xslt/solr/response/response.xsl similarity index 98% rename from mycore-solr/src/main/resources/xsl/solr/response/response-3.xsl rename to mycore-solr/src/main/resources/xslt/solr/response/response.xsl index d89a62e0be..7bf1a0a37e 100644 --- a/mycore-solr/src/main/resources/xsl/solr/response/response-3.xsl +++ b/mycore-solr/src/main/resources/xslt/solr/response/response.xsl @@ -6,8 +6,8 @@ xmlns:mcri18n="http://www.mycore.de/xslt/i18n" exclude-result-prefixes="mcri18n"> &html-output; - - + + diff --git a/mycore-solr/src/main/resources/xsl/solr/xeditor/solr-xeditor-templates-3.xsl b/mycore-solr/src/main/resources/xslt/solr/xeditor/solr-xeditor-templates.xsl similarity index 100% rename from mycore-solr/src/main/resources/xsl/solr/xeditor/solr-xeditor-templates-3.xsl rename to mycore-solr/src/main/resources/xslt/solr/xeditor/solr-xeditor-templates.xsl diff --git a/mycore-user2/src/main/resources/xsl/classificationBrowserData-roleSubselect-3.xsl b/mycore-user2/src/main/resources/xslt/classificationBrowserData-roleSubselect.xsl similarity index 100% rename from mycore-user2/src/main/resources/xsl/classificationBrowserData-roleSubselect-3.xsl rename to mycore-user2/src/main/resources/xslt/classificationBrowserData-roleSubselect.xsl diff --git a/mycore-user2/src/main/resources/xsl/login-3.xsl b/mycore-user2/src/main/resources/xslt/login.xsl similarity index 99% rename from mycore-user2/src/main/resources/xsl/login-3.xsl rename to mycore-user2/src/main/resources/xslt/login.xsl index cf099b7da4..ee0932bc76 100644 --- a/mycore-user2/src/main/resources/xsl/login-3.xsl +++ b/mycore-user2/src/main/resources/xslt/login.xsl @@ -34,7 +34,7 @@ > &html-output; - + diff --git a/mycore-user2/src/main/resources/xsl/roles-3.xsl b/mycore-user2/src/main/resources/xslt/roles.xsl similarity index 93% rename from mycore-user2/src/main/resources/xsl/roles-3.xsl rename to mycore-user2/src/main/resources/xslt/roles.xsl index c3ed54ba25..9b9d83dfe8 100644 --- a/mycore-user2/src/main/resources/xsl/roles-3.xsl +++ b/mycore-user2/src/main/resources/xslt/roles.xsl @@ -6,8 +6,8 @@ xmlns:mcrurl="http://www.mycore.de/xslt/url" xmlns:mcri18n="http://www.mycore.de/xslt/i18n" exclude-result-prefixes="xsl mcrurl mcri18n"> - - + + diff --git a/mycore-user2/src/main/resources/xsl/user-3.xsl b/mycore-user2/src/main/resources/xslt/user.xsl similarity index 99% rename from mycore-user2/src/main/resources/xsl/user-3.xsl rename to mycore-user2/src/main/resources/xslt/user.xsl index 17990fa56a..c4e9b7666a 100644 --- a/mycore-user2/src/main/resources/xsl/user-3.xsl +++ b/mycore-user2/src/main/resources/xslt/user.xsl @@ -8,7 +8,7 @@ exclude-result-prefixes="xsl mcri18n mcracl" > - + diff --git a/mycore-user2/src/main/resources/xsl/users-subselect-3.xsl b/mycore-user2/src/main/resources/xslt/users-subselect.xsl similarity index 97% rename from mycore-user2/src/main/resources/xsl/users-subselect-3.xsl rename to mycore-user2/src/main/resources/xslt/users-subselect.xsl index 147851e268..7a1a985088 100644 --- a/mycore-user2/src/main/resources/xsl/users-subselect-3.xsl +++ b/mycore-user2/src/main/resources/xslt/users-subselect.xsl @@ -9,7 +9,7 @@ exclude-result-prefixes="xsl mcri18n mcrurl" > - + diff --git a/mycore-user2/src/main/resources/xsl/users-3.xsl b/mycore-user2/src/main/resources/xslt/users.xsl similarity index 99% rename from mycore-user2/src/main/resources/xsl/users-3.xsl rename to mycore-user2/src/main/resources/xslt/users.xsl index 587375cec3..a61d25ee4e 100644 --- a/mycore-user2/src/main/resources/xsl/users-3.xsl +++ b/mycore-user2/src/main/resources/xslt/users.xsl @@ -9,7 +9,7 @@ exclude-result-prefixes="xsl mcri18n mcrurl" > - + diff --git a/mycore-viewer/src/main/resources/components/viewer/config/mycore.properties b/mycore-viewer/src/main/resources/components/viewer/config/mycore.properties index b0ce8827d0..02a06521ab 100644 --- a/mycore-viewer/src/main/resources/components/viewer/config/mycore.properties +++ b/mycore-viewer/src/main/resources/components/viewer/config/mycore.properties @@ -4,7 +4,7 @@ MCR.Viewer.bootstrapURL=//stackpath.bootstrapcdn.com/bootstrap/4.3.1/ MCR.Viewer.FontaweSomeURL=https://use.fontawesome.com/releases/v5.8.1/css/all.css MCR.URIResolver.xslIncludes.components=%MCR.URIResolver.xslIncludes.components%,altoChanges.xsl -MCR.URIResolver.xslIncludes.components-3=%MCR.URIResolver.xslIncludes.components-3%,altoChanges-3.xsl +MCR.URIResolver.xslIncludes.components-3=%MCR.URIResolver.xslIncludes.components-3%,altoChanges.xsl MCR.Viewer.AltoChangeSetStore.Class=org.mycore.viewer.alto.service.impl.MCRJPAAltoChangeSetStore MCR.Viewer.AltoChangeApplier.Class=org.mycore.viewer.alto.service.impl.MCRDefaultAltoChangeApplier diff --git a/mycore-viewer/src/main/resources/xsl/IViewConfig-3.xsl b/mycore-viewer/src/main/resources/xslt/IViewConfig.xsl similarity index 100% rename from mycore-viewer/src/main/resources/xsl/IViewConfig-3.xsl rename to mycore-viewer/src/main/resources/xslt/IViewConfig.xsl diff --git a/mycore-viewer/src/main/resources/xsl/altoChanges-3.xsl b/mycore-viewer/src/main/resources/xslt/altoChanges.xsl similarity index 100% rename from mycore-viewer/src/main/resources/xsl/altoChanges-3.xsl rename to mycore-viewer/src/main/resources/xslt/altoChanges.xsl diff --git a/mycore-wcms2/src/main/resources/xsl/wcms2-3.xsl b/mycore-wcms2/src/main/resources/xslt/wcms2.xsl similarity index 100% rename from mycore-wcms2/src/main/resources/xsl/wcms2-3.xsl rename to mycore-wcms2/src/main/resources/xslt/wcms2.xsl diff --git a/mycore-webtools/src/main/resources/components/webtools/config/mycore.properties b/mycore-webtools/src/main/resources/components/webtools/config/mycore.properties index 8154703ea9..d08b0529b4 100644 --- a/mycore-webtools/src/main/resources/components/webtools/config/mycore.properties +++ b/mycore-webtools/src/main/resources/components/webtools/config/mycore.properties @@ -5,7 +5,7 @@ MCR.Jersey.Resource.Packages=%MCR.Jersey.Resource.Packages%,org.mycore.webtools.session,org.mycore.webtools.upload MCR.URIResolver.xslIncludes.components=%MCR.URIResolver.xslIncludes.components%,sessionListing.xsl,processingGUI.xsl,msie-warning.xsl -MCR.URIResolver.xslIncludes.components-3=%MCR.URIResolver.xslIncludes.components-3%,sessionListing-3.xsl,processingGUI-3.xsl,msie-warning-3.xsl +MCR.URIResolver.xslIncludes.components-3=%MCR.URIResolver.xslIncludes.components-3%,sessionListing.xsl,processingGUI.xsl,msie-warning.xsl # filetypes that will be ignored for mainfile, if there are others MCR.Upload.NotPreferredFiletypeForMainfile=.xml diff --git a/mycore-webtools/src/main/resources/xsl/msie-warning-3.xsl b/mycore-webtools/src/main/resources/xslt/msie-warning.xsl similarity index 97% rename from mycore-webtools/src/main/resources/xsl/msie-warning-3.xsl rename to mycore-webtools/src/main/resources/xslt/msie-warning.xsl index c94ed565da..c9adb4839f 100644 --- a/mycore-webtools/src/main/resources/xsl/msie-warning-3.xsl +++ b/mycore-webtools/src/main/resources/xslt/msie-warning.xsl @@ -2,6 +2,8 @@ + + diff --git a/mycore-webtools/src/main/resources/xsl/processingGUI-3.xsl b/mycore-webtools/src/main/resources/xslt/processingGUI.xsl similarity index 100% rename from mycore-webtools/src/main/resources/xsl/processingGUI-3.xsl rename to mycore-webtools/src/main/resources/xslt/processingGUI.xsl diff --git a/mycore-webtools/src/main/resources/xsl/sessionListing-3.xsl b/mycore-webtools/src/main/resources/xslt/sessionListing.xsl similarity index 100% rename from mycore-webtools/src/main/resources/xsl/sessionListing-3.xsl rename to mycore-webtools/src/main/resources/xslt/sessionListing.xsl diff --git a/mycore-xeditor/src/main/java/org/mycore/frontend/xeditor/MCRPostProcessorXSL.java b/mycore-xeditor/src/main/java/org/mycore/frontend/xeditor/MCRPostProcessorXSL.java index 0f76d6e394..204a1c7d55 100644 --- a/mycore-xeditor/src/main/java/org/mycore/frontend/xeditor/MCRPostProcessorXSL.java +++ b/mycore-xeditor/src/main/java/org/mycore/frontend/xeditor/MCRPostProcessorXSL.java @@ -79,8 +79,10 @@ public Document process(Document xml) throws IOException, JDOMException { .getClass("MCR.LayoutService.TransformerFactoryClass").orElseThrow(); } + final String xslFolder = MCRConfiguration2.getStringOrThrow("MCR.Layout.Transformer.Factory.XSLFolder"); MCRContent source = new MCRJDOMContent(xml); - MCRContent transformed = MCRXSL2XMLTransformer.getInstance(factoryClass, "xsl/" + stylesheet).transform(source); + MCRContent transformed = MCRXSL2XMLTransformer.getInstance(factoryClass, xslFolder + "/" + stylesheet) + .transform(source); MCRContent normalized = new MCRNormalizeUnicodeTransformer().transform(transformed); return normalized.asXML(); } diff --git a/mycore-xeditor/src/main/resources/xsl/xeditor-templates-3.xsl b/mycore-xeditor/src/main/resources/xslt/xeditor-templates.xsl similarity index 100% rename from mycore-xeditor/src/main/resources/xsl/xeditor-templates-3.xsl rename to mycore-xeditor/src/main/resources/xslt/xeditor-templates.xsl From 8647253eb73937bab260b879098edd0394149219 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Wed, 20 Sep 2023 14:12:12 +0200 Subject: [PATCH 02/21] MCR-2966 xslt folder add URI resolver for XEditor XSLs --- .../java/org/mycore/common/xml/MCRURIResolver.java | 14 +++++++++++++- .../authorization/change-current-user.xed | 4 ++-- .../resources/authorization/change-password.xed | 4 ++-- .../resources/authorization/change-read-user.xed | 4 ++-- .../resources/authorization/change-user.xed | 4 ++-- .../resources/authorization/new-read-user.xed | 4 ++-- .../META-INF/resources/authorization/new-user.xed | 4 ++-- 7 files changed, 25 insertions(+), 13 deletions(-) diff --git a/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java b/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java index 354cb51cbf..8c47931d19 100644 --- a/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java +++ b/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java @@ -233,6 +233,7 @@ private HashMap getResolverMapping() { supportedSchemes.put("catchEx", new MCRExceptionAsXMLResolver()); supportedSchemes.put("notnull", new MCRNotNullResolver()); supportedSchemes.put("xslStyle", new MCRXslStyleResolver()); + supportedSchemes.put("xslStyleXEditor", new MCRXslStyleXEDitorResolver()); supportedSchemes.put("xslTransform", new MCRLayoutTransformerResolver()); supportedSchemes.put("xslInclude", new MCRXslIncludeResolver()); supportedSchemes.put("xslImport", new MCRXslImportResolver()); @@ -1220,7 +1221,7 @@ public Source resolve(String href, String base) throws TransformerException { } } - private MCRXSLTransformer getTransformer(String... stylesheet) { + protected MCRXSLTransformer getTransformer(String... stylesheet) { final String xslFolder = MCRConfiguration2.getStringOrThrow("MCR.Layout.Transformer.Factory.XSLFolder"); String[] stylesheets = new String[stylesheet.length]; for (int i = 0; i < stylesheets.length; i++) { @@ -1230,6 +1231,17 @@ private MCRXSLTransformer getTransformer(String... stylesheet) { } } + private static class MCRXslStyleXEDitorResolver extends MCRXslStyleResolver { + @Override + protected MCRXSLTransformer getTransformer(String... stylesheet) { + String[] stylesheets = new String[stylesheet.length]; + for (int i = 0; i < stylesheets.length; i++) { + stylesheets[i] = "xsl/" + stylesheet[i] + ".xsl"; + } + return MCRXSLTransformer.getInstance(stylesheets); + } + } + /** * Transform result of other resolver with stylesheet. Usage: xslTransform:>: diff --git a/mycore-user2/src/main/resources/META-INF/resources/authorization/change-current-user.xed b/mycore-user2/src/main/resources/META-INF/resources/authorization/change-current-user.xed index 4e0bf81abf..f14ca3b755 100644 --- a/mycore-user2/src/main/resources/META-INF/resources/authorization/change-current-user.xed +++ b/mycore-user2/src/main/resources/META-INF/resources/authorization/change-current-user.xed @@ -3,8 +3,8 @@
- - + + diff --git a/mycore-user2/src/main/resources/META-INF/resources/authorization/change-password.xed b/mycore-user2/src/main/resources/META-INF/resources/authorization/change-password.xed index b10fdb7e6b..0e9d2d2f05 100644 --- a/mycore-user2/src/main/resources/META-INF/resources/authorization/change-password.xed +++ b/mycore-user2/src/main/resources/META-INF/resources/authorization/change-password.xed @@ -3,8 +3,8 @@
- - + + diff --git a/mycore-user2/src/main/resources/META-INF/resources/authorization/change-read-user.xed b/mycore-user2/src/main/resources/META-INF/resources/authorization/change-read-user.xed index e0a604dc08..f5c46b3edc 100644 --- a/mycore-user2/src/main/resources/META-INF/resources/authorization/change-read-user.xed +++ b/mycore-user2/src/main/resources/META-INF/resources/authorization/change-read-user.xed @@ -3,8 +3,8 @@
- - + + diff --git a/mycore-user2/src/main/resources/META-INF/resources/authorization/change-user.xed b/mycore-user2/src/main/resources/META-INF/resources/authorization/change-user.xed index 53f13614a2..62ee1af4e2 100644 --- a/mycore-user2/src/main/resources/META-INF/resources/authorization/change-user.xed +++ b/mycore-user2/src/main/resources/META-INF/resources/authorization/change-user.xed @@ -3,8 +3,8 @@
- - + + diff --git a/mycore-user2/src/main/resources/META-INF/resources/authorization/new-read-user.xed b/mycore-user2/src/main/resources/META-INF/resources/authorization/new-read-user.xed index a5e86afb02..e9999e8dd5 100644 --- a/mycore-user2/src/main/resources/META-INF/resources/authorization/new-read-user.xed +++ b/mycore-user2/src/main/resources/META-INF/resources/authorization/new-read-user.xed @@ -3,8 +3,8 @@
- - + + diff --git a/mycore-user2/src/main/resources/META-INF/resources/authorization/new-user.xed b/mycore-user2/src/main/resources/META-INF/resources/authorization/new-user.xed index dddedaee21..77c8488b0b 100644 --- a/mycore-user2/src/main/resources/META-INF/resources/authorization/new-user.xed +++ b/mycore-user2/src/main/resources/META-INF/resources/authorization/new-user.xed @@ -3,8 +3,8 @@
- - + + From 847a36acf52f3828bf3e07eed372f9e36d2d8e2c Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Wed, 20 Sep 2023 14:13:03 +0200 Subject: [PATCH 03/21] MCR-2966 xslt folder add xsl to xslt folder --- .../src/main/resources/xslt/realms2items.xsl | 24 ++++ .../src/main/resources/xslt/items2options.xsl | 132 ++++++++++++++++++ 2 files changed, 156 insertions(+) create mode 100644 mycore-user2/src/main/resources/xslt/realms2items.xsl create mode 100644 mycore-xeditor/src/main/resources/xslt/items2options.xsl diff --git a/mycore-user2/src/main/resources/xslt/realms2items.xsl b/mycore-user2/src/main/resources/xslt/realms2items.xsl new file mode 100644 index 0000000000..38c8f1330b --- /dev/null +++ b/mycore-user2/src/main/resources/xslt/realms2items.xsl @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mycore-xeditor/src/main/resources/xslt/items2options.xsl b/mycore-xeditor/src/main/resources/xslt/items2options.xsl new file mode 100644 index 0000000000..fcc5e93226 --- /dev/null +++ b/mycore-xeditor/src/main/resources/xslt/items2options.xsl @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 216fbad912e864ffbe1caffc8032cf6f18bd455b Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Thu, 21 Sep 2023 14:45:28 +0200 Subject: [PATCH 04/21] MCR-2966 xslt folder default to xsl3, remove -3 suffixes from configuration --- .../main/resources/config/mycore.properties | 5 +-- .../src/main/resources/xslt/MyCoReWebPage.xsl | 2 +- .../iview2/services/MCRIview2URIResolver.java | 4 ++ .../iview2/config/mycore.properties | 2 - .../src/main/resources/xslt/iview2-solr.xsl | 18 +++++++++ .../components/mods/config/mycore.properties | 3 +- .../xslt/solr/indexing/mods-dynamicfields.xsl | 2 +- .../xslt/solr/indexing/mods-solr.xsl | 2 +- .../components/solr/config/mycore.properties | 39 ++++++------------- .../indexing/mycoreobject-dynamicfields.xsl | 2 +- .../indexing/mycoreobject-solrdocument.xsl | 2 +- .../xslt/solr/indexing/solr-basetemplate.xsl | 2 +- .../xslt/solr/response/response-browse.xsl | 2 +- .../resources/xslt/solr/response/response.xsl | 2 +- 14 files changed, 44 insertions(+), 43 deletions(-) create mode 100644 mycore-iview2/src/main/resources/xslt/iview2-solr.xsl diff --git a/mycore-base/src/main/resources/config/mycore.properties b/mycore-base/src/main/resources/config/mycore.properties index 383f82dab3..0ae2973809 100644 --- a/mycore-base/src/main/resources/config/mycore.properties +++ b/mycore-base/src/main/resources/config/mycore.properties @@ -91,8 +91,8 @@ MCR.BatchEditor.BaseLevel.object=/mycoreobject # Define the LayoutFactory class MCR.Layout.Transformer.Factory=org.mycore.common.xml.MCRLayoutTransformerFactory -# Default folder for XSL files, switch to XSLT for XSLT-3 applications -MCR.Layout.Transformer.Factory.XSLFolder=xsl +# Default folder for XSL files, switch to xsl for XSL1 applications +MCR.Layout.Transformer.Factory.XSLFolder=xslt # The format of the session ID # MCR.Session.Param=;jsessionid= @@ -473,7 +473,6 @@ MCR.Startup.Class=org.mycore.backend.jpa.MCRJPABootstrapper,org.mycore.datamodel MCR.Website.ReadAccessVerification=true MCR.URIResolver.xslIncludes.MyCoReWebPage=classificationBrowser.xsl -MCR.URIResolver.xslIncludes.MyCoReWebPage-3=classificationBrowser.xsl MCR.URIResolver.xslIncludes.functions=functions/acl.xsl,functions/classification.xsl,functions/derivate.xsl,functions/i18n.xsl,functions/mcrversion.xsl,functions/property.xsl,functions/stringutils.xsl,functions/url.xsl,functions/layoututils.xsl ############################################################################## diff --git a/mycore-base/src/main/resources/xslt/MyCoReWebPage.xsl b/mycore-base/src/main/resources/xslt/MyCoReWebPage.xsl index 2771766370..aad5ad7114 100644 --- a/mycore-base/src/main/resources/xslt/MyCoReWebPage.xsl +++ b/mycore-base/src/main/resources/xslt/MyCoReWebPage.xsl @@ -13,7 +13,7 @@ &html-output; - + diff --git a/mycore-iview2/src/main/java/org/mycore/iview2/services/MCRIview2URIResolver.java b/mycore-iview2/src/main/java/org/mycore/iview2/services/MCRIview2URIResolver.java index 7b6ac67277..e67024e359 100644 --- a/mycore-iview2/src/main/java/org/mycore/iview2/services/MCRIview2URIResolver.java +++ b/mycore-iview2/src/main/java/org/mycore/iview2/services/MCRIview2URIResolver.java @@ -21,6 +21,10 @@ public Source resolve(String href, String base) throws TransformerException { boolean completelyTiled = MCRIView2Tools.isCompletelyTiled(params[2]); return new JDOMSource(new Element(String.valueOf(completelyTiled))); } + case "isFileSupported" -> { + final boolean supported = MCRIView2Tools.isFileSupported(params[2]); + return new JDOMSource(new Element(String.valueOf(supported))); + } default -> throw new TransformerException("Invalid href: " + href); } } diff --git a/mycore-iview2/src/main/resources/components/iview2/config/mycore.properties b/mycore-iview2/src/main/resources/components/iview2/config/mycore.properties index f3a883d67b..f3ceb61f56 100644 --- a/mycore-iview2/src/main/resources/components/iview2/config/mycore.properties +++ b/mycore-iview2/src/main/resources/components/iview2/config/mycore.properties @@ -20,9 +20,7 @@ MCR.Module-iview2.MaxResetCount=3 MCR.CLI.Classes.Internal=%MCR.CLI.Classes.Internal%,org.mycore.iview2.frontend.MCRIView2Commands MCR.URIResolver.ModuleResolver.iview2=org.mycore.iview2.services.MCRIview2URIResolver MCR.URIResolver.xslIncludes.components=%MCR.URIResolver.xslIncludes.components%,mcr-module-startIview2.xsl -MCR.URIResolver.xslIncludes.components-3=%MCR.URIResolver.xslIncludes.components-3%,mcr-module-startIview2.xsl MCR.URIResolver.xslIncludes.solrResponse=%MCR.URIResolver.xslIncludes.solrResponse%,iview2-solrresponse.xsl -MCR.URIResolver.xslIncludes.solrResponse-3=%MCR.URIResolver.xslIncludes.solrResponse-3%,iview2-solrresponse.xsl MCR.URIResolver.xslIncludes.functions=%MCR.URIResolver.xslIncludes.functions%,functions/iview2.xsl MCR.Hibernate.Mappings=%MCR.Hibernate.Mappings%,org.mycore.iview2.services.MCRTileJob diff --git a/mycore-iview2/src/main/resources/xslt/iview2-solr.xsl b/mycore-iview2/src/main/resources/xslt/iview2-solr.xsl new file mode 100644 index 0000000000..eaea7afcda --- /dev/null +++ b/mycore-iview2/src/main/resources/xslt/iview2-solr.xsl @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/mycore-mods/src/main/resources/components/mods/config/mycore.properties b/mycore-mods/src/main/resources/components/mods/config/mycore.properties index 255532af2d..f606a217ff 100644 --- a/mycore-mods/src/main/resources/components/mods/config/mycore.properties +++ b/mycore-mods/src/main/resources/components/mods/config/mycore.properties @@ -81,8 +81,7 @@ MCR.URIResolver.xslIncludes.objectTypes=%MCR.URIResolver.xslIncludes.objectTypes MCR.URIResolver.xslIncludes.functions=%MCR.URIResolver.xslIncludes.functions%,functions/mods.xsl MCR.URIResolver.xslIncludes.datacite=mycoreobject-datacite.xsl MCR.URIResolver.xslIncludes.schemaorg= -MCR.URIResolver.xslImports.solr-document=%MCR.URIResolver.xslImports.solr-document%,mods-solr.xsl -MCR.URIResolver.xslImports.solr-document-3=%MCR.URIResolver.xslImports.solr-document-3%,solr/indexing/mods-solr.xsl,solr/indexing/mods-dynamicfields.xsl +MCR.URIResolver.xslImports.solr-document=%MCR.URIResolver.xslImports.solr-document%,solr/indexing/mods-solr.xsl,solr/indexing/mods-dynamicfields.xsl MCR.URIResolver.redirect.editor-mods-external=webapp:editor/editor-mods-external.xml # URIResolver to sort MODS diff --git a/mycore-mods/src/main/resources/xslt/solr/indexing/mods-dynamicfields.xsl b/mycore-mods/src/main/resources/xslt/solr/indexing/mods-dynamicfields.xsl index 5fe0dc2b60..54a713d856 100644 --- a/mycore-mods/src/main/resources/xslt/solr/indexing/mods-dynamicfields.xsl +++ b/mycore-mods/src/main/resources/xslt/solr/indexing/mods-dynamicfields.xsl @@ -6,7 +6,7 @@ xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:mcrmods="http://www.mycore.de/xslt/mods"> - + diff --git a/mycore-mods/src/main/resources/xslt/solr/indexing/mods-solr.xsl b/mycore-mods/src/main/resources/xslt/solr/indexing/mods-solr.xsl index 396426fc96..72cddda0d6 100644 --- a/mycore-mods/src/main/resources/xslt/solr/indexing/mods-solr.xsl +++ b/mycore-mods/src/main/resources/xslt/solr/indexing/mods-solr.xsl @@ -8,7 +8,7 @@ exclude-result-prefixes="xlink mods fn mcrmods"> - + diff --git a/mycore-solr/src/main/resources/components/solr/config/mycore.properties b/mycore-solr/src/main/resources/components/solr/config/mycore.properties index c947bbd3e3..bf97249b04 100644 --- a/mycore-solr/src/main/resources/components/solr/config/mycore.properties +++ b/mycore-solr/src/main/resources/components/solr/config/mycore.properties @@ -8,8 +8,7 @@ MCR.EventHandler.MCRPath.100.Class=org.mycore.solr.index.MCRSolrIndexEventHandle MCR.URIResolver.ModuleResolver.solr=org.mycore.solr.common.xml.MCRSolrQueryResolver -MCR.URIResolver.xslImports.solr-document=solr-basetemplate.xsl -MCR.URIResolver.xslImports.solr-document-3=solr/indexing/solr-basetemplate.xsl +MCR.URIResolver.xslImports.solr-document=solr/indexing/solr-basetemplate.xsl MCR.Module-classbrowser.QueryAdapter=org.mycore.solr.search.MCRSolrQueryAdapter @@ -34,7 +33,7 @@ MCR.Solr.ConcurrentUpdateSolrClient.QueueSize=100 MCR.Solr.ConcurrentUpdateSolrClient.ThreadCount=%MCR.Solr.Indexer.ThreadCount% MCR.Solr.SolrInputDocument.Factory=org.mycore.solr.index.document.MCRSolrTransformerInputDocumentFactory -MCR.Solr.SolrInputDocument.Transformer=mycoreobject-solrdocument-3 +MCR.Solr.SolrInputDocument.Transformer=mycoreobject-solrdocument MCR.Solr.SolrInputDocument.Path.Factory=org.mycore.solr.index.file.MCRSolrPathDocumentFactory @@ -45,35 +44,21 @@ MCR.Solr.IndexHandler.Factory=org.mycore.solr.index.handlers.MCRSolrLazyInputDoc # property only contains the the stylesheet declaration) MCR.URIResolver.xslIncludes.solr-export= -MCR.URIResolver.xslIncludes.components=%MCR.URIResolver.xslIncludes.components%,solr-layout-utils.xsl +# activate for XSL1: MCR.URIResolver.xslIncludes.components=%MCR.URIResolver.xslIncludes.components%,solr-layout-utils.xsl # we do not provide a xslt 3.0 for the solr-layout-utils.xsl in components-3 MCR.ContentTransformer.response.Class=org.mycore.common.content.transformer.MCRXSLTransformer -MCR.ContentTransformer.response.TransformerFactoryClass=org.apache.xalan.processor.TransformerFactoryImpl -MCR.ContentTransformer.response.Stylesheet=%MCR.ContentTransformer.response-prepared.Stylesheet%,xsl/response.xsl +MCR.ContentTransformer.response.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl +MCR.ContentTransformer.response.Stylesheet=%MCR.ContentTransformer.response-prepared.Stylesheet%,xslt/solr/response/response.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.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl +MCR.ContentTransformer.mycoreobject-solrdocument.Stylesheet=xslt/solr/indexing/mycoreobject-solrdocument.xsl MCR.ContentTransformer.mycoreobject-solrdocument.Context=org.mycore.solr.index.document.jaxb -MCR.ContentTransformer.mycoreobject-solrdocument-3.Class=org.mycore.common.content.transformer.MCRXSL2JAXBTransformer -MCR.ContentTransformer.mycoreobject-solrdocument-3.Stylesheet=xslt/solr/indexing/mycoreobject-solrdocument.xsl -MCR.ContentTransformer.mycoreobject-solrdocument-3.Context=org.mycore.solr.index.document.jaxb -MCR.ContentTransformer.mycoreobject-solrdocument-3.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl - -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-3.Class=org.mycore.common.content.transformer.MCRXSLTransformer -MCR.ContentTransformer.response-prepared-3.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl -MCR.ContentTransformer.response-prepared-3.Stylesheet=xslt/solr/response/response-join-results.xsl,xslt/solr/response/response-addDocId.xsl,xslt/solr/response/response-addDerivates.xsl - 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.ContentTransformer.response-prepared.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl +MCR.ContentTransformer.response-prepared.Stylesheet=xslt/solr/response/response-join-results.xsl,xslt/solr/response/response-addDocId.xsl,xslt/solr/response/response-addDerivates.xsl MCR.Solr.FileIndexStrategy=org.mycore.solr.index.strategy.MCRSolrMimeTypeStrategy MCR.Solr.MimeTypeStrategy.Pattern=image/.* @@ -88,10 +73,8 @@ MCR.Solr.TikaFields=stream_size,stream_name,stream_source_info,stream_content_ty MCR.Solr.JoinQueryFields=%MCR.Solr.ContentBaseFields%,%MCR.Solr.AVExtenderFields%,%MCR.Solr.TikaFields% MCR.CLI.Classes.Internal=%MCR.CLI.Classes.Internal%,org.mycore.solr.commands.MCRSolrCommands -MCR.URIResolver.xslImports.solr-document=%MCR.URIResolver.xslImports.solr-document%,mycoreobject-dynamicfields.xsl -MCR.URIResolver.xslImports.solr-document-3=%MCR.URIResolver.xslImports.solr-document-3%,solr/indexing/mycoreobject-dynamicfields.xsl -MCR.URIResolver.xslIncludes.xeditorTemplates=%MCR.URIResolver.xslIncludes.xeditorTemplates%,solr-xeditor-templates.xsl -MCR.URIResolver.xslIncludes.xeditorTemplates-3=%MCR.URIResolver.xslIncludes.xeditorTemplates-3%,solr/xeditor/solr-xeditor-templates.xsl +MCR.URIResolver.xslImports.solr-document=%MCR.URIResolver.xslImports.solr-document%,solr/indexing/mycoreobject-dynamicfields.xsl +MCR.URIResolver.xslIncludes.xeditorTemplates=%MCR.URIResolver.xslIncludes.xeditorTemplates%,solr/xeditor/solr-xeditor-templates.xsl # MCR.Module-solr.Classification.Core=classification diff --git a/mycore-solr/src/main/resources/xslt/solr/indexing/mycoreobject-dynamicfields.xsl b/mycore-solr/src/main/resources/xslt/solr/indexing/mycoreobject-dynamicfields.xsl index 234cae7d45..374145da18 100644 --- a/mycore-solr/src/main/resources/xslt/solr/indexing/mycoreobject-dynamicfields.xsl +++ b/mycore-solr/src/main/resources/xslt/solr/indexing/mycoreobject-dynamicfields.xsl @@ -5,7 +5,7 @@ xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:mcrsolr="http://www.mycore.de/xslt/solr"> - + diff --git a/mycore-solr/src/main/resources/xslt/solr/indexing/mycoreobject-solrdocument.xsl b/mycore-solr/src/main/resources/xslt/solr/indexing/mycoreobject-solrdocument.xsl index 790bcd4cfc..d3c2ddb5e6 100644 --- a/mycore-solr/src/main/resources/xslt/solr/indexing/mycoreobject-solrdocument.xsl +++ b/mycore-solr/src/main/resources/xslt/solr/indexing/mycoreobject-solrdocument.xsl @@ -2,7 +2,7 @@ - + diff --git a/mycore-solr/src/main/resources/xslt/solr/indexing/solr-basetemplate.xsl b/mycore-solr/src/main/resources/xslt/solr/indexing/solr-basetemplate.xsl index 535453b82b..1a6097215a 100644 --- a/mycore-solr/src/main/resources/xslt/solr/indexing/solr-basetemplate.xsl +++ b/mycore-solr/src/main/resources/xslt/solr/indexing/solr-basetemplate.xsl @@ -6,7 +6,7 @@ xmlns:fn="http://www.w3.org/2005/xpath-functions"> - + diff --git a/mycore-solr/src/main/resources/xslt/solr/response/response-browse.xsl b/mycore-solr/src/main/resources/xslt/solr/response/response-browse.xsl index 20965e769a..19cebd9602 100644 --- a/mycore-solr/src/main/resources/xslt/solr/response/response-browse.xsl +++ b/mycore-solr/src/main/resources/xslt/solr/response/response-browse.xsl @@ -8,7 +8,7 @@ &html-output; - + diff --git a/mycore-solr/src/main/resources/xslt/solr/response/response.xsl b/mycore-solr/src/main/resources/xslt/solr/response/response.xsl index 7bf1a0a37e..ce03b24bda 100644 --- a/mycore-solr/src/main/resources/xslt/solr/response/response.xsl +++ b/mycore-solr/src/main/resources/xslt/solr/response/response.xsl @@ -8,7 +8,7 @@ &html-output; - + From 4c421636e3cb5c0692986056aaccd56f97985153 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Thu, 21 Sep 2023 15:28:28 +0200 Subject: [PATCH 05/21] MCR-2966 xslt folder fix class name for XEditor URI resolver --- .../src/main/java/org/mycore/common/xml/MCRURIResolver.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java b/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java index 8c47931d19..ee5cc71d80 100644 --- a/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java +++ b/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java @@ -233,7 +233,7 @@ private HashMap getResolverMapping() { supportedSchemes.put("catchEx", new MCRExceptionAsXMLResolver()); supportedSchemes.put("notnull", new MCRNotNullResolver()); supportedSchemes.put("xslStyle", new MCRXslStyleResolver()); - supportedSchemes.put("xslStyleXEditor", new MCRXslStyleXEDitorResolver()); + supportedSchemes.put("xslStyleXEditor", new MCRXslStyleXEditorResolver()); supportedSchemes.put("xslTransform", new MCRLayoutTransformerResolver()); supportedSchemes.put("xslInclude", new MCRXslIncludeResolver()); supportedSchemes.put("xslImport", new MCRXslImportResolver()); @@ -1231,7 +1231,7 @@ protected MCRXSLTransformer getTransformer(String... stylesheet) { } } - private static class MCRXslStyleXEDitorResolver extends MCRXslStyleResolver { + private static class MCRXslStyleXEditorResolver extends MCRXslStyleResolver { @Override protected MCRXSLTransformer getTransformer(String... stylesheet) { String[] stylesheets = new String[stylesheet.length]; From ad1d02e5d33536f23b66e1ff068a5247613aa9dc Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Tue, 26 Sep 2023 09:18:46 +0200 Subject: [PATCH 06/21] MCR-2966 xslt folder use folder from configuration, use full resource statement for xeditor XSL --- .../main/java/org/mycore/common/MCRMailer.java | 3 ++- .../org/mycore/common/xsl/MCRXSLInfoServlet.java | 15 +++++++++------ .../org/mycore/frontend/cli/MCRCommandUtils.java | 6 ++++-- .../components/xeditor/config/mycore.properties | 2 +- mycore-xeditor/src/main/resources/xsl/xeditor.xsl | 2 +- .../src/test/resources/mycore.properties | 3 ++- 6 files changed, 19 insertions(+), 12 deletions(-) diff --git a/mycore-base/src/main/java/org/mycore/common/MCRMailer.java b/mycore-base/src/main/java/org/mycore/common/MCRMailer.java index a9f6bba571..ad3395ab4e 100644 --- a/mycore-base/src/main/java/org/mycore/common/MCRMailer.java +++ b/mycore-base/src/main/java/org/mycore/common/MCRMailer.java @@ -516,7 +516,8 @@ public static Element sendMail(Document input, String stylesheet) throws Excepti private static Document transform(Document input, String stylesheet, Map parameters) throws Exception { MCRJDOMContent source = new MCRJDOMContent(input); - MCRXSL2XMLTransformer transformer = MCRXSL2XMLTransformer.getInstance("xsl/" + stylesheet + ".xsl"); + final String xslFolder = MCRConfiguration2.getStringOrThrow("MCR.Layout.Transformer.Factory.XSLFolder"); + MCRXSL2XMLTransformer transformer = MCRXSL2XMLTransformer.getInstance(xslFolder + "/" + stylesheet + ".xsl"); MCRParameterCollector parameterCollector = MCRParameterCollector.getInstanceFromUserSession(); parameterCollector.setParameters(parameters); MCRContent result = transformer.transform(source, parameterCollector); diff --git a/mycore-base/src/main/java/org/mycore/common/xsl/MCRXSLInfoServlet.java b/mycore-base/src/main/java/org/mycore/common/xsl/MCRXSLInfoServlet.java index 99180a7c3e..1f4072f6e5 100644 --- a/mycore-base/src/main/java/org/mycore/common/xsl/MCRXSLInfoServlet.java +++ b/mycore-base/src/main/java/org/mycore/common/xsl/MCRXSLInfoServlet.java @@ -48,6 +48,7 @@ import org.jdom2.filter.Filters; import org.jdom2.util.IteratorIterable; import org.mycore.common.MCRConstants; +import org.mycore.common.config.MCRConfiguration2; import org.mycore.common.config.MCRConfigurationDir; import org.mycore.common.content.MCRJDOMContent; import org.mycore.common.xml.MCRURIResolver; @@ -57,8 +58,8 @@ /** * Lists all *.xsl stylesheets in the web application located in any - * WEB-INF/lib/*.jar or WEB-INF/classes/xsl/ or in {@link MCRConfigurationDir}, outputs the - * dependencies (import/include) and contained templates. + * WEB-INF/lib/*.jar or WEB-INF/classes/[MCR.Layout.Transformer.Factory.XSLFolder]/ or in {@link MCRConfigurationDir}, + * outputs the dependencies (import/include) and contained templates. * * @author Frank Lützenkirchen */ @@ -69,6 +70,8 @@ public final class MCRXSLInfoServlet extends MCRServlet { private final Map stylesheets = new HashMap<>(); private final Set unknown = new HashSet<>(); + private final String xslFolder = + MCRConfiguration2.getStringOrThrow("MCR.Layout.Transformer.Factory.XSLFolder") + "/"; protected void doGetPost(MCRServletJob job) throws Exception { if ("true".equals(job.getRequest().getParameter("reload"))) { @@ -202,7 +205,7 @@ private void findInJarInputStream(String pathOfJarFile, InputStream in) throws I for (ZipEntry ze = zis.getNextEntry(); ze != null; ze = zis.getNextEntry()) { String name = ze.getName(); - if (name.startsWith("xsl/") && name.endsWith(".xsl")) { + if (name.startsWith(xslFolder) && name.endsWith(".xsl")) { foundStylesheet(name, pathOfJarFile); } zis.closeEntry(); @@ -211,7 +214,7 @@ private void findInJarInputStream(String pathOfJarFile, InputStream in) throws I } private void findXSLinClassesDir() { - String base = "/WEB-INF/classes/xsl/"; + String base = "/WEB-INF/classes/" + xslFolder; for (String path : diveInto(base)) { if (path.endsWith(".xsl")) { foundStylesheet(path, base); @@ -220,7 +223,7 @@ private void findXSLinClassesDir() { } private void foundStylesheet(String path, String source) { - String file = path.substring(path.lastIndexOf("xsl/") + 4); + String file = path.substring(path.lastIndexOf(xslFolder) + 4); LOGGER.info("Found {} in {}", file, source); Stylesheet stylesheet = getStylesheet(file); if (source.startsWith("/WEB-INF/")) { @@ -260,7 +263,7 @@ void inspect() { } private void resolveXSL() { - String uri = "resource:xsl/" + name; + String uri = "resource:" + xslFolder + name; resolveXSL(uri); if (xsl == null) { resolveXSL(name); diff --git a/mycore-base/src/main/java/org/mycore/frontend/cli/MCRCommandUtils.java b/mycore-base/src/main/java/org/mycore/frontend/cli/MCRCommandUtils.java index c68ccc0660..97316e16f1 100644 --- a/mycore-base/src/main/java/org/mycore/frontend/cli/MCRCommandUtils.java +++ b/mycore-base/src/main/java/org/mycore/frontend/cli/MCRCommandUtils.java @@ -30,6 +30,7 @@ import org.jdom2.Element; import org.jdom2.transform.JDOMSource; import org.mycore.common.MCRUsageException; +import org.mycore.common.config.MCRConfiguration2; import org.mycore.common.xml.MCRURIResolver; import org.mycore.datamodel.common.MCRXMLMetadataManager; import org.mycore.datamodel.metadata.MCRMetadataManager; @@ -167,7 +168,7 @@ public static Stream getIdsFromIdToId(final String startId, final String * the name of the style to be used when resolving the stylesheet. * @param defaultStyle * the name of the default style, ending with .xsl to be used when resolving the stylesheet. - * A corresponding file xsl/defaultStyle must exist. + * A corresponding file [MCR.Layout.Transformer.Factory.XSLFolder]/defaultStyle must exist. * @param cache * The transformer cache to be used. * @return the transformer @@ -185,7 +186,8 @@ public static Transformer getTransformer(String style, String defaultStyle, Map< Element element = MCRURIResolver.instance().resolve("resource:" + xslFilePath); if (element == null) { LOGGER.warn("Couldn't find resource {} for style {}, using default.", xslFilePath, style); - xslFilePath = "xsl/" + defaultStyle; + final String xslFolder = MCRConfiguration2.getStringOrThrow("MCR.Layout.Transformer.Factory.XSLFolder"); + xslFilePath = xslFolder + "/" + defaultStyle; element = MCRURIResolver.instance().resolve("resource:" + xslFilePath); } diff --git a/mycore-xeditor/src/main/resources/components/xeditor/config/mycore.properties b/mycore-xeditor/src/main/resources/components/xeditor/config/mycore.properties index 14e22d809b..8656045ad2 100644 --- a/mycore-xeditor/src/main/resources/components/xeditor/config/mycore.properties +++ b/mycore-xeditor/src/main/resources/components/xeditor/config/mycore.properties @@ -37,7 +37,7 @@ MCR.XEditor.Target.ajaxsubselect.Class=org.mycore.frontend.xeditor.target.MCRAja MCR.XEditor.InsertTarget.DefaultMethod=build # Include file defining layout of custom repeater controls (up/down, insert, append, remove) -MCR.URIResolver.xslIncludes.xeditor=xeditor-custom.xsl +MCR.URIResolver.xslIncludes.xeditor=resource:xsl/xeditor-custom.xsl # Transformer to use for transformation from XEditor definition to HTML MCR.ContentTransformer.xeditor.Class=org.mycore.common.content.transformer.MCRXSL2XMLTransformer diff --git a/mycore-xeditor/src/main/resources/xsl/xeditor.xsl b/mycore-xeditor/src/main/resources/xsl/xeditor.xsl index 5f869732c8..d06e175126 100644 --- a/mycore-xeditor/src/main/resources/xsl/xeditor.xsl +++ b/mycore-xeditor/src/main/resources/xsl/xeditor.xsl @@ -8,7 +8,7 @@ - + diff --git a/mycore-xeditor/src/test/resources/mycore.properties b/mycore-xeditor/src/test/resources/mycore.properties index 559c670ecb..3ccabea1df 100644 --- a/mycore-xeditor/src/test/resources/mycore.properties +++ b/mycore-xeditor/src/test/resources/mycore.properties @@ -2,7 +2,8 @@ # Configuration properties for MyCoRe XEditor component # ############################################################################## -MCR.URIResolver.xslIncludes.xeditor=xeditor-custom.xsl +MCR.Layout.Transformer.Factory.XSLFolder=xsl +MCR.URIResolver.xslIncludes.xeditor=resource:xsl/xeditor-custom.xsl MCR.ContentTransformer.xeditor.Class=org.mycore.common.content.transformer.MCRXSL2XMLTransformer MCR.ContentTransformer.xeditor.Stylesheet=xsl/xeditor.xsl From 28603e14bf46a26b8da595fd436eebd4945371e7 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Tue, 26 Sep 2023 17:28:54 +0200 Subject: [PATCH 07/21] MCR-2966 xslt folder process new xslImport mechanism --- .../org/mycore/common/xml/MCRURIResolver.java | 27 +++++++++++++-- .../mycore/common/xml/MCRXMLFunctions.java | 17 +++++++++- .../mycore/common/xml/MCRURIResolverTest.java | 34 ++++++++++++++++++- .../common/xml/MCRXMLFunctionsTest.java | 17 ++++++++++ .../test/resources/xsl/functions/xsl-1.xsl | 5 +++ .../test/resources/xsl/functions/xsl-2.xsl | 5 +++ .../test/resources/xslt/functions/xsl-1.xsl | 5 +++ .../test/resources/xslt/functions/xsl-2.xsl | 5 +++ .../xeditor/MCRXEditorTransformerTest.java | 11 ++++++ 9 files changed, 122 insertions(+), 4 deletions(-) create mode 100644 mycore-base/src/test/resources/xsl/functions/xsl-1.xsl create mode 100644 mycore-base/src/test/resources/xsl/functions/xsl-2.xsl create mode 100644 mycore-base/src/test/resources/xslt/functions/xsl-1.xsl create mode 100644 mycore-base/src/test/resources/xslt/functions/xsl-2.xsl diff --git a/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java b/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java index ee5cc71d80..1c3c2da732 100644 --- a/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java +++ b/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java @@ -57,6 +57,7 @@ import javax.xml.transform.stream.StreamSource; import javax.xml.xpath.XPathExpressionException; +import org.apache.commons.lang3.StringUtils; import org.apache.http.client.cache.HttpCacheContext; import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.CloseableHttpResponse; @@ -1375,7 +1376,30 @@ private static class MCRXslImportResolver implements URIResolver { @Override public Source resolve(String href, String base) throws TransformerException { - String importXSL = MCRXMLFunctions.nextImportStep(href.substring(href.indexOf(':') + 1)); + final String baseURI = getParentDirectoryResourceURI(base); + // set xslt folder + final String xslFolder; + if (StringUtils.contains(baseURI, "/xsl/")) { + xslFolder = "xsl"; + } else { + xslFolder = "xslt"; + } + + // check for old import format: xslImport:property:current.xsl and issue a warning + final String importXSL; + final String importPart = StringUtils.substringAfter(href, ":"); + if (StringUtils.contains(importPart, ":")) { + final String propertyPart = StringUtils.substringBefore(importPart, ":"); + LOGGER.warn("{} is in old import format change to xslImport:{}!", href, propertyPart); + + importXSL = MCRXMLFunctions.nextImportStep(importPart); + } else { + final String selfName = StringUtils.substringAfter(baseURI, xslFolder + "/") + + StringUtils.substringAfterLast(base, "/"); + + importXSL = MCRXMLFunctions.nextImportStep(importPart, selfName); + } + if (importXSL.isEmpty()) { LOGGER.debug("End of import queue: {}", href); Namespace xslNamespace = Namespace.getNamespace("xsl", "http://www.w3.org/1999/XSL/Transform"); @@ -1385,7 +1409,6 @@ public Source resolve(String href, String base) throws TransformerException { } LOGGER.debug("xslImport importing {}", importXSL); - final String xslFolder = MCRConfiguration2.getStringOrThrow("MCR.Layout.Transformer.Factory.XSLFolder"); return fallback.resolve("resource:" + xslFolder + "/" + importXSL, base); } } diff --git a/mycore-base/src/main/java/org/mycore/common/xml/MCRXMLFunctions.java b/mycore-base/src/main/java/org/mycore/common/xml/MCRXMLFunctions.java index 31ba727d26..44a6914270 100644 --- a/mycore-base/src/main/java/org/mycore/common/xml/MCRXMLFunctions.java +++ b/mycore-base/src/main/java/org/mycore/common/xml/MCRXMLFunctions.java @@ -750,9 +750,21 @@ public static String nextImportStep(String includePart) { selfName = includePart.substring(border + 1); includePart = includePart.substring(0, border); } + return nextImportStep(includePart, selfName); + } + + /** + * Helper function for xslImport URI resolver and {@link #hasNextImportStep(String)} + * + * @param includePart substring after xslImport: + * @param selfName name of the current stylesheet + * @return the next stylesheet name to import + */ + public static String nextImportStep(String includePart, String selfName) { if (LOGGER.isDebugEnabled()) { - LOGGER.debug("get next import step for {}", includePart); + LOGGER.debug("get next import step for {}:{}", includePart, selfName); } + // get the parameters from mycore.properties List importList = MCRConfiguration2.getString("MCR.URIResolver.xslImports." + includePart) .map(MCRConfiguration2::splitValue) @@ -766,6 +778,9 @@ public static String nextImportStep(String includePart) { if (selfName == null && listIterator.hasPrevious()) { return listIterator.previous(); } + if (!importList.contains(selfName) && listIterator.hasPrevious()) { + return listIterator.previous(); + } while (listIterator.hasPrevious()) { String currentStylesheet = listIterator.previous(); diff --git a/mycore-base/src/test/java/org/mycore/common/xml/MCRURIResolverTest.java b/mycore-base/src/test/java/org/mycore/common/xml/MCRURIResolverTest.java index 059fd0d771..d3a4e7c87a 100644 --- a/mycore-base/src/test/java/org/mycore/common/xml/MCRURIResolverTest.java +++ b/mycore-base/src/test/java/org/mycore/common/xml/MCRURIResolverTest.java @@ -1,13 +1,17 @@ package org.mycore.common.xml; +import org.apache.commons.lang3.StringUtils; import org.junit.Assert; import org.junit.Test; +import org.mycore.common.MCRTestCase; +import org.mycore.common.config.MCRConfiguration2; import org.mycore.common.config.MCRConfigurationDir; +import javax.xml.transform.Source; import java.util.LinkedHashMap; import java.util.Map; -public class MCRURIResolverTest { +public class MCRURIResolverTest extends MCRTestCase { @Test public void testGetParentDirectoryResourceURI() { @@ -36,4 +40,32 @@ public void testGetParentDirectoryResourceURI() { Assert.assertEquals(entry.getValue(), result); } } + + @Test + public void testImportFromSameDirectory() throws Exception { + MCRConfiguration2.set("MCR.URIResolver.xslImports.xsl-import", "functions/xsl-1.xsl,functions/xsl-2.xsl"); + + Source resolved = MCRURIResolver.instance() + .resolve("xslImport:xsl-import:functions/xsl-2.xsl", "file:/tmp/xsl/functions/xsl-2.xsl"); + Assert.assertNotNull(resolved); + Assert.assertTrue(StringUtils.endsWith(resolved.getSystemId(), "/xsl/functions/xsl-1.xsl")); + + resolved = MCRURIResolver.instance() + .resolve("xslImport:xsl-import:functions/xsl-2.xsl", "file:/tmp/xslt/functions/xsl-2.xsl"); + Assert.assertNotNull(resolved); + Assert.assertTrue(StringUtils.endsWith(resolved.getSystemId(), "/xslt/functions/xsl-1.xsl")); + + // check with new import layout + resolved = MCRURIResolver.instance() + .resolve("xslImport:xsl-import", "file:/tmp/xslt/functions/xsl-2.xsl"); + Assert.assertNotNull(resolved); + Assert.assertTrue(StringUtils.endsWith(resolved.getSystemId(), "/xslt/functions/xsl-1.xsl")); + + // check with new import layout for calling xsl + resolved = MCRURIResolver.instance() + .resolve("xslImport:xsl-import", "file:/tmp/xslt/functions/xsl-parent.xsl"); + Assert.assertNotNull(resolved); + Assert.assertTrue(StringUtils.endsWith(resolved.getSystemId(), "/xslt/functions/xsl-2.xsl")); + + } } diff --git a/mycore-base/src/test/java/org/mycore/common/xml/MCRXMLFunctionsTest.java b/mycore-base/src/test/java/org/mycore/common/xml/MCRXMLFunctionsTest.java index 4d48073db0..67c46bf124 100644 --- a/mycore-base/src/test/java/org/mycore/common/xml/MCRXMLFunctionsTest.java +++ b/mycore-base/src/test/java/org/mycore/common/xml/MCRXMLFunctionsTest.java @@ -29,6 +29,7 @@ import org.junit.Test; import org.mycore.common.MCRTestCase; +import org.mycore.common.config.MCRConfiguration2; public class MCRXMLFunctionsTest extends MCRTestCase { @@ -173,4 +174,20 @@ public void toNCNameSecondPart() { } } + @Test + public void testNextImportStep() { + MCRConfiguration2.set("MCR.URIResolver.xslImports.xsl-import", "functions/xsl-1.xsl,functions/xsl-2.xsl"); + + // test with old include part + String next = MCRXMLFunctions.nextImportStep("xsl-import:functions/xsl-2.xsl"); + assertEquals("functions/xsl-1.xsl", next); + + // test with new include part + next = MCRXMLFunctions.nextImportStep("xsl-import", "functions/xsl-2.xsl"); + assertEquals("functions/xsl-1.xsl", next); + + // test with new include part and self name not in list (i.e. using base template) + next = MCRXMLFunctions.nextImportStep("xsl-import", "xsl-parent.xsl"); + assertEquals("functions/xsl-2.xsl", next); + } } diff --git a/mycore-base/src/test/resources/xsl/functions/xsl-1.xsl b/mycore-base/src/test/resources/xsl/functions/xsl-1.xsl new file mode 100644 index 0000000000..8ed11ac45d --- /dev/null +++ b/mycore-base/src/test/resources/xsl/functions/xsl-1.xsl @@ -0,0 +1,5 @@ + + + + + diff --git a/mycore-base/src/test/resources/xsl/functions/xsl-2.xsl b/mycore-base/src/test/resources/xsl/functions/xsl-2.xsl new file mode 100644 index 0000000000..91361b71b5 --- /dev/null +++ b/mycore-base/src/test/resources/xsl/functions/xsl-2.xsl @@ -0,0 +1,5 @@ + + + + + diff --git a/mycore-base/src/test/resources/xslt/functions/xsl-1.xsl b/mycore-base/src/test/resources/xslt/functions/xsl-1.xsl new file mode 100644 index 0000000000..8ed11ac45d --- /dev/null +++ b/mycore-base/src/test/resources/xslt/functions/xsl-1.xsl @@ -0,0 +1,5 @@ + + + + + diff --git a/mycore-base/src/test/resources/xslt/functions/xsl-2.xsl b/mycore-base/src/test/resources/xslt/functions/xsl-2.xsl new file mode 100644 index 0000000000..91361b71b5 --- /dev/null +++ b/mycore-base/src/test/resources/xslt/functions/xsl-2.xsl @@ -0,0 +1,5 @@ + + + + + diff --git a/mycore-xeditor/src/test/java/org/mycore/frontend/xeditor/MCRXEditorTransformerTest.java b/mycore-xeditor/src/test/java/org/mycore/frontend/xeditor/MCRXEditorTransformerTest.java index c91b5c7c93..61771a358a 100644 --- a/mycore-xeditor/src/test/java/org/mycore/frontend/xeditor/MCRXEditorTransformerTest.java +++ b/mycore-xeditor/src/test/java/org/mycore/frontend/xeditor/MCRXEditorTransformerTest.java @@ -24,6 +24,7 @@ import java.io.IOException; import java.util.HashMap; +import java.util.Map; import javax.xml.transform.TransformerException; @@ -190,4 +191,14 @@ public void testSelect() throws IOException, TransformerException, JDOMException SAXException, JaxenException { testTransformation("testSelect-editor.xml", "testSelect-source.xml", "testSelect-transformed.xml"); } + + @Override + protected Map getTestProperties() { + final Map properties = super.getTestProperties(); + + properties.put("MCR.URIResolver.CachingResolver.Capacity", "100"); + properties.put("MCR.URIResolver.CachingResolver.MaxAge", "3600000"); + + return properties; + } } From 0ff95fa3fc66232ec9122cb1084ed265d2782a53 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Thu, 28 Sep 2023 15:20:37 +0200 Subject: [PATCH 08/21] MCR-2966 xslt folder use startsWith for evaluating folder, fallback via configuration; reverse xmlfunctions:nextImportStep --- .../org/mycore/common/xml/MCRURIResolver.java | 20 ++++--------------- .../mycore/common/xml/MCRXMLFunctions.java | 17 +--------------- .../common/xml/MCRXMLFunctionsTest.java | 16 +++++++-------- 3 files changed, 13 insertions(+), 40 deletions(-) diff --git a/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java b/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java index 1c3c2da732..af865d3e20 100644 --- a/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java +++ b/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java @@ -1379,27 +1379,15 @@ public Source resolve(String href, String base) throws TransformerException { final String baseURI = getParentDirectoryResourceURI(base); // set xslt folder final String xslFolder; - if (StringUtils.contains(baseURI, "/xsl/")) { + if (StringUtils.startsWith(baseURI, "resource:xsl/")) { xslFolder = "xsl"; - } else { + } else if (StringUtils.startsWith(baseURI, "resource:xslt/")) { xslFolder = "xslt"; - } - - // check for old import format: xslImport:property:current.xsl and issue a warning - final String importXSL; - final String importPart = StringUtils.substringAfter(href, ":"); - if (StringUtils.contains(importPart, ":")) { - final String propertyPart = StringUtils.substringBefore(importPart, ":"); - LOGGER.warn("{} is in old import format change to xslImport:{}!", href, propertyPart); - - importXSL = MCRXMLFunctions.nextImportStep(importPart); } else { - final String selfName = StringUtils.substringAfter(baseURI, xslFolder + "/") - + StringUtils.substringAfterLast(base, "/"); - - importXSL = MCRXMLFunctions.nextImportStep(importPart, selfName); + xslFolder = MCRConfiguration2.getStringOrThrow("MCR.Layout.Transformer.Factory.XSLFolder"); } + String importXSL = MCRXMLFunctions.nextImportStep(href.substring(href.indexOf(':') + 1)); if (importXSL.isEmpty()) { LOGGER.debug("End of import queue: {}", href); Namespace xslNamespace = Namespace.getNamespace("xsl", "http://www.w3.org/1999/XSL/Transform"); diff --git a/mycore-base/src/main/java/org/mycore/common/xml/MCRXMLFunctions.java b/mycore-base/src/main/java/org/mycore/common/xml/MCRXMLFunctions.java index 44a6914270..31ba727d26 100644 --- a/mycore-base/src/main/java/org/mycore/common/xml/MCRXMLFunctions.java +++ b/mycore-base/src/main/java/org/mycore/common/xml/MCRXMLFunctions.java @@ -750,21 +750,9 @@ public static String nextImportStep(String includePart) { selfName = includePart.substring(border + 1); includePart = includePart.substring(0, border); } - return nextImportStep(includePart, selfName); - } - - /** - * Helper function for xslImport URI resolver and {@link #hasNextImportStep(String)} - * - * @param includePart substring after xslImport: - * @param selfName name of the current stylesheet - * @return the next stylesheet name to import - */ - public static String nextImportStep(String includePart, String selfName) { if (LOGGER.isDebugEnabled()) { - LOGGER.debug("get next import step for {}:{}", includePart, selfName); + LOGGER.debug("get next import step for {}", includePart); } - // get the parameters from mycore.properties List importList = MCRConfiguration2.getString("MCR.URIResolver.xslImports." + includePart) .map(MCRConfiguration2::splitValue) @@ -778,9 +766,6 @@ public static String nextImportStep(String includePart, String selfName) { if (selfName == null && listIterator.hasPrevious()) { return listIterator.previous(); } - if (!importList.contains(selfName) && listIterator.hasPrevious()) { - return listIterator.previous(); - } while (listIterator.hasPrevious()) { String currentStylesheet = listIterator.previous(); diff --git a/mycore-base/src/test/java/org/mycore/common/xml/MCRXMLFunctionsTest.java b/mycore-base/src/test/java/org/mycore/common/xml/MCRXMLFunctionsTest.java index 67c46bf124..c742fd385b 100644 --- a/mycore-base/src/test/java/org/mycore/common/xml/MCRXMLFunctionsTest.java +++ b/mycore-base/src/test/java/org/mycore/common/xml/MCRXMLFunctionsTest.java @@ -178,16 +178,16 @@ public void toNCNameSecondPart() { public void testNextImportStep() { MCRConfiguration2.set("MCR.URIResolver.xslImports.xsl-import", "functions/xsl-1.xsl,functions/xsl-2.xsl"); - // test with old include part - String next = MCRXMLFunctions.nextImportStep("xsl-import:functions/xsl-2.xsl"); - assertEquals("functions/xsl-1.xsl", next); + // test with first stylesheet in chain + String next = MCRXMLFunctions.nextImportStep("xsl-import"); + assertEquals("functions/xsl-2.xsl", next); - // test with new include part - next = MCRXMLFunctions.nextImportStep("xsl-import", "functions/xsl-2.xsl"); + // test with include part + next = MCRXMLFunctions.nextImportStep("xsl-import:functions/xsl-2.xsl"); assertEquals("functions/xsl-1.xsl", next); - // test with new include part and self name not in list (i.e. using base template) - next = MCRXMLFunctions.nextImportStep("xsl-import", "xsl-parent.xsl"); - assertEquals("functions/xsl-2.xsl", next); + // test with last stylesheet in chain + next = MCRXMLFunctions.nextImportStep("xsl-import:functions/xsl-1.xsl"); + assertEquals("", next); } } From 3e5389a75b8a40a037322c140cc82067ec2189c8 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Thu, 28 Sep 2023 15:53:25 +0200 Subject: [PATCH 09/21] MCR-2966 xslt folder remove test for new xslimport mechanism --- .../mycore/common/xml/MCRURIResolverTest.java | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/mycore-base/src/test/java/org/mycore/common/xml/MCRURIResolverTest.java b/mycore-base/src/test/java/org/mycore/common/xml/MCRURIResolverTest.java index d3a4e7c87a..ea3bf1873c 100644 --- a/mycore-base/src/test/java/org/mycore/common/xml/MCRURIResolverTest.java +++ b/mycore-base/src/test/java/org/mycore/common/xml/MCRURIResolverTest.java @@ -46,26 +46,13 @@ public void testImportFromSameDirectory() throws Exception { MCRConfiguration2.set("MCR.URIResolver.xslImports.xsl-import", "functions/xsl-1.xsl,functions/xsl-2.xsl"); Source resolved = MCRURIResolver.instance() - .resolve("xslImport:xsl-import:functions/xsl-2.xsl", "file:/tmp/xsl/functions/xsl-2.xsl"); + .resolve("xslImport:xsl-import:functions/xsl-2.xsl", "some.jar!/xsl/xsl/functions/xsl-2.xsl"); Assert.assertNotNull(resolved); Assert.assertTrue(StringUtils.endsWith(resolved.getSystemId(), "/xsl/functions/xsl-1.xsl")); resolved = MCRURIResolver.instance() - .resolve("xslImport:xsl-import:functions/xsl-2.xsl", "file:/tmp/xslt/functions/xsl-2.xsl"); + .resolve("xslImport:xsl-import:functions/xsl-2.xsl", "some.jar!/xslt/functions/xsl-2.xsl"); Assert.assertNotNull(resolved); Assert.assertTrue(StringUtils.endsWith(resolved.getSystemId(), "/xslt/functions/xsl-1.xsl")); - - // check with new import layout - resolved = MCRURIResolver.instance() - .resolve("xslImport:xsl-import", "file:/tmp/xslt/functions/xsl-2.xsl"); - Assert.assertNotNull(resolved); - Assert.assertTrue(StringUtils.endsWith(resolved.getSystemId(), "/xslt/functions/xsl-1.xsl")); - - // check with new import layout for calling xsl - resolved = MCRURIResolver.instance() - .resolve("xslImport:xsl-import", "file:/tmp/xslt/functions/xsl-parent.xsl"); - Assert.assertNotNull(resolved); - Assert.assertTrue(StringUtils.endsWith(resolved.getSystemId(), "/xslt/functions/xsl-2.xsl")); - } } From 85fdc2d2495111c502de04e754e16f3d68b2bf91 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Mon, 18 Sep 2023 18:51:59 +0200 Subject: [PATCH 10/21] MCR-2966 xslt folder move saxon xsls to xslt folder, add configuration variable for default xsl folder --- .../{xsl => xslt}/functions/accesskey.xsl | 0 .../xml/MCRLayoutTransformerFactory.java | 3 ++- .../org/mycore/common/xml/MCRURIResolver.java | 18 +++++++++++++----- .../main/resources/config/mycore.properties | 5 ++++- .../MyCoReLayout.xsl} | 0 .../MyCoReWebPage.xsl} | 2 +- .../{xsl => xslt}/default-parameters.xsl | 0 .../resources/{xsl => xslt}/functions/acl.xsl | 0 .../{xsl => xslt}/functions/classification.xsl | 0 .../{xsl => xslt}/functions/derivate.xsl | 0 .../resources/{xsl => xslt}/functions/i18n.xsl | 0 .../{xsl => xslt}/functions/layoututils.xsl | 0 .../{xsl => xslt}/functions/mcrversion.xsl | 0 .../{xsl => xslt}/functions/property.xsl | 0 .../{xsl => xslt}/functions/stringutils.xsl | 0 .../resources/{xsl => xslt}/functions/url.xsl | 0 .../classificationBrowser.xsl} | 0 .../classificationBrowserData-bootstrap.xsl} | 0 .../classificationBrowserData.xsl} | 0 .../classificationEditor.xsl} | 2 +- .../classificationEditorBase.xsl} | 0 .../components/iview2/config/mycore.properties | 4 ++-- .../{xsl => xslt}/functions/iview2.xsl | 0 .../iview2-solrresponse.xsl} | 0 .../mcr-module-startIview2.xsl} | 0 .../components/mods/config/mycore.properties | 2 +- .../resources/{xsl => xslt}/crossref/mods.xsl | 0 .../{xsl => xslt}/crossref/mods2book.xsl | 0 .../{xsl => xslt}/crossref/mods2journal.xsl | 0 .../resources/{xsl => xslt}/functions/mods.xsl | 0 .../solr/indexing/mods-dynamicfields.xsl} | 4 ++-- .../solr/indexing/mods-solr.xsl} | 6 +++--- .../utils/mods-enhancer.xsl} | 0 .../utils/mods-utils.xsl} | 4 ++-- .../components/solr/config/mycore.properties | 10 +++++----- .../resources/{xsl => xslt}/functions/solr.xsl | 0 .../indexing/mycoreobject-dynamicfields.xsl} | 4 ++-- .../indexing/mycoreobject-solrdocument.xsl} | 0 .../solr/indexing/solr-basetemplate.xsl} | 2 +- .../solr/response/response-addDerivates.xsl} | 0 .../solr/response/response-addDocId.xsl} | 0 .../solr/response/response-browse.xsl} | 4 ++-- .../solr/response/response-join-results.xsl} | 0 .../solr/response/response-utils.xsl} | 0 .../solr/response/response.xsl} | 4 ++-- .../solr/xeditor/solr-xeditor-templates.xsl} | 0 ...lassificationBrowserData-roleSubselect.xsl} | 0 .../{xsl/login-3.xsl => xslt/login.xsl} | 2 +- .../{xsl/roles-3.xsl => xslt/roles.xsl} | 4 ++-- .../{xsl/user-3.xsl => xslt/user.xsl} | 2 +- .../users-subselect.xsl} | 2 +- .../{xsl/users-3.xsl => xslt/users.xsl} | 2 +- .../components/viewer/config/mycore.properties | 2 +- .../IViewConfig-3.xsl => xslt/IViewConfig.xsl} | 0 .../altoChanges-3.xsl => xslt/altoChanges.xsl} | 0 .../{xsl/wcms2-3.xsl => xslt/wcms2.xsl} | 0 .../webtools/config/mycore.properties | 2 +- .../msie-warning.xsl} | 2 ++ .../processingGUI.xsl} | 0 .../sessionListing.xsl} | 0 .../frontend/xeditor/MCRPostProcessorXSL.java | 4 +++- .../xeditor-templates.xsl} | 0 62 files changed, 56 insertions(+), 40 deletions(-) rename mycore-acl/src/main/resources/{xsl => xslt}/functions/accesskey.xsl (100%) rename mycore-base/src/main/resources/{xsl/MyCoReLayout-3.xsl => xslt/MyCoReLayout.xsl} (100%) rename mycore-base/src/main/resources/{xsl/MyCoReWebPage-3.xsl => xslt/MyCoReWebPage.xsl} (99%) rename mycore-base/src/main/resources/{xsl => xslt}/default-parameters.xsl (100%) rename mycore-base/src/main/resources/{xsl => xslt}/functions/acl.xsl (100%) rename mycore-base/src/main/resources/{xsl => xslt}/functions/classification.xsl (100%) rename mycore-base/src/main/resources/{xsl => xslt}/functions/derivate.xsl (100%) rename mycore-base/src/main/resources/{xsl => xslt}/functions/i18n.xsl (100%) rename mycore-base/src/main/resources/{xsl => xslt}/functions/layoututils.xsl (100%) rename mycore-base/src/main/resources/{xsl => xslt}/functions/mcrversion.xsl (100%) rename mycore-base/src/main/resources/{xsl => xslt}/functions/property.xsl (100%) rename mycore-base/src/main/resources/{xsl => xslt}/functions/stringutils.xsl (100%) rename mycore-base/src/main/resources/{xsl => xslt}/functions/url.xsl (100%) rename mycore-classbrowser/src/main/resources/{xsl/classificationBrowser-3.xsl => xslt/classificationBrowser.xsl} (100%) rename mycore-classbrowser/src/main/resources/{xsl/classificationBrowserData-bootstrap-3.xsl => xslt/classificationBrowserData-bootstrap.xsl} (100%) rename mycore-classbrowser/src/main/resources/{xsl/classificationBrowserData-3.xsl => xslt/classificationBrowserData.xsl} (100%) rename mycore-classeditor/src/main/resources/{xsl/classificationEditor-3.xsl => xslt/classificationEditor.xsl} (98%) rename mycore-classeditor/src/main/resources/{xsl/classificationEditorBase-3.xsl => xslt/classificationEditorBase.xsl} (100%) rename mycore-iview2/src/main/resources/{xsl => xslt}/functions/iview2.xsl (100%) rename mycore-iview2/src/main/resources/{xsl/iview2-solrresponse-3.xsl => xslt/iview2-solrresponse.xsl} (100%) rename mycore-iview2/src/main/resources/{xsl/mcr-module-startIview2-3.xsl => xslt/mcr-module-startIview2.xsl} (100%) rename mycore-mods/src/main/resources/{xsl => xslt}/crossref/mods.xsl (100%) rename mycore-mods/src/main/resources/{xsl => xslt}/crossref/mods2book.xsl (100%) rename mycore-mods/src/main/resources/{xsl => xslt}/crossref/mods2journal.xsl (100%) rename mycore-mods/src/main/resources/{xsl => xslt}/functions/mods.xsl (100%) rename mycore-mods/src/main/resources/{xsl/solr/indexing/mods-dynamicfields-3.xsl => xslt/solr/indexing/mods-dynamicfields.xsl} (96%) rename mycore-mods/src/main/resources/{xsl/solr/indexing/mods-solr-3.xsl => xslt/solr/indexing/mods-solr.xsl} (98%) rename mycore-mods/src/main/resources/{xsl/utils/mods-enhancer-3.xsl => xslt/utils/mods-enhancer.xsl} (100%) rename mycore-mods/src/main/resources/{xsl/utils/mods-utils-3.xsl => xslt/utils/mods-utils.xsl} (99%) rename mycore-solr/src/main/resources/{xsl => xslt}/functions/solr.xsl (100%) rename mycore-solr/src/main/resources/{xsl/solr/indexing/mycoreobject-dynamicfields-3.xsl => xslt/solr/indexing/mycoreobject-dynamicfields.xsl} (98%) rename mycore-solr/src/main/resources/{xsl/solr/indexing/mycoreobject-solrdocument-3.xsl => xslt/solr/indexing/mycoreobject-solrdocument.xsl} (100%) rename mycore-solr/src/main/resources/{xsl/solr/indexing/solr-basetemplate-3.xsl => xslt/solr/indexing/solr-basetemplate.xsl} (99%) rename mycore-solr/src/main/resources/{xsl/solr/response/response-addDerivates-3.xsl => xslt/solr/response/response-addDerivates.xsl} (100%) rename mycore-solr/src/main/resources/{xsl/solr/response/response-addDocId-3.xsl => xslt/solr/response/response-addDocId.xsl} (100%) rename mycore-solr/src/main/resources/{xsl/solr/response/response-browse-3.xsl => xslt/solr/response/response-browse.xsl} (97%) rename mycore-solr/src/main/resources/{xsl/solr/response/response-join-results-3.xsl => xslt/solr/response/response-join-results.xsl} (100%) rename mycore-solr/src/main/resources/{xsl/solr/response/response-utils-3.xsl => xslt/solr/response/response-utils.xsl} (100%) rename mycore-solr/src/main/resources/{xsl/solr/response/response-3.xsl => xslt/solr/response/response.xsl} (98%) rename mycore-solr/src/main/resources/{xsl/solr/xeditor/solr-xeditor-templates-3.xsl => xslt/solr/xeditor/solr-xeditor-templates.xsl} (100%) rename mycore-user2/src/main/resources/{xsl/classificationBrowserData-roleSubselect-3.xsl => xslt/classificationBrowserData-roleSubselect.xsl} (100%) rename mycore-user2/src/main/resources/{xsl/login-3.xsl => xslt/login.xsl} (99%) rename mycore-user2/src/main/resources/{xsl/roles-3.xsl => xslt/roles.xsl} (93%) rename mycore-user2/src/main/resources/{xsl/user-3.xsl => xslt/user.xsl} (99%) rename mycore-user2/src/main/resources/{xsl/users-subselect-3.xsl => xslt/users-subselect.xsl} (97%) rename mycore-user2/src/main/resources/{xsl/users-3.xsl => xslt/users.xsl} (99%) rename mycore-viewer/src/main/resources/{xsl/IViewConfig-3.xsl => xslt/IViewConfig.xsl} (100%) rename mycore-viewer/src/main/resources/{xsl/altoChanges-3.xsl => xslt/altoChanges.xsl} (100%) rename mycore-wcms2/src/main/resources/{xsl/wcms2-3.xsl => xslt/wcms2.xsl} (100%) rename mycore-webtools/src/main/resources/{xsl/msie-warning-3.xsl => xslt/msie-warning.xsl} (97%) rename mycore-webtools/src/main/resources/{xsl/processingGUI-3.xsl => xslt/processingGUI.xsl} (100%) rename mycore-webtools/src/main/resources/{xsl/sessionListing-3.xsl => xslt/sessionListing.xsl} (100%) rename mycore-xeditor/src/main/resources/{xsl/xeditor-templates-3.xsl => xslt/xeditor-templates.xsl} (100%) diff --git a/mycore-acl/src/main/resources/xsl/functions/accesskey.xsl b/mycore-acl/src/main/resources/xslt/functions/accesskey.xsl similarity index 100% rename from mycore-acl/src/main/resources/xsl/functions/accesskey.xsl rename to mycore-acl/src/main/resources/xslt/functions/accesskey.xsl diff --git a/mycore-base/src/main/java/org/mycore/common/xml/MCRLayoutTransformerFactory.java b/mycore-base/src/main/java/org/mycore/common/xml/MCRLayoutTransformerFactory.java index b412d65cb4..fefd6eabc6 100644 --- a/mycore-base/src/main/java/org/mycore/common/xml/MCRLayoutTransformerFactory.java +++ b/mycore-base/src/main/java/org/mycore/common/xml/MCRLayoutTransformerFactory.java @@ -151,7 +151,8 @@ private String getResourceName(String id) { * Builds the filename of the stylesheet to use, e. g. "playlist-simple.xsl" */ private String buildStylesheetName(String id) { - return String.format(Locale.ROOT, "xsl/%s.xsl", id.replaceAll("-default$", "")); + final String xslFolder = MCRConfiguration2.getStringOrThrow("MCR.Layout.Transformer.Factory.XSLFolder"); + return String.format(Locale.ROOT, "%s/%s.xsl", xslFolder, id.replaceAll("-default$", "")); } } diff --git a/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java b/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java index 3a4243285f..354cb51cbf 100644 --- a/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java +++ b/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java @@ -266,7 +266,8 @@ private HashMap getResolverMapping() { static String getParentDirectoryResourceURI(String base) { if (base == null) { // the file was not included from another file, so we need to use the default resource directory - return "resource:xsl/"; + final String xslFolder = MCRConfiguration2.getStringOrThrow("MCR.Layout.Transformer.Factory.XSLFolder"); + return "resource:" + xslFolder + "/"; } else { String resolvingBase = null; @@ -370,7 +371,9 @@ private Source tryResolveXSL(String href, String base) throws TransformerExcepti } // new relative include did not work, now fall back to old behaviour and print a warning if it works - Source oldResolveMethodResult = SUPPORTED_SCHEMES.get("resource").resolve("resource:xsl/" + href, base); + final String xslFolder = MCRConfiguration2.getStringOrThrow("MCR.Layout.Transformer.Factory.XSLFolder"); + Source oldResolveMethodResult = SUPPORTED_SCHEMES.get("resource") + .resolve("resource:" + xslFolder + "/" + href, base); if (oldResolveMethodResult != null) { LOGGER.warn("The Stylesheet {} has include {} which only works with an old absolute include " + "mechanism. Please change the include to relative!", base, href); @@ -1218,9 +1221,10 @@ public Source resolve(String href, String base) throws TransformerException { } private MCRXSLTransformer getTransformer(String... stylesheet) { + final String xslFolder = MCRConfiguration2.getStringOrThrow("MCR.Layout.Transformer.Factory.XSLFolder"); String[] stylesheets = new String[stylesheet.length]; for (int i = 0; i < stylesheets.length; i++) { - stylesheets[i] = "xsl/" + stylesheet[i] + ".xsl"; + stylesheets[i] = xslFolder + "/" + stylesheet[i] + ".xsl"; } return MCRXSLTransformer.getInstance(stylesheets); } @@ -1329,10 +1333,12 @@ public Source resolve(String href, String base) { .orElseGet(Collections::emptyList); } + final String xslFolder = MCRConfiguration2.getStringOrThrow("MCR.Layout.Transformer.Factory.XSLFolder"); for (String include : propValue) { // create a new include element Element includeElement = new Element("include", xslNamespace); - includeElement.setAttribute("href", include.contains(":") ? include : "resource:xsl/" + include); + includeElement.setAttribute("href", + include.contains(":") ? include : "resource:" + xslFolder + "/" + include); root.addContent(includeElement); LOGGER.debug("Resolved XSL include: {}", include); } @@ -1366,7 +1372,9 @@ public Source resolve(String href, String base) throws TransformerException { return new JDOMSource(root); } LOGGER.debug("xslImport importing {}", importXSL); - return fallback.resolve("resource:xsl/" + importXSL, base); + + final String xslFolder = MCRConfiguration2.getStringOrThrow("MCR.Layout.Transformer.Factory.XSLFolder"); + return fallback.resolve("resource:" + xslFolder + "/" + importXSL, base); } } diff --git a/mycore-base/src/main/resources/config/mycore.properties b/mycore-base/src/main/resources/config/mycore.properties index b4ae981304..383f82dab3 100644 --- a/mycore-base/src/main/resources/config/mycore.properties +++ b/mycore-base/src/main/resources/config/mycore.properties @@ -91,6 +91,9 @@ MCR.BatchEditor.BaseLevel.object=/mycoreobject # Define the LayoutFactory class MCR.Layout.Transformer.Factory=org.mycore.common.xml.MCRLayoutTransformerFactory +# Default folder for XSL files, switch to XSLT for XSLT-3 applications +MCR.Layout.Transformer.Factory.XSLFolder=xsl + # The format of the session ID # MCR.Session.Param=;jsessionid= @@ -470,7 +473,7 @@ MCR.Startup.Class=org.mycore.backend.jpa.MCRJPABootstrapper,org.mycore.datamodel MCR.Website.ReadAccessVerification=true MCR.URIResolver.xslIncludes.MyCoReWebPage=classificationBrowser.xsl -MCR.URIResolver.xslIncludes.MyCoReWebPage-3=classificationBrowser-3.xsl +MCR.URIResolver.xslIncludes.MyCoReWebPage-3=classificationBrowser.xsl MCR.URIResolver.xslIncludes.functions=functions/acl.xsl,functions/classification.xsl,functions/derivate.xsl,functions/i18n.xsl,functions/mcrversion.xsl,functions/property.xsl,functions/stringutils.xsl,functions/url.xsl,functions/layoututils.xsl ############################################################################## diff --git a/mycore-base/src/main/resources/xsl/MyCoReLayout-3.xsl b/mycore-base/src/main/resources/xslt/MyCoReLayout.xsl similarity index 100% rename from mycore-base/src/main/resources/xsl/MyCoReLayout-3.xsl rename to mycore-base/src/main/resources/xslt/MyCoReLayout.xsl diff --git a/mycore-base/src/main/resources/xsl/MyCoReWebPage-3.xsl b/mycore-base/src/main/resources/xslt/MyCoReWebPage.xsl similarity index 99% rename from mycore-base/src/main/resources/xsl/MyCoReWebPage-3.xsl rename to mycore-base/src/main/resources/xslt/MyCoReWebPage.xsl index 359174db5e..2771766370 100644 --- a/mycore-base/src/main/resources/xsl/MyCoReWebPage-3.xsl +++ b/mycore-base/src/main/resources/xslt/MyCoReWebPage.xsl @@ -12,7 +12,7 @@ > &html-output; - + diff --git a/mycore-base/src/main/resources/xsl/default-parameters.xsl b/mycore-base/src/main/resources/xslt/default-parameters.xsl similarity index 100% rename from mycore-base/src/main/resources/xsl/default-parameters.xsl rename to mycore-base/src/main/resources/xslt/default-parameters.xsl diff --git a/mycore-base/src/main/resources/xsl/functions/acl.xsl b/mycore-base/src/main/resources/xslt/functions/acl.xsl similarity index 100% rename from mycore-base/src/main/resources/xsl/functions/acl.xsl rename to mycore-base/src/main/resources/xslt/functions/acl.xsl diff --git a/mycore-base/src/main/resources/xsl/functions/classification.xsl b/mycore-base/src/main/resources/xslt/functions/classification.xsl similarity index 100% rename from mycore-base/src/main/resources/xsl/functions/classification.xsl rename to mycore-base/src/main/resources/xslt/functions/classification.xsl diff --git a/mycore-base/src/main/resources/xsl/functions/derivate.xsl b/mycore-base/src/main/resources/xslt/functions/derivate.xsl similarity index 100% rename from mycore-base/src/main/resources/xsl/functions/derivate.xsl rename to mycore-base/src/main/resources/xslt/functions/derivate.xsl diff --git a/mycore-base/src/main/resources/xsl/functions/i18n.xsl b/mycore-base/src/main/resources/xslt/functions/i18n.xsl similarity index 100% rename from mycore-base/src/main/resources/xsl/functions/i18n.xsl rename to mycore-base/src/main/resources/xslt/functions/i18n.xsl diff --git a/mycore-base/src/main/resources/xsl/functions/layoututils.xsl b/mycore-base/src/main/resources/xslt/functions/layoututils.xsl similarity index 100% rename from mycore-base/src/main/resources/xsl/functions/layoututils.xsl rename to mycore-base/src/main/resources/xslt/functions/layoututils.xsl diff --git a/mycore-base/src/main/resources/xsl/functions/mcrversion.xsl b/mycore-base/src/main/resources/xslt/functions/mcrversion.xsl similarity index 100% rename from mycore-base/src/main/resources/xsl/functions/mcrversion.xsl rename to mycore-base/src/main/resources/xslt/functions/mcrversion.xsl diff --git a/mycore-base/src/main/resources/xsl/functions/property.xsl b/mycore-base/src/main/resources/xslt/functions/property.xsl similarity index 100% rename from mycore-base/src/main/resources/xsl/functions/property.xsl rename to mycore-base/src/main/resources/xslt/functions/property.xsl diff --git a/mycore-base/src/main/resources/xsl/functions/stringutils.xsl b/mycore-base/src/main/resources/xslt/functions/stringutils.xsl similarity index 100% rename from mycore-base/src/main/resources/xsl/functions/stringutils.xsl rename to mycore-base/src/main/resources/xslt/functions/stringutils.xsl diff --git a/mycore-base/src/main/resources/xsl/functions/url.xsl b/mycore-base/src/main/resources/xslt/functions/url.xsl similarity index 100% rename from mycore-base/src/main/resources/xsl/functions/url.xsl rename to mycore-base/src/main/resources/xslt/functions/url.xsl diff --git a/mycore-classbrowser/src/main/resources/xsl/classificationBrowser-3.xsl b/mycore-classbrowser/src/main/resources/xslt/classificationBrowser.xsl similarity index 100% rename from mycore-classbrowser/src/main/resources/xsl/classificationBrowser-3.xsl rename to mycore-classbrowser/src/main/resources/xslt/classificationBrowser.xsl diff --git a/mycore-classbrowser/src/main/resources/xsl/classificationBrowserData-bootstrap-3.xsl b/mycore-classbrowser/src/main/resources/xslt/classificationBrowserData-bootstrap.xsl similarity index 100% rename from mycore-classbrowser/src/main/resources/xsl/classificationBrowserData-bootstrap-3.xsl rename to mycore-classbrowser/src/main/resources/xslt/classificationBrowserData-bootstrap.xsl diff --git a/mycore-classbrowser/src/main/resources/xsl/classificationBrowserData-3.xsl b/mycore-classbrowser/src/main/resources/xslt/classificationBrowserData.xsl similarity index 100% rename from mycore-classbrowser/src/main/resources/xsl/classificationBrowserData-3.xsl rename to mycore-classbrowser/src/main/resources/xslt/classificationBrowserData.xsl diff --git a/mycore-classeditor/src/main/resources/xsl/classificationEditor-3.xsl b/mycore-classeditor/src/main/resources/xslt/classificationEditor.xsl similarity index 98% rename from mycore-classeditor/src/main/resources/xsl/classificationEditor-3.xsl rename to mycore-classeditor/src/main/resources/xslt/classificationEditor.xsl index 9448602f11..eaeeb69e31 100644 --- a/mycore-classeditor/src/main/resources/xsl/classificationEditor-3.xsl +++ b/mycore-classeditor/src/main/resources/xslt/classificationEditor.xsl @@ -5,7 +5,7 @@ version="3"> - + diff --git a/mycore-classeditor/src/main/resources/xsl/classificationEditorBase-3.xsl b/mycore-classeditor/src/main/resources/xslt/classificationEditorBase.xsl similarity index 100% rename from mycore-classeditor/src/main/resources/xsl/classificationEditorBase-3.xsl rename to mycore-classeditor/src/main/resources/xslt/classificationEditorBase.xsl diff --git a/mycore-iview2/src/main/resources/components/iview2/config/mycore.properties b/mycore-iview2/src/main/resources/components/iview2/config/mycore.properties index ccfb9d2b55..f3a883d67b 100644 --- a/mycore-iview2/src/main/resources/components/iview2/config/mycore.properties +++ b/mycore-iview2/src/main/resources/components/iview2/config/mycore.properties @@ -20,9 +20,9 @@ MCR.Module-iview2.MaxResetCount=3 MCR.CLI.Classes.Internal=%MCR.CLI.Classes.Internal%,org.mycore.iview2.frontend.MCRIView2Commands MCR.URIResolver.ModuleResolver.iview2=org.mycore.iview2.services.MCRIview2URIResolver MCR.URIResolver.xslIncludes.components=%MCR.URIResolver.xslIncludes.components%,mcr-module-startIview2.xsl -MCR.URIResolver.xslIncludes.components-3=%MCR.URIResolver.xslIncludes.components-3%,mcr-module-startIview2-3.xsl +MCR.URIResolver.xslIncludes.components-3=%MCR.URIResolver.xslIncludes.components-3%,mcr-module-startIview2.xsl MCR.URIResolver.xslIncludes.solrResponse=%MCR.URIResolver.xslIncludes.solrResponse%,iview2-solrresponse.xsl -MCR.URIResolver.xslIncludes.solrResponse-3=%MCR.URIResolver.xslIncludes.solrResponse-3%,iview2-solrresponse-3.xsl +MCR.URIResolver.xslIncludes.solrResponse-3=%MCR.URIResolver.xslIncludes.solrResponse-3%,iview2-solrresponse.xsl MCR.URIResolver.xslIncludes.functions=%MCR.URIResolver.xslIncludes.functions%,functions/iview2.xsl MCR.Hibernate.Mappings=%MCR.Hibernate.Mappings%,org.mycore.iview2.services.MCRTileJob diff --git a/mycore-iview2/src/main/resources/xsl/functions/iview2.xsl b/mycore-iview2/src/main/resources/xslt/functions/iview2.xsl similarity index 100% rename from mycore-iview2/src/main/resources/xsl/functions/iview2.xsl rename to mycore-iview2/src/main/resources/xslt/functions/iview2.xsl diff --git a/mycore-iview2/src/main/resources/xsl/iview2-solrresponse-3.xsl b/mycore-iview2/src/main/resources/xslt/iview2-solrresponse.xsl similarity index 100% rename from mycore-iview2/src/main/resources/xsl/iview2-solrresponse-3.xsl rename to mycore-iview2/src/main/resources/xslt/iview2-solrresponse.xsl diff --git a/mycore-iview2/src/main/resources/xsl/mcr-module-startIview2-3.xsl b/mycore-iview2/src/main/resources/xslt/mcr-module-startIview2.xsl similarity index 100% rename from mycore-iview2/src/main/resources/xsl/mcr-module-startIview2-3.xsl rename to mycore-iview2/src/main/resources/xslt/mcr-module-startIview2.xsl diff --git a/mycore-mods/src/main/resources/components/mods/config/mycore.properties b/mycore-mods/src/main/resources/components/mods/config/mycore.properties index 5c5c61ed66..255532af2d 100644 --- a/mycore-mods/src/main/resources/components/mods/config/mycore.properties +++ b/mycore-mods/src/main/resources/components/mods/config/mycore.properties @@ -82,7 +82,7 @@ MCR.URIResolver.xslIncludes.functions=%MCR.URIResolver.xslIncludes.functions%,fu MCR.URIResolver.xslIncludes.datacite=mycoreobject-datacite.xsl MCR.URIResolver.xslIncludes.schemaorg= MCR.URIResolver.xslImports.solr-document=%MCR.URIResolver.xslImports.solr-document%,mods-solr.xsl -MCR.URIResolver.xslImports.solr-document-3=%MCR.URIResolver.xslImports.solr-document-3%,solr/indexing/mods-solr-3.xsl,solr/indexing/mods-dynamicfields-3.xsl +MCR.URIResolver.xslImports.solr-document-3=%MCR.URIResolver.xslImports.solr-document-3%,solr/indexing/mods-solr.xsl,solr/indexing/mods-dynamicfields.xsl MCR.URIResolver.redirect.editor-mods-external=webapp:editor/editor-mods-external.xml # URIResolver to sort MODS diff --git a/mycore-mods/src/main/resources/xsl/crossref/mods.xsl b/mycore-mods/src/main/resources/xslt/crossref/mods.xsl similarity index 100% rename from mycore-mods/src/main/resources/xsl/crossref/mods.xsl rename to mycore-mods/src/main/resources/xslt/crossref/mods.xsl diff --git a/mycore-mods/src/main/resources/xsl/crossref/mods2book.xsl b/mycore-mods/src/main/resources/xslt/crossref/mods2book.xsl similarity index 100% rename from mycore-mods/src/main/resources/xsl/crossref/mods2book.xsl rename to mycore-mods/src/main/resources/xslt/crossref/mods2book.xsl diff --git a/mycore-mods/src/main/resources/xsl/crossref/mods2journal.xsl b/mycore-mods/src/main/resources/xslt/crossref/mods2journal.xsl similarity index 100% rename from mycore-mods/src/main/resources/xsl/crossref/mods2journal.xsl rename to mycore-mods/src/main/resources/xslt/crossref/mods2journal.xsl diff --git a/mycore-mods/src/main/resources/xsl/functions/mods.xsl b/mycore-mods/src/main/resources/xslt/functions/mods.xsl similarity index 100% rename from mycore-mods/src/main/resources/xsl/functions/mods.xsl rename to mycore-mods/src/main/resources/xslt/functions/mods.xsl diff --git a/mycore-mods/src/main/resources/xsl/solr/indexing/mods-dynamicfields-3.xsl b/mycore-mods/src/main/resources/xslt/solr/indexing/mods-dynamicfields.xsl similarity index 96% rename from mycore-mods/src/main/resources/xsl/solr/indexing/mods-dynamicfields-3.xsl rename to mycore-mods/src/main/resources/xslt/solr/indexing/mods-dynamicfields.xsl index 3e601b802a..5fe0dc2b60 100644 --- a/mycore-mods/src/main/resources/xsl/solr/indexing/mods-dynamicfields-3.xsl +++ b/mycore-mods/src/main/resources/xslt/solr/indexing/mods-dynamicfields.xsl @@ -6,9 +6,9 @@ xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:mcrmods="http://www.mycore.de/xslt/mods"> - + - + diff --git a/mycore-mods/src/main/resources/xsl/solr/indexing/mods-solr-3.xsl b/mycore-mods/src/main/resources/xslt/solr/indexing/mods-solr.xsl similarity index 98% rename from mycore-mods/src/main/resources/xsl/solr/indexing/mods-solr-3.xsl rename to mycore-mods/src/main/resources/xslt/solr/indexing/mods-solr.xsl index 5ad3bef8eb..396426fc96 100644 --- a/mycore-mods/src/main/resources/xsl/solr/indexing/mods-solr-3.xsl +++ b/mycore-mods/src/main/resources/xslt/solr/indexing/mods-solr.xsl @@ -8,11 +8,11 @@ exclude-result-prefixes="xlink mods fn mcrmods"> - + - - + + diff --git a/mycore-mods/src/main/resources/xsl/utils/mods-enhancer-3.xsl b/mycore-mods/src/main/resources/xslt/utils/mods-enhancer.xsl similarity index 100% rename from mycore-mods/src/main/resources/xsl/utils/mods-enhancer-3.xsl rename to mycore-mods/src/main/resources/xslt/utils/mods-enhancer.xsl diff --git a/mycore-mods/src/main/resources/xsl/utils/mods-utils-3.xsl b/mycore-mods/src/main/resources/xslt/utils/mods-utils.xsl similarity index 99% rename from mycore-mods/src/main/resources/xsl/utils/mods-utils-3.xsl rename to mycore-mods/src/main/resources/xslt/utils/mods-utils.xsl index a306eb0a03..72b1f35da8 100644 --- a/mycore-mods/src/main/resources/xsl/utils/mods-utils-3.xsl +++ b/mycore-mods/src/main/resources/xslt/utils/mods-utils.xsl @@ -36,8 +36,8 @@ - - + + diff --git a/mycore-solr/src/main/resources/components/solr/config/mycore.properties b/mycore-solr/src/main/resources/components/solr/config/mycore.properties index ef4a85da35..c947bbd3e3 100644 --- a/mycore-solr/src/main/resources/components/solr/config/mycore.properties +++ b/mycore-solr/src/main/resources/components/solr/config/mycore.properties @@ -9,7 +9,7 @@ MCR.EventHandler.MCRPath.100.Class=org.mycore.solr.index.MCRSolrIndexEventHandle MCR.URIResolver.ModuleResolver.solr=org.mycore.solr.common.xml.MCRSolrQueryResolver MCR.URIResolver.xslImports.solr-document=solr-basetemplate.xsl -MCR.URIResolver.xslImports.solr-document-3=solr/indexing/solr-basetemplate-3.xsl +MCR.URIResolver.xslImports.solr-document-3=solr/indexing/solr-basetemplate.xsl MCR.Module-classbrowser.QueryAdapter=org.mycore.solr.search.MCRSolrQueryAdapter @@ -58,7 +58,7 @@ MCR.ContentTransformer.mycoreobject-solrdocument.Stylesheet=xsl/mycoreobject-sol MCR.ContentTransformer.mycoreobject-solrdocument.Context=org.mycore.solr.index.document.jaxb MCR.ContentTransformer.mycoreobject-solrdocument-3.Class=org.mycore.common.content.transformer.MCRXSL2JAXBTransformer -MCR.ContentTransformer.mycoreobject-solrdocument-3.Stylesheet=xsl/solr/indexing/mycoreobject-solrdocument-3.xsl +MCR.ContentTransformer.mycoreobject-solrdocument-3.Stylesheet=xslt/solr/indexing/mycoreobject-solrdocument.xsl MCR.ContentTransformer.mycoreobject-solrdocument-3.Context=org.mycore.solr.index.document.jaxb MCR.ContentTransformer.mycoreobject-solrdocument-3.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl @@ -69,7 +69,7 @@ MCR.ContentTransformer.response-solrdocument.Context=%MCR.ContentTransformer.myc MCR.ContentTransformer.response-prepared-3.Class=org.mycore.common.content.transformer.MCRXSLTransformer MCR.ContentTransformer.response-prepared-3.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl -MCR.ContentTransformer.response-prepared-3.Stylesheet=xsl/solr/response/response-join-results-3.xsl,xsl/solr/response/response-addDocId-3.xsl,xsl/solr/response/response-addDerivates-3.xsl +MCR.ContentTransformer.response-prepared-3.Stylesheet=xslt/solr/response/response-join-results.xsl,xslt/solr/response/response-addDocId.xsl,xslt/solr/response/response-addDerivates.xsl MCR.ContentTransformer.response-prepared.Class=org.mycore.common.content.transformer.MCRXSLTransformer MCR.ContentTransformer.response-prepared.TransformerFactoryClass=org.apache.xalan.processor.TransformerFactoryImpl @@ -89,9 +89,9 @@ MCR.Solr.JoinQueryFields=%MCR.Solr.ContentBaseFields%,%MCR.Solr.AVExtenderFields MCR.CLI.Classes.Internal=%MCR.CLI.Classes.Internal%,org.mycore.solr.commands.MCRSolrCommands MCR.URIResolver.xslImports.solr-document=%MCR.URIResolver.xslImports.solr-document%,mycoreobject-dynamicfields.xsl -MCR.URIResolver.xslImports.solr-document-3=%MCR.URIResolver.xslImports.solr-document-3%,solr/indexing/mycoreobject-dynamicfields-3.xsl +MCR.URIResolver.xslImports.solr-document-3=%MCR.URIResolver.xslImports.solr-document-3%,solr/indexing/mycoreobject-dynamicfields.xsl MCR.URIResolver.xslIncludes.xeditorTemplates=%MCR.URIResolver.xslIncludes.xeditorTemplates%,solr-xeditor-templates.xsl -MCR.URIResolver.xslIncludes.xeditorTemplates-3=%MCR.URIResolver.xslIncludes.xeditorTemplates-3%,solr/xeditor/solr-xeditor-templates-3.xsl +MCR.URIResolver.xslIncludes.xeditorTemplates-3=%MCR.URIResolver.xslIncludes.xeditorTemplates-3%,solr/xeditor/solr-xeditor-templates.xsl # MCR.Module-solr.Classification.Core=classification diff --git a/mycore-solr/src/main/resources/xsl/functions/solr.xsl b/mycore-solr/src/main/resources/xslt/functions/solr.xsl similarity index 100% rename from mycore-solr/src/main/resources/xsl/functions/solr.xsl rename to mycore-solr/src/main/resources/xslt/functions/solr.xsl diff --git a/mycore-solr/src/main/resources/xsl/solr/indexing/mycoreobject-dynamicfields-3.xsl b/mycore-solr/src/main/resources/xslt/solr/indexing/mycoreobject-dynamicfields.xsl similarity index 98% rename from mycore-solr/src/main/resources/xsl/solr/indexing/mycoreobject-dynamicfields-3.xsl rename to mycore-solr/src/main/resources/xslt/solr/indexing/mycoreobject-dynamicfields.xsl index bebd18e140..234cae7d45 100644 --- a/mycore-solr/src/main/resources/xsl/solr/indexing/mycoreobject-dynamicfields-3.xsl +++ b/mycore-solr/src/main/resources/xslt/solr/indexing/mycoreobject-dynamicfields.xsl @@ -5,9 +5,9 @@ xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:mcrsolr="http://www.mycore.de/xslt/solr"> - + - + diff --git a/mycore-solr/src/main/resources/xsl/solr/indexing/mycoreobject-solrdocument-3.xsl b/mycore-solr/src/main/resources/xslt/solr/indexing/mycoreobject-solrdocument.xsl similarity index 100% rename from mycore-solr/src/main/resources/xsl/solr/indexing/mycoreobject-solrdocument-3.xsl rename to mycore-solr/src/main/resources/xslt/solr/indexing/mycoreobject-solrdocument.xsl diff --git a/mycore-solr/src/main/resources/xsl/solr/indexing/solr-basetemplate-3.xsl b/mycore-solr/src/main/resources/xslt/solr/indexing/solr-basetemplate.xsl similarity index 99% rename from mycore-solr/src/main/resources/xsl/solr/indexing/solr-basetemplate-3.xsl rename to mycore-solr/src/main/resources/xslt/solr/indexing/solr-basetemplate.xsl index da525e6a57..535453b82b 100644 --- a/mycore-solr/src/main/resources/xsl/solr/indexing/solr-basetemplate-3.xsl +++ b/mycore-solr/src/main/resources/xslt/solr/indexing/solr-basetemplate.xsl @@ -6,7 +6,7 @@ xmlns:fn="http://www.w3.org/2005/xpath-functions"> - + diff --git a/mycore-solr/src/main/resources/xsl/solr/response/response-addDerivates-3.xsl b/mycore-solr/src/main/resources/xslt/solr/response/response-addDerivates.xsl similarity index 100% rename from mycore-solr/src/main/resources/xsl/solr/response/response-addDerivates-3.xsl rename to mycore-solr/src/main/resources/xslt/solr/response/response-addDerivates.xsl diff --git a/mycore-solr/src/main/resources/xsl/solr/response/response-addDocId-3.xsl b/mycore-solr/src/main/resources/xslt/solr/response/response-addDocId.xsl similarity index 100% rename from mycore-solr/src/main/resources/xsl/solr/response/response-addDocId-3.xsl rename to mycore-solr/src/main/resources/xslt/solr/response/response-addDocId.xsl diff --git a/mycore-solr/src/main/resources/xsl/solr/response/response-browse-3.xsl b/mycore-solr/src/main/resources/xslt/solr/response/response-browse.xsl similarity index 97% rename from mycore-solr/src/main/resources/xsl/solr/response/response-browse-3.xsl rename to mycore-solr/src/main/resources/xslt/solr/response/response-browse.xsl index d7bdae9e79..20965e769a 100644 --- a/mycore-solr/src/main/resources/xsl/solr/response/response-browse-3.xsl +++ b/mycore-solr/src/main/resources/xslt/solr/response/response-browse.xsl @@ -6,8 +6,8 @@ xmlns:mcri18n="http://www.mycore.de/xslt/i18n" exclude-result-prefixes="xlink mcri18n xsl"> &html-output; - - + + diff --git a/mycore-solr/src/main/resources/xsl/solr/response/response-join-results-3.xsl b/mycore-solr/src/main/resources/xslt/solr/response/response-join-results.xsl similarity index 100% rename from mycore-solr/src/main/resources/xsl/solr/response/response-join-results-3.xsl rename to mycore-solr/src/main/resources/xslt/solr/response/response-join-results.xsl diff --git a/mycore-solr/src/main/resources/xsl/solr/response/response-utils-3.xsl b/mycore-solr/src/main/resources/xslt/solr/response/response-utils.xsl similarity index 100% rename from mycore-solr/src/main/resources/xsl/solr/response/response-utils-3.xsl rename to mycore-solr/src/main/resources/xslt/solr/response/response-utils.xsl diff --git a/mycore-solr/src/main/resources/xsl/solr/response/response-3.xsl b/mycore-solr/src/main/resources/xslt/solr/response/response.xsl similarity index 98% rename from mycore-solr/src/main/resources/xsl/solr/response/response-3.xsl rename to mycore-solr/src/main/resources/xslt/solr/response/response.xsl index d89a62e0be..7bf1a0a37e 100644 --- a/mycore-solr/src/main/resources/xsl/solr/response/response-3.xsl +++ b/mycore-solr/src/main/resources/xslt/solr/response/response.xsl @@ -6,8 +6,8 @@ xmlns:mcri18n="http://www.mycore.de/xslt/i18n" exclude-result-prefixes="mcri18n"> &html-output; - - + + diff --git a/mycore-solr/src/main/resources/xsl/solr/xeditor/solr-xeditor-templates-3.xsl b/mycore-solr/src/main/resources/xslt/solr/xeditor/solr-xeditor-templates.xsl similarity index 100% rename from mycore-solr/src/main/resources/xsl/solr/xeditor/solr-xeditor-templates-3.xsl rename to mycore-solr/src/main/resources/xslt/solr/xeditor/solr-xeditor-templates.xsl diff --git a/mycore-user2/src/main/resources/xsl/classificationBrowserData-roleSubselect-3.xsl b/mycore-user2/src/main/resources/xslt/classificationBrowserData-roleSubselect.xsl similarity index 100% rename from mycore-user2/src/main/resources/xsl/classificationBrowserData-roleSubselect-3.xsl rename to mycore-user2/src/main/resources/xslt/classificationBrowserData-roleSubselect.xsl diff --git a/mycore-user2/src/main/resources/xsl/login-3.xsl b/mycore-user2/src/main/resources/xslt/login.xsl similarity index 99% rename from mycore-user2/src/main/resources/xsl/login-3.xsl rename to mycore-user2/src/main/resources/xslt/login.xsl index cf099b7da4..ee0932bc76 100644 --- a/mycore-user2/src/main/resources/xsl/login-3.xsl +++ b/mycore-user2/src/main/resources/xslt/login.xsl @@ -34,7 +34,7 @@ > &html-output; - + diff --git a/mycore-user2/src/main/resources/xsl/roles-3.xsl b/mycore-user2/src/main/resources/xslt/roles.xsl similarity index 93% rename from mycore-user2/src/main/resources/xsl/roles-3.xsl rename to mycore-user2/src/main/resources/xslt/roles.xsl index c3ed54ba25..9b9d83dfe8 100644 --- a/mycore-user2/src/main/resources/xsl/roles-3.xsl +++ b/mycore-user2/src/main/resources/xslt/roles.xsl @@ -6,8 +6,8 @@ xmlns:mcrurl="http://www.mycore.de/xslt/url" xmlns:mcri18n="http://www.mycore.de/xslt/i18n" exclude-result-prefixes="xsl mcrurl mcri18n"> - - + + diff --git a/mycore-user2/src/main/resources/xsl/user-3.xsl b/mycore-user2/src/main/resources/xslt/user.xsl similarity index 99% rename from mycore-user2/src/main/resources/xsl/user-3.xsl rename to mycore-user2/src/main/resources/xslt/user.xsl index 17990fa56a..c4e9b7666a 100644 --- a/mycore-user2/src/main/resources/xsl/user-3.xsl +++ b/mycore-user2/src/main/resources/xslt/user.xsl @@ -8,7 +8,7 @@ exclude-result-prefixes="xsl mcri18n mcracl" > - + diff --git a/mycore-user2/src/main/resources/xsl/users-subselect-3.xsl b/mycore-user2/src/main/resources/xslt/users-subselect.xsl similarity index 97% rename from mycore-user2/src/main/resources/xsl/users-subselect-3.xsl rename to mycore-user2/src/main/resources/xslt/users-subselect.xsl index 147851e268..7a1a985088 100644 --- a/mycore-user2/src/main/resources/xsl/users-subselect-3.xsl +++ b/mycore-user2/src/main/resources/xslt/users-subselect.xsl @@ -9,7 +9,7 @@ exclude-result-prefixes="xsl mcri18n mcrurl" > - + diff --git a/mycore-user2/src/main/resources/xsl/users-3.xsl b/mycore-user2/src/main/resources/xslt/users.xsl similarity index 99% rename from mycore-user2/src/main/resources/xsl/users-3.xsl rename to mycore-user2/src/main/resources/xslt/users.xsl index 587375cec3..a61d25ee4e 100644 --- a/mycore-user2/src/main/resources/xsl/users-3.xsl +++ b/mycore-user2/src/main/resources/xslt/users.xsl @@ -9,7 +9,7 @@ exclude-result-prefixes="xsl mcri18n mcrurl" > - + diff --git a/mycore-viewer/src/main/resources/components/viewer/config/mycore.properties b/mycore-viewer/src/main/resources/components/viewer/config/mycore.properties index b0ce8827d0..02a06521ab 100644 --- a/mycore-viewer/src/main/resources/components/viewer/config/mycore.properties +++ b/mycore-viewer/src/main/resources/components/viewer/config/mycore.properties @@ -4,7 +4,7 @@ MCR.Viewer.bootstrapURL=//stackpath.bootstrapcdn.com/bootstrap/4.3.1/ MCR.Viewer.FontaweSomeURL=https://use.fontawesome.com/releases/v5.8.1/css/all.css MCR.URIResolver.xslIncludes.components=%MCR.URIResolver.xslIncludes.components%,altoChanges.xsl -MCR.URIResolver.xslIncludes.components-3=%MCR.URIResolver.xslIncludes.components-3%,altoChanges-3.xsl +MCR.URIResolver.xslIncludes.components-3=%MCR.URIResolver.xslIncludes.components-3%,altoChanges.xsl MCR.Viewer.AltoChangeSetStore.Class=org.mycore.viewer.alto.service.impl.MCRJPAAltoChangeSetStore MCR.Viewer.AltoChangeApplier.Class=org.mycore.viewer.alto.service.impl.MCRDefaultAltoChangeApplier diff --git a/mycore-viewer/src/main/resources/xsl/IViewConfig-3.xsl b/mycore-viewer/src/main/resources/xslt/IViewConfig.xsl similarity index 100% rename from mycore-viewer/src/main/resources/xsl/IViewConfig-3.xsl rename to mycore-viewer/src/main/resources/xslt/IViewConfig.xsl diff --git a/mycore-viewer/src/main/resources/xsl/altoChanges-3.xsl b/mycore-viewer/src/main/resources/xslt/altoChanges.xsl similarity index 100% rename from mycore-viewer/src/main/resources/xsl/altoChanges-3.xsl rename to mycore-viewer/src/main/resources/xslt/altoChanges.xsl diff --git a/mycore-wcms2/src/main/resources/xsl/wcms2-3.xsl b/mycore-wcms2/src/main/resources/xslt/wcms2.xsl similarity index 100% rename from mycore-wcms2/src/main/resources/xsl/wcms2-3.xsl rename to mycore-wcms2/src/main/resources/xslt/wcms2.xsl diff --git a/mycore-webtools/src/main/resources/components/webtools/config/mycore.properties b/mycore-webtools/src/main/resources/components/webtools/config/mycore.properties index 8154703ea9..d08b0529b4 100644 --- a/mycore-webtools/src/main/resources/components/webtools/config/mycore.properties +++ b/mycore-webtools/src/main/resources/components/webtools/config/mycore.properties @@ -5,7 +5,7 @@ MCR.Jersey.Resource.Packages=%MCR.Jersey.Resource.Packages%,org.mycore.webtools.session,org.mycore.webtools.upload MCR.URIResolver.xslIncludes.components=%MCR.URIResolver.xslIncludes.components%,sessionListing.xsl,processingGUI.xsl,msie-warning.xsl -MCR.URIResolver.xslIncludes.components-3=%MCR.URIResolver.xslIncludes.components-3%,sessionListing-3.xsl,processingGUI-3.xsl,msie-warning-3.xsl +MCR.URIResolver.xslIncludes.components-3=%MCR.URIResolver.xslIncludes.components-3%,sessionListing.xsl,processingGUI.xsl,msie-warning.xsl # filetypes that will be ignored for mainfile, if there are others MCR.Upload.NotPreferredFiletypeForMainfile=.xml diff --git a/mycore-webtools/src/main/resources/xsl/msie-warning-3.xsl b/mycore-webtools/src/main/resources/xslt/msie-warning.xsl similarity index 97% rename from mycore-webtools/src/main/resources/xsl/msie-warning-3.xsl rename to mycore-webtools/src/main/resources/xslt/msie-warning.xsl index c94ed565da..c9adb4839f 100644 --- a/mycore-webtools/src/main/resources/xsl/msie-warning-3.xsl +++ b/mycore-webtools/src/main/resources/xslt/msie-warning.xsl @@ -2,6 +2,8 @@ + + diff --git a/mycore-webtools/src/main/resources/xsl/processingGUI-3.xsl b/mycore-webtools/src/main/resources/xslt/processingGUI.xsl similarity index 100% rename from mycore-webtools/src/main/resources/xsl/processingGUI-3.xsl rename to mycore-webtools/src/main/resources/xslt/processingGUI.xsl diff --git a/mycore-webtools/src/main/resources/xsl/sessionListing-3.xsl b/mycore-webtools/src/main/resources/xslt/sessionListing.xsl similarity index 100% rename from mycore-webtools/src/main/resources/xsl/sessionListing-3.xsl rename to mycore-webtools/src/main/resources/xslt/sessionListing.xsl diff --git a/mycore-xeditor/src/main/java/org/mycore/frontend/xeditor/MCRPostProcessorXSL.java b/mycore-xeditor/src/main/java/org/mycore/frontend/xeditor/MCRPostProcessorXSL.java index 0f76d6e394..204a1c7d55 100644 --- a/mycore-xeditor/src/main/java/org/mycore/frontend/xeditor/MCRPostProcessorXSL.java +++ b/mycore-xeditor/src/main/java/org/mycore/frontend/xeditor/MCRPostProcessorXSL.java @@ -79,8 +79,10 @@ public Document process(Document xml) throws IOException, JDOMException { .getClass("MCR.LayoutService.TransformerFactoryClass").orElseThrow(); } + final String xslFolder = MCRConfiguration2.getStringOrThrow("MCR.Layout.Transformer.Factory.XSLFolder"); MCRContent source = new MCRJDOMContent(xml); - MCRContent transformed = MCRXSL2XMLTransformer.getInstance(factoryClass, "xsl/" + stylesheet).transform(source); + MCRContent transformed = MCRXSL2XMLTransformer.getInstance(factoryClass, xslFolder + "/" + stylesheet) + .transform(source); MCRContent normalized = new MCRNormalizeUnicodeTransformer().transform(transformed); return normalized.asXML(); } diff --git a/mycore-xeditor/src/main/resources/xsl/xeditor-templates-3.xsl b/mycore-xeditor/src/main/resources/xslt/xeditor-templates.xsl similarity index 100% rename from mycore-xeditor/src/main/resources/xsl/xeditor-templates-3.xsl rename to mycore-xeditor/src/main/resources/xslt/xeditor-templates.xsl From 27999f678bb2f9c27196c48656ba9ec46a1c9eeb Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Wed, 20 Sep 2023 14:12:12 +0200 Subject: [PATCH 11/21] MCR-2966 xslt folder add URI resolver for XEditor XSLs --- .../java/org/mycore/common/xml/MCRURIResolver.java | 14 +++++++++++++- .../authorization/change-current-user.xed | 4 ++-- .../resources/authorization/change-password.xed | 4 ++-- .../resources/authorization/change-read-user.xed | 4 ++-- .../resources/authorization/change-user.xed | 4 ++-- .../resources/authorization/new-read-user.xed | 4 ++-- .../META-INF/resources/authorization/new-user.xed | 4 ++-- 7 files changed, 25 insertions(+), 13 deletions(-) diff --git a/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java b/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java index 354cb51cbf..8c47931d19 100644 --- a/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java +++ b/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java @@ -233,6 +233,7 @@ private HashMap getResolverMapping() { supportedSchemes.put("catchEx", new MCRExceptionAsXMLResolver()); supportedSchemes.put("notnull", new MCRNotNullResolver()); supportedSchemes.put("xslStyle", new MCRXslStyleResolver()); + supportedSchemes.put("xslStyleXEditor", new MCRXslStyleXEDitorResolver()); supportedSchemes.put("xslTransform", new MCRLayoutTransformerResolver()); supportedSchemes.put("xslInclude", new MCRXslIncludeResolver()); supportedSchemes.put("xslImport", new MCRXslImportResolver()); @@ -1220,7 +1221,7 @@ public Source resolve(String href, String base) throws TransformerException { } } - private MCRXSLTransformer getTransformer(String... stylesheet) { + protected MCRXSLTransformer getTransformer(String... stylesheet) { final String xslFolder = MCRConfiguration2.getStringOrThrow("MCR.Layout.Transformer.Factory.XSLFolder"); String[] stylesheets = new String[stylesheet.length]; for (int i = 0; i < stylesheets.length; i++) { @@ -1230,6 +1231,17 @@ private MCRXSLTransformer getTransformer(String... stylesheet) { } } + private static class MCRXslStyleXEDitorResolver extends MCRXslStyleResolver { + @Override + protected MCRXSLTransformer getTransformer(String... stylesheet) { + String[] stylesheets = new String[stylesheet.length]; + for (int i = 0; i < stylesheets.length; i++) { + stylesheets[i] = "xsl/" + stylesheet[i] + ".xsl"; + } + return MCRXSLTransformer.getInstance(stylesheets); + } + } + /** * Transform result of other resolver with stylesheet. Usage: xslTransform:>: diff --git a/mycore-user2/src/main/resources/META-INF/resources/authorization/change-current-user.xed b/mycore-user2/src/main/resources/META-INF/resources/authorization/change-current-user.xed index 4e0bf81abf..f14ca3b755 100644 --- a/mycore-user2/src/main/resources/META-INF/resources/authorization/change-current-user.xed +++ b/mycore-user2/src/main/resources/META-INF/resources/authorization/change-current-user.xed @@ -3,8 +3,8 @@
- - + + diff --git a/mycore-user2/src/main/resources/META-INF/resources/authorization/change-password.xed b/mycore-user2/src/main/resources/META-INF/resources/authorization/change-password.xed index b10fdb7e6b..0e9d2d2f05 100644 --- a/mycore-user2/src/main/resources/META-INF/resources/authorization/change-password.xed +++ b/mycore-user2/src/main/resources/META-INF/resources/authorization/change-password.xed @@ -3,8 +3,8 @@
- - + + diff --git a/mycore-user2/src/main/resources/META-INF/resources/authorization/change-read-user.xed b/mycore-user2/src/main/resources/META-INF/resources/authorization/change-read-user.xed index e0a604dc08..f5c46b3edc 100644 --- a/mycore-user2/src/main/resources/META-INF/resources/authorization/change-read-user.xed +++ b/mycore-user2/src/main/resources/META-INF/resources/authorization/change-read-user.xed @@ -3,8 +3,8 @@
- - + + diff --git a/mycore-user2/src/main/resources/META-INF/resources/authorization/change-user.xed b/mycore-user2/src/main/resources/META-INF/resources/authorization/change-user.xed index 53f13614a2..62ee1af4e2 100644 --- a/mycore-user2/src/main/resources/META-INF/resources/authorization/change-user.xed +++ b/mycore-user2/src/main/resources/META-INF/resources/authorization/change-user.xed @@ -3,8 +3,8 @@
- - + + diff --git a/mycore-user2/src/main/resources/META-INF/resources/authorization/new-read-user.xed b/mycore-user2/src/main/resources/META-INF/resources/authorization/new-read-user.xed index a5e86afb02..e9999e8dd5 100644 --- a/mycore-user2/src/main/resources/META-INF/resources/authorization/new-read-user.xed +++ b/mycore-user2/src/main/resources/META-INF/resources/authorization/new-read-user.xed @@ -3,8 +3,8 @@
- - + + diff --git a/mycore-user2/src/main/resources/META-INF/resources/authorization/new-user.xed b/mycore-user2/src/main/resources/META-INF/resources/authorization/new-user.xed index dddedaee21..77c8488b0b 100644 --- a/mycore-user2/src/main/resources/META-INF/resources/authorization/new-user.xed +++ b/mycore-user2/src/main/resources/META-INF/resources/authorization/new-user.xed @@ -3,8 +3,8 @@
- - + + From c90f88bcc4e7e1940a3a45b36d6a400ebb6034cb Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Wed, 20 Sep 2023 14:13:03 +0200 Subject: [PATCH 12/21] MCR-2966 xslt folder add xsl to xslt folder --- .../src/main/resources/xslt/realms2items.xsl | 24 ++++ .../src/main/resources/xslt/items2options.xsl | 132 ++++++++++++++++++ 2 files changed, 156 insertions(+) create mode 100644 mycore-user2/src/main/resources/xslt/realms2items.xsl create mode 100644 mycore-xeditor/src/main/resources/xslt/items2options.xsl diff --git a/mycore-user2/src/main/resources/xslt/realms2items.xsl b/mycore-user2/src/main/resources/xslt/realms2items.xsl new file mode 100644 index 0000000000..38c8f1330b --- /dev/null +++ b/mycore-user2/src/main/resources/xslt/realms2items.xsl @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mycore-xeditor/src/main/resources/xslt/items2options.xsl b/mycore-xeditor/src/main/resources/xslt/items2options.xsl new file mode 100644 index 0000000000..fcc5e93226 --- /dev/null +++ b/mycore-xeditor/src/main/resources/xslt/items2options.xsl @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 04731461c2466386e18b082c392a91af38702e52 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Thu, 21 Sep 2023 14:45:28 +0200 Subject: [PATCH 13/21] MCR-2966 xslt folder default to xsl3, remove -3 suffixes from configuration --- .../main/resources/config/mycore.properties | 5 +-- .../src/main/resources/xslt/MyCoReWebPage.xsl | 2 +- .../iview2/services/MCRIview2URIResolver.java | 4 ++ .../iview2/config/mycore.properties | 2 - .../src/main/resources/xslt/iview2-solr.xsl | 18 +++++++++ .../components/mods/config/mycore.properties | 3 +- .../xslt/solr/indexing/mods-dynamicfields.xsl | 2 +- .../xslt/solr/indexing/mods-solr.xsl | 2 +- .../components/solr/config/mycore.properties | 39 ++++++------------- .../indexing/mycoreobject-dynamicfields.xsl | 2 +- .../indexing/mycoreobject-solrdocument.xsl | 2 +- .../xslt/solr/indexing/solr-basetemplate.xsl | 2 +- .../xslt/solr/response/response-browse.xsl | 2 +- .../resources/xslt/solr/response/response.xsl | 2 +- 14 files changed, 44 insertions(+), 43 deletions(-) create mode 100644 mycore-iview2/src/main/resources/xslt/iview2-solr.xsl diff --git a/mycore-base/src/main/resources/config/mycore.properties b/mycore-base/src/main/resources/config/mycore.properties index 383f82dab3..0ae2973809 100644 --- a/mycore-base/src/main/resources/config/mycore.properties +++ b/mycore-base/src/main/resources/config/mycore.properties @@ -91,8 +91,8 @@ MCR.BatchEditor.BaseLevel.object=/mycoreobject # Define the LayoutFactory class MCR.Layout.Transformer.Factory=org.mycore.common.xml.MCRLayoutTransformerFactory -# Default folder for XSL files, switch to XSLT for XSLT-3 applications -MCR.Layout.Transformer.Factory.XSLFolder=xsl +# Default folder for XSL files, switch to xsl for XSL1 applications +MCR.Layout.Transformer.Factory.XSLFolder=xslt # The format of the session ID # MCR.Session.Param=;jsessionid= @@ -473,7 +473,6 @@ MCR.Startup.Class=org.mycore.backend.jpa.MCRJPABootstrapper,org.mycore.datamodel MCR.Website.ReadAccessVerification=true MCR.URIResolver.xslIncludes.MyCoReWebPage=classificationBrowser.xsl -MCR.URIResolver.xslIncludes.MyCoReWebPage-3=classificationBrowser.xsl MCR.URIResolver.xslIncludes.functions=functions/acl.xsl,functions/classification.xsl,functions/derivate.xsl,functions/i18n.xsl,functions/mcrversion.xsl,functions/property.xsl,functions/stringutils.xsl,functions/url.xsl,functions/layoututils.xsl ############################################################################## diff --git a/mycore-base/src/main/resources/xslt/MyCoReWebPage.xsl b/mycore-base/src/main/resources/xslt/MyCoReWebPage.xsl index 2771766370..aad5ad7114 100644 --- a/mycore-base/src/main/resources/xslt/MyCoReWebPage.xsl +++ b/mycore-base/src/main/resources/xslt/MyCoReWebPage.xsl @@ -13,7 +13,7 @@ &html-output; - + diff --git a/mycore-iview2/src/main/java/org/mycore/iview2/services/MCRIview2URIResolver.java b/mycore-iview2/src/main/java/org/mycore/iview2/services/MCRIview2URIResolver.java index 7b6ac67277..e67024e359 100644 --- a/mycore-iview2/src/main/java/org/mycore/iview2/services/MCRIview2URIResolver.java +++ b/mycore-iview2/src/main/java/org/mycore/iview2/services/MCRIview2URIResolver.java @@ -21,6 +21,10 @@ public Source resolve(String href, String base) throws TransformerException { boolean completelyTiled = MCRIView2Tools.isCompletelyTiled(params[2]); return new JDOMSource(new Element(String.valueOf(completelyTiled))); } + case "isFileSupported" -> { + final boolean supported = MCRIView2Tools.isFileSupported(params[2]); + return new JDOMSource(new Element(String.valueOf(supported))); + } default -> throw new TransformerException("Invalid href: " + href); } } diff --git a/mycore-iview2/src/main/resources/components/iview2/config/mycore.properties b/mycore-iview2/src/main/resources/components/iview2/config/mycore.properties index f3a883d67b..f3ceb61f56 100644 --- a/mycore-iview2/src/main/resources/components/iview2/config/mycore.properties +++ b/mycore-iview2/src/main/resources/components/iview2/config/mycore.properties @@ -20,9 +20,7 @@ MCR.Module-iview2.MaxResetCount=3 MCR.CLI.Classes.Internal=%MCR.CLI.Classes.Internal%,org.mycore.iview2.frontend.MCRIView2Commands MCR.URIResolver.ModuleResolver.iview2=org.mycore.iview2.services.MCRIview2URIResolver MCR.URIResolver.xslIncludes.components=%MCR.URIResolver.xslIncludes.components%,mcr-module-startIview2.xsl -MCR.URIResolver.xslIncludes.components-3=%MCR.URIResolver.xslIncludes.components-3%,mcr-module-startIview2.xsl MCR.URIResolver.xslIncludes.solrResponse=%MCR.URIResolver.xslIncludes.solrResponse%,iview2-solrresponse.xsl -MCR.URIResolver.xslIncludes.solrResponse-3=%MCR.URIResolver.xslIncludes.solrResponse-3%,iview2-solrresponse.xsl MCR.URIResolver.xslIncludes.functions=%MCR.URIResolver.xslIncludes.functions%,functions/iview2.xsl MCR.Hibernate.Mappings=%MCR.Hibernate.Mappings%,org.mycore.iview2.services.MCRTileJob diff --git a/mycore-iview2/src/main/resources/xslt/iview2-solr.xsl b/mycore-iview2/src/main/resources/xslt/iview2-solr.xsl new file mode 100644 index 0000000000..eaea7afcda --- /dev/null +++ b/mycore-iview2/src/main/resources/xslt/iview2-solr.xsl @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/mycore-mods/src/main/resources/components/mods/config/mycore.properties b/mycore-mods/src/main/resources/components/mods/config/mycore.properties index 255532af2d..f606a217ff 100644 --- a/mycore-mods/src/main/resources/components/mods/config/mycore.properties +++ b/mycore-mods/src/main/resources/components/mods/config/mycore.properties @@ -81,8 +81,7 @@ MCR.URIResolver.xslIncludes.objectTypes=%MCR.URIResolver.xslIncludes.objectTypes MCR.URIResolver.xslIncludes.functions=%MCR.URIResolver.xslIncludes.functions%,functions/mods.xsl MCR.URIResolver.xslIncludes.datacite=mycoreobject-datacite.xsl MCR.URIResolver.xslIncludes.schemaorg= -MCR.URIResolver.xslImports.solr-document=%MCR.URIResolver.xslImports.solr-document%,mods-solr.xsl -MCR.URIResolver.xslImports.solr-document-3=%MCR.URIResolver.xslImports.solr-document-3%,solr/indexing/mods-solr.xsl,solr/indexing/mods-dynamicfields.xsl +MCR.URIResolver.xslImports.solr-document=%MCR.URIResolver.xslImports.solr-document%,solr/indexing/mods-solr.xsl,solr/indexing/mods-dynamicfields.xsl MCR.URIResolver.redirect.editor-mods-external=webapp:editor/editor-mods-external.xml # URIResolver to sort MODS diff --git a/mycore-mods/src/main/resources/xslt/solr/indexing/mods-dynamicfields.xsl b/mycore-mods/src/main/resources/xslt/solr/indexing/mods-dynamicfields.xsl index 5fe0dc2b60..54a713d856 100644 --- a/mycore-mods/src/main/resources/xslt/solr/indexing/mods-dynamicfields.xsl +++ b/mycore-mods/src/main/resources/xslt/solr/indexing/mods-dynamicfields.xsl @@ -6,7 +6,7 @@ xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:mcrmods="http://www.mycore.de/xslt/mods"> - + diff --git a/mycore-mods/src/main/resources/xslt/solr/indexing/mods-solr.xsl b/mycore-mods/src/main/resources/xslt/solr/indexing/mods-solr.xsl index 396426fc96..72cddda0d6 100644 --- a/mycore-mods/src/main/resources/xslt/solr/indexing/mods-solr.xsl +++ b/mycore-mods/src/main/resources/xslt/solr/indexing/mods-solr.xsl @@ -8,7 +8,7 @@ exclude-result-prefixes="xlink mods fn mcrmods"> - + diff --git a/mycore-solr/src/main/resources/components/solr/config/mycore.properties b/mycore-solr/src/main/resources/components/solr/config/mycore.properties index c947bbd3e3..bf97249b04 100644 --- a/mycore-solr/src/main/resources/components/solr/config/mycore.properties +++ b/mycore-solr/src/main/resources/components/solr/config/mycore.properties @@ -8,8 +8,7 @@ MCR.EventHandler.MCRPath.100.Class=org.mycore.solr.index.MCRSolrIndexEventHandle MCR.URIResolver.ModuleResolver.solr=org.mycore.solr.common.xml.MCRSolrQueryResolver -MCR.URIResolver.xslImports.solr-document=solr-basetemplate.xsl -MCR.URIResolver.xslImports.solr-document-3=solr/indexing/solr-basetemplate.xsl +MCR.URIResolver.xslImports.solr-document=solr/indexing/solr-basetemplate.xsl MCR.Module-classbrowser.QueryAdapter=org.mycore.solr.search.MCRSolrQueryAdapter @@ -34,7 +33,7 @@ MCR.Solr.ConcurrentUpdateSolrClient.QueueSize=100 MCR.Solr.ConcurrentUpdateSolrClient.ThreadCount=%MCR.Solr.Indexer.ThreadCount% MCR.Solr.SolrInputDocument.Factory=org.mycore.solr.index.document.MCRSolrTransformerInputDocumentFactory -MCR.Solr.SolrInputDocument.Transformer=mycoreobject-solrdocument-3 +MCR.Solr.SolrInputDocument.Transformer=mycoreobject-solrdocument MCR.Solr.SolrInputDocument.Path.Factory=org.mycore.solr.index.file.MCRSolrPathDocumentFactory @@ -45,35 +44,21 @@ MCR.Solr.IndexHandler.Factory=org.mycore.solr.index.handlers.MCRSolrLazyInputDoc # property only contains the the stylesheet declaration) MCR.URIResolver.xslIncludes.solr-export= -MCR.URIResolver.xslIncludes.components=%MCR.URIResolver.xslIncludes.components%,solr-layout-utils.xsl +# activate for XSL1: MCR.URIResolver.xslIncludes.components=%MCR.URIResolver.xslIncludes.components%,solr-layout-utils.xsl # we do not provide a xslt 3.0 for the solr-layout-utils.xsl in components-3 MCR.ContentTransformer.response.Class=org.mycore.common.content.transformer.MCRXSLTransformer -MCR.ContentTransformer.response.TransformerFactoryClass=org.apache.xalan.processor.TransformerFactoryImpl -MCR.ContentTransformer.response.Stylesheet=%MCR.ContentTransformer.response-prepared.Stylesheet%,xsl/response.xsl +MCR.ContentTransformer.response.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl +MCR.ContentTransformer.response.Stylesheet=%MCR.ContentTransformer.response-prepared.Stylesheet%,xslt/solr/response/response.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.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl +MCR.ContentTransformer.mycoreobject-solrdocument.Stylesheet=xslt/solr/indexing/mycoreobject-solrdocument.xsl MCR.ContentTransformer.mycoreobject-solrdocument.Context=org.mycore.solr.index.document.jaxb -MCR.ContentTransformer.mycoreobject-solrdocument-3.Class=org.mycore.common.content.transformer.MCRXSL2JAXBTransformer -MCR.ContentTransformer.mycoreobject-solrdocument-3.Stylesheet=xslt/solr/indexing/mycoreobject-solrdocument.xsl -MCR.ContentTransformer.mycoreobject-solrdocument-3.Context=org.mycore.solr.index.document.jaxb -MCR.ContentTransformer.mycoreobject-solrdocument-3.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl - -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-3.Class=org.mycore.common.content.transformer.MCRXSLTransformer -MCR.ContentTransformer.response-prepared-3.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl -MCR.ContentTransformer.response-prepared-3.Stylesheet=xslt/solr/response/response-join-results.xsl,xslt/solr/response/response-addDocId.xsl,xslt/solr/response/response-addDerivates.xsl - 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.ContentTransformer.response-prepared.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl +MCR.ContentTransformer.response-prepared.Stylesheet=xslt/solr/response/response-join-results.xsl,xslt/solr/response/response-addDocId.xsl,xslt/solr/response/response-addDerivates.xsl MCR.Solr.FileIndexStrategy=org.mycore.solr.index.strategy.MCRSolrMimeTypeStrategy MCR.Solr.MimeTypeStrategy.Pattern=image/.* @@ -88,10 +73,8 @@ MCR.Solr.TikaFields=stream_size,stream_name,stream_source_info,stream_content_ty MCR.Solr.JoinQueryFields=%MCR.Solr.ContentBaseFields%,%MCR.Solr.AVExtenderFields%,%MCR.Solr.TikaFields% MCR.CLI.Classes.Internal=%MCR.CLI.Classes.Internal%,org.mycore.solr.commands.MCRSolrCommands -MCR.URIResolver.xslImports.solr-document=%MCR.URIResolver.xslImports.solr-document%,mycoreobject-dynamicfields.xsl -MCR.URIResolver.xslImports.solr-document-3=%MCR.URIResolver.xslImports.solr-document-3%,solr/indexing/mycoreobject-dynamicfields.xsl -MCR.URIResolver.xslIncludes.xeditorTemplates=%MCR.URIResolver.xslIncludes.xeditorTemplates%,solr-xeditor-templates.xsl -MCR.URIResolver.xslIncludes.xeditorTemplates-3=%MCR.URIResolver.xslIncludes.xeditorTemplates-3%,solr/xeditor/solr-xeditor-templates.xsl +MCR.URIResolver.xslImports.solr-document=%MCR.URIResolver.xslImports.solr-document%,solr/indexing/mycoreobject-dynamicfields.xsl +MCR.URIResolver.xslIncludes.xeditorTemplates=%MCR.URIResolver.xslIncludes.xeditorTemplates%,solr/xeditor/solr-xeditor-templates.xsl # MCR.Module-solr.Classification.Core=classification diff --git a/mycore-solr/src/main/resources/xslt/solr/indexing/mycoreobject-dynamicfields.xsl b/mycore-solr/src/main/resources/xslt/solr/indexing/mycoreobject-dynamicfields.xsl index 234cae7d45..374145da18 100644 --- a/mycore-solr/src/main/resources/xslt/solr/indexing/mycoreobject-dynamicfields.xsl +++ b/mycore-solr/src/main/resources/xslt/solr/indexing/mycoreobject-dynamicfields.xsl @@ -5,7 +5,7 @@ xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:mcrsolr="http://www.mycore.de/xslt/solr"> - + diff --git a/mycore-solr/src/main/resources/xslt/solr/indexing/mycoreobject-solrdocument.xsl b/mycore-solr/src/main/resources/xslt/solr/indexing/mycoreobject-solrdocument.xsl index 790bcd4cfc..d3c2ddb5e6 100644 --- a/mycore-solr/src/main/resources/xslt/solr/indexing/mycoreobject-solrdocument.xsl +++ b/mycore-solr/src/main/resources/xslt/solr/indexing/mycoreobject-solrdocument.xsl @@ -2,7 +2,7 @@ - + diff --git a/mycore-solr/src/main/resources/xslt/solr/indexing/solr-basetemplate.xsl b/mycore-solr/src/main/resources/xslt/solr/indexing/solr-basetemplate.xsl index 535453b82b..1a6097215a 100644 --- a/mycore-solr/src/main/resources/xslt/solr/indexing/solr-basetemplate.xsl +++ b/mycore-solr/src/main/resources/xslt/solr/indexing/solr-basetemplate.xsl @@ -6,7 +6,7 @@ xmlns:fn="http://www.w3.org/2005/xpath-functions"> - + diff --git a/mycore-solr/src/main/resources/xslt/solr/response/response-browse.xsl b/mycore-solr/src/main/resources/xslt/solr/response/response-browse.xsl index 20965e769a..19cebd9602 100644 --- a/mycore-solr/src/main/resources/xslt/solr/response/response-browse.xsl +++ b/mycore-solr/src/main/resources/xslt/solr/response/response-browse.xsl @@ -8,7 +8,7 @@ &html-output; - + diff --git a/mycore-solr/src/main/resources/xslt/solr/response/response.xsl b/mycore-solr/src/main/resources/xslt/solr/response/response.xsl index 7bf1a0a37e..ce03b24bda 100644 --- a/mycore-solr/src/main/resources/xslt/solr/response/response.xsl +++ b/mycore-solr/src/main/resources/xslt/solr/response/response.xsl @@ -8,7 +8,7 @@ &html-output; - + From 9fc32c58d0c89f25af4a16f1af2ca230b9d942cd Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Thu, 21 Sep 2023 15:28:28 +0200 Subject: [PATCH 14/21] MCR-2966 xslt folder fix class name for XEditor URI resolver --- .../src/main/java/org/mycore/common/xml/MCRURIResolver.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java b/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java index 8c47931d19..ee5cc71d80 100644 --- a/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java +++ b/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java @@ -233,7 +233,7 @@ private HashMap getResolverMapping() { supportedSchemes.put("catchEx", new MCRExceptionAsXMLResolver()); supportedSchemes.put("notnull", new MCRNotNullResolver()); supportedSchemes.put("xslStyle", new MCRXslStyleResolver()); - supportedSchemes.put("xslStyleXEditor", new MCRXslStyleXEDitorResolver()); + supportedSchemes.put("xslStyleXEditor", new MCRXslStyleXEditorResolver()); supportedSchemes.put("xslTransform", new MCRLayoutTransformerResolver()); supportedSchemes.put("xslInclude", new MCRXslIncludeResolver()); supportedSchemes.put("xslImport", new MCRXslImportResolver()); @@ -1231,7 +1231,7 @@ protected MCRXSLTransformer getTransformer(String... stylesheet) { } } - private static class MCRXslStyleXEDitorResolver extends MCRXslStyleResolver { + private static class MCRXslStyleXEditorResolver extends MCRXslStyleResolver { @Override protected MCRXSLTransformer getTransformer(String... stylesheet) { String[] stylesheets = new String[stylesheet.length]; From 1560f3efaef44c581677ea8b8e59bbbd02320688 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Tue, 26 Sep 2023 09:18:46 +0200 Subject: [PATCH 15/21] MCR-2966 xslt folder use folder from configuration, use full resource statement for xeditor XSL --- .../main/java/org/mycore/common/MCRMailer.java | 3 ++- .../org/mycore/common/xsl/MCRXSLInfoServlet.java | 15 +++++++++------ .../org/mycore/frontend/cli/MCRCommandUtils.java | 6 ++++-- .../components/xeditor/config/mycore.properties | 2 +- mycore-xeditor/src/main/resources/xsl/xeditor.xsl | 2 +- .../src/test/resources/mycore.properties | 3 ++- 6 files changed, 19 insertions(+), 12 deletions(-) diff --git a/mycore-base/src/main/java/org/mycore/common/MCRMailer.java b/mycore-base/src/main/java/org/mycore/common/MCRMailer.java index a9f6bba571..ad3395ab4e 100644 --- a/mycore-base/src/main/java/org/mycore/common/MCRMailer.java +++ b/mycore-base/src/main/java/org/mycore/common/MCRMailer.java @@ -516,7 +516,8 @@ public static Element sendMail(Document input, String stylesheet) throws Excepti private static Document transform(Document input, String stylesheet, Map parameters) throws Exception { MCRJDOMContent source = new MCRJDOMContent(input); - MCRXSL2XMLTransformer transformer = MCRXSL2XMLTransformer.getInstance("xsl/" + stylesheet + ".xsl"); + final String xslFolder = MCRConfiguration2.getStringOrThrow("MCR.Layout.Transformer.Factory.XSLFolder"); + MCRXSL2XMLTransformer transformer = MCRXSL2XMLTransformer.getInstance(xslFolder + "/" + stylesheet + ".xsl"); MCRParameterCollector parameterCollector = MCRParameterCollector.getInstanceFromUserSession(); parameterCollector.setParameters(parameters); MCRContent result = transformer.transform(source, parameterCollector); diff --git a/mycore-base/src/main/java/org/mycore/common/xsl/MCRXSLInfoServlet.java b/mycore-base/src/main/java/org/mycore/common/xsl/MCRXSLInfoServlet.java index 99180a7c3e..1f4072f6e5 100644 --- a/mycore-base/src/main/java/org/mycore/common/xsl/MCRXSLInfoServlet.java +++ b/mycore-base/src/main/java/org/mycore/common/xsl/MCRXSLInfoServlet.java @@ -48,6 +48,7 @@ import org.jdom2.filter.Filters; import org.jdom2.util.IteratorIterable; import org.mycore.common.MCRConstants; +import org.mycore.common.config.MCRConfiguration2; import org.mycore.common.config.MCRConfigurationDir; import org.mycore.common.content.MCRJDOMContent; import org.mycore.common.xml.MCRURIResolver; @@ -57,8 +58,8 @@ /** * Lists all *.xsl stylesheets in the web application located in any - * WEB-INF/lib/*.jar or WEB-INF/classes/xsl/ or in {@link MCRConfigurationDir}, outputs the - * dependencies (import/include) and contained templates. + * WEB-INF/lib/*.jar or WEB-INF/classes/[MCR.Layout.Transformer.Factory.XSLFolder]/ or in {@link MCRConfigurationDir}, + * outputs the dependencies (import/include) and contained templates. * * @author Frank Lützenkirchen */ @@ -69,6 +70,8 @@ public final class MCRXSLInfoServlet extends MCRServlet { private final Map stylesheets = new HashMap<>(); private final Set unknown = new HashSet<>(); + private final String xslFolder = + MCRConfiguration2.getStringOrThrow("MCR.Layout.Transformer.Factory.XSLFolder") + "/"; protected void doGetPost(MCRServletJob job) throws Exception { if ("true".equals(job.getRequest().getParameter("reload"))) { @@ -202,7 +205,7 @@ private void findInJarInputStream(String pathOfJarFile, InputStream in) throws I for (ZipEntry ze = zis.getNextEntry(); ze != null; ze = zis.getNextEntry()) { String name = ze.getName(); - if (name.startsWith("xsl/") && name.endsWith(".xsl")) { + if (name.startsWith(xslFolder) && name.endsWith(".xsl")) { foundStylesheet(name, pathOfJarFile); } zis.closeEntry(); @@ -211,7 +214,7 @@ private void findInJarInputStream(String pathOfJarFile, InputStream in) throws I } private void findXSLinClassesDir() { - String base = "/WEB-INF/classes/xsl/"; + String base = "/WEB-INF/classes/" + xslFolder; for (String path : diveInto(base)) { if (path.endsWith(".xsl")) { foundStylesheet(path, base); @@ -220,7 +223,7 @@ private void findXSLinClassesDir() { } private void foundStylesheet(String path, String source) { - String file = path.substring(path.lastIndexOf("xsl/") + 4); + String file = path.substring(path.lastIndexOf(xslFolder) + 4); LOGGER.info("Found {} in {}", file, source); Stylesheet stylesheet = getStylesheet(file); if (source.startsWith("/WEB-INF/")) { @@ -260,7 +263,7 @@ void inspect() { } private void resolveXSL() { - String uri = "resource:xsl/" + name; + String uri = "resource:" + xslFolder + name; resolveXSL(uri); if (xsl == null) { resolveXSL(name); diff --git a/mycore-base/src/main/java/org/mycore/frontend/cli/MCRCommandUtils.java b/mycore-base/src/main/java/org/mycore/frontend/cli/MCRCommandUtils.java index c68ccc0660..97316e16f1 100644 --- a/mycore-base/src/main/java/org/mycore/frontend/cli/MCRCommandUtils.java +++ b/mycore-base/src/main/java/org/mycore/frontend/cli/MCRCommandUtils.java @@ -30,6 +30,7 @@ import org.jdom2.Element; import org.jdom2.transform.JDOMSource; import org.mycore.common.MCRUsageException; +import org.mycore.common.config.MCRConfiguration2; import org.mycore.common.xml.MCRURIResolver; import org.mycore.datamodel.common.MCRXMLMetadataManager; import org.mycore.datamodel.metadata.MCRMetadataManager; @@ -167,7 +168,7 @@ public static Stream getIdsFromIdToId(final String startId, final String * the name of the style to be used when resolving the stylesheet. * @param defaultStyle * the name of the default style, ending with .xsl to be used when resolving the stylesheet. - * A corresponding file xsl/defaultStyle must exist. + * A corresponding file [MCR.Layout.Transformer.Factory.XSLFolder]/defaultStyle must exist. * @param cache * The transformer cache to be used. * @return the transformer @@ -185,7 +186,8 @@ public static Transformer getTransformer(String style, String defaultStyle, Map< Element element = MCRURIResolver.instance().resolve("resource:" + xslFilePath); if (element == null) { LOGGER.warn("Couldn't find resource {} for style {}, using default.", xslFilePath, style); - xslFilePath = "xsl/" + defaultStyle; + final String xslFolder = MCRConfiguration2.getStringOrThrow("MCR.Layout.Transformer.Factory.XSLFolder"); + xslFilePath = xslFolder + "/" + defaultStyle; element = MCRURIResolver.instance().resolve("resource:" + xslFilePath); } diff --git a/mycore-xeditor/src/main/resources/components/xeditor/config/mycore.properties b/mycore-xeditor/src/main/resources/components/xeditor/config/mycore.properties index 14e22d809b..8656045ad2 100644 --- a/mycore-xeditor/src/main/resources/components/xeditor/config/mycore.properties +++ b/mycore-xeditor/src/main/resources/components/xeditor/config/mycore.properties @@ -37,7 +37,7 @@ MCR.XEditor.Target.ajaxsubselect.Class=org.mycore.frontend.xeditor.target.MCRAja MCR.XEditor.InsertTarget.DefaultMethod=build # Include file defining layout of custom repeater controls (up/down, insert, append, remove) -MCR.URIResolver.xslIncludes.xeditor=xeditor-custom.xsl +MCR.URIResolver.xslIncludes.xeditor=resource:xsl/xeditor-custom.xsl # Transformer to use for transformation from XEditor definition to HTML MCR.ContentTransformer.xeditor.Class=org.mycore.common.content.transformer.MCRXSL2XMLTransformer diff --git a/mycore-xeditor/src/main/resources/xsl/xeditor.xsl b/mycore-xeditor/src/main/resources/xsl/xeditor.xsl index 5f869732c8..d06e175126 100644 --- a/mycore-xeditor/src/main/resources/xsl/xeditor.xsl +++ b/mycore-xeditor/src/main/resources/xsl/xeditor.xsl @@ -8,7 +8,7 @@ - + diff --git a/mycore-xeditor/src/test/resources/mycore.properties b/mycore-xeditor/src/test/resources/mycore.properties index 559c670ecb..3ccabea1df 100644 --- a/mycore-xeditor/src/test/resources/mycore.properties +++ b/mycore-xeditor/src/test/resources/mycore.properties @@ -2,7 +2,8 @@ # Configuration properties for MyCoRe XEditor component # ############################################################################## -MCR.URIResolver.xslIncludes.xeditor=xeditor-custom.xsl +MCR.Layout.Transformer.Factory.XSLFolder=xsl +MCR.URIResolver.xslIncludes.xeditor=resource:xsl/xeditor-custom.xsl MCR.ContentTransformer.xeditor.Class=org.mycore.common.content.transformer.MCRXSL2XMLTransformer MCR.ContentTransformer.xeditor.Stylesheet=xsl/xeditor.xsl From 6c9772377c7f0416f41b782c0bd0eeb9b651480c Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Tue, 26 Sep 2023 17:28:54 +0200 Subject: [PATCH 16/21] MCR-2966 xslt folder process new xslImport mechanism --- .../org/mycore/common/xml/MCRURIResolver.java | 27 +++++++++++++-- .../mycore/common/xml/MCRXMLFunctions.java | 17 +++++++++- .../mycore/common/xml/MCRURIResolverTest.java | 34 ++++++++++++++++++- .../common/xml/MCRXMLFunctionsTest.java | 17 ++++++++++ .../test/resources/xsl/functions/xsl-1.xsl | 5 +++ .../test/resources/xsl/functions/xsl-2.xsl | 5 +++ .../test/resources/xslt/functions/xsl-1.xsl | 5 +++ .../test/resources/xslt/functions/xsl-2.xsl | 5 +++ .../xeditor/MCRXEditorTransformerTest.java | 11 ++++++ 9 files changed, 122 insertions(+), 4 deletions(-) create mode 100644 mycore-base/src/test/resources/xsl/functions/xsl-1.xsl create mode 100644 mycore-base/src/test/resources/xsl/functions/xsl-2.xsl create mode 100644 mycore-base/src/test/resources/xslt/functions/xsl-1.xsl create mode 100644 mycore-base/src/test/resources/xslt/functions/xsl-2.xsl diff --git a/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java b/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java index ee5cc71d80..1c3c2da732 100644 --- a/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java +++ b/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java @@ -57,6 +57,7 @@ import javax.xml.transform.stream.StreamSource; import javax.xml.xpath.XPathExpressionException; +import org.apache.commons.lang3.StringUtils; import org.apache.http.client.cache.HttpCacheContext; import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.CloseableHttpResponse; @@ -1375,7 +1376,30 @@ private static class MCRXslImportResolver implements URIResolver { @Override public Source resolve(String href, String base) throws TransformerException { - String importXSL = MCRXMLFunctions.nextImportStep(href.substring(href.indexOf(':') + 1)); + final String baseURI = getParentDirectoryResourceURI(base); + // set xslt folder + final String xslFolder; + if (StringUtils.contains(baseURI, "/xsl/")) { + xslFolder = "xsl"; + } else { + xslFolder = "xslt"; + } + + // check for old import format: xslImport:property:current.xsl and issue a warning + final String importXSL; + final String importPart = StringUtils.substringAfter(href, ":"); + if (StringUtils.contains(importPart, ":")) { + final String propertyPart = StringUtils.substringBefore(importPart, ":"); + LOGGER.warn("{} is in old import format change to xslImport:{}!", href, propertyPart); + + importXSL = MCRXMLFunctions.nextImportStep(importPart); + } else { + final String selfName = StringUtils.substringAfter(baseURI, xslFolder + "/") + + StringUtils.substringAfterLast(base, "/"); + + importXSL = MCRXMLFunctions.nextImportStep(importPart, selfName); + } + if (importXSL.isEmpty()) { LOGGER.debug("End of import queue: {}", href); Namespace xslNamespace = Namespace.getNamespace("xsl", "http://www.w3.org/1999/XSL/Transform"); @@ -1385,7 +1409,6 @@ public Source resolve(String href, String base) throws TransformerException { } LOGGER.debug("xslImport importing {}", importXSL); - final String xslFolder = MCRConfiguration2.getStringOrThrow("MCR.Layout.Transformer.Factory.XSLFolder"); return fallback.resolve("resource:" + xslFolder + "/" + importXSL, base); } } diff --git a/mycore-base/src/main/java/org/mycore/common/xml/MCRXMLFunctions.java b/mycore-base/src/main/java/org/mycore/common/xml/MCRXMLFunctions.java index 31ba727d26..44a6914270 100644 --- a/mycore-base/src/main/java/org/mycore/common/xml/MCRXMLFunctions.java +++ b/mycore-base/src/main/java/org/mycore/common/xml/MCRXMLFunctions.java @@ -750,9 +750,21 @@ public static String nextImportStep(String includePart) { selfName = includePart.substring(border + 1); includePart = includePart.substring(0, border); } + return nextImportStep(includePart, selfName); + } + + /** + * Helper function for xslImport URI resolver and {@link #hasNextImportStep(String)} + * + * @param includePart substring after xslImport: + * @param selfName name of the current stylesheet + * @return the next stylesheet name to import + */ + public static String nextImportStep(String includePart, String selfName) { if (LOGGER.isDebugEnabled()) { - LOGGER.debug("get next import step for {}", includePart); + LOGGER.debug("get next import step for {}:{}", includePart, selfName); } + // get the parameters from mycore.properties List importList = MCRConfiguration2.getString("MCR.URIResolver.xslImports." + includePart) .map(MCRConfiguration2::splitValue) @@ -766,6 +778,9 @@ public static String nextImportStep(String includePart) { if (selfName == null && listIterator.hasPrevious()) { return listIterator.previous(); } + if (!importList.contains(selfName) && listIterator.hasPrevious()) { + return listIterator.previous(); + } while (listIterator.hasPrevious()) { String currentStylesheet = listIterator.previous(); diff --git a/mycore-base/src/test/java/org/mycore/common/xml/MCRURIResolverTest.java b/mycore-base/src/test/java/org/mycore/common/xml/MCRURIResolverTest.java index 059fd0d771..d3a4e7c87a 100644 --- a/mycore-base/src/test/java/org/mycore/common/xml/MCRURIResolverTest.java +++ b/mycore-base/src/test/java/org/mycore/common/xml/MCRURIResolverTest.java @@ -1,13 +1,17 @@ package org.mycore.common.xml; +import org.apache.commons.lang3.StringUtils; import org.junit.Assert; import org.junit.Test; +import org.mycore.common.MCRTestCase; +import org.mycore.common.config.MCRConfiguration2; import org.mycore.common.config.MCRConfigurationDir; +import javax.xml.transform.Source; import java.util.LinkedHashMap; import java.util.Map; -public class MCRURIResolverTest { +public class MCRURIResolverTest extends MCRTestCase { @Test public void testGetParentDirectoryResourceURI() { @@ -36,4 +40,32 @@ public void testGetParentDirectoryResourceURI() { Assert.assertEquals(entry.getValue(), result); } } + + @Test + public void testImportFromSameDirectory() throws Exception { + MCRConfiguration2.set("MCR.URIResolver.xslImports.xsl-import", "functions/xsl-1.xsl,functions/xsl-2.xsl"); + + Source resolved = MCRURIResolver.instance() + .resolve("xslImport:xsl-import:functions/xsl-2.xsl", "file:/tmp/xsl/functions/xsl-2.xsl"); + Assert.assertNotNull(resolved); + Assert.assertTrue(StringUtils.endsWith(resolved.getSystemId(), "/xsl/functions/xsl-1.xsl")); + + resolved = MCRURIResolver.instance() + .resolve("xslImport:xsl-import:functions/xsl-2.xsl", "file:/tmp/xslt/functions/xsl-2.xsl"); + Assert.assertNotNull(resolved); + Assert.assertTrue(StringUtils.endsWith(resolved.getSystemId(), "/xslt/functions/xsl-1.xsl")); + + // check with new import layout + resolved = MCRURIResolver.instance() + .resolve("xslImport:xsl-import", "file:/tmp/xslt/functions/xsl-2.xsl"); + Assert.assertNotNull(resolved); + Assert.assertTrue(StringUtils.endsWith(resolved.getSystemId(), "/xslt/functions/xsl-1.xsl")); + + // check with new import layout for calling xsl + resolved = MCRURIResolver.instance() + .resolve("xslImport:xsl-import", "file:/tmp/xslt/functions/xsl-parent.xsl"); + Assert.assertNotNull(resolved); + Assert.assertTrue(StringUtils.endsWith(resolved.getSystemId(), "/xslt/functions/xsl-2.xsl")); + + } } diff --git a/mycore-base/src/test/java/org/mycore/common/xml/MCRXMLFunctionsTest.java b/mycore-base/src/test/java/org/mycore/common/xml/MCRXMLFunctionsTest.java index 4d48073db0..67c46bf124 100644 --- a/mycore-base/src/test/java/org/mycore/common/xml/MCRXMLFunctionsTest.java +++ b/mycore-base/src/test/java/org/mycore/common/xml/MCRXMLFunctionsTest.java @@ -29,6 +29,7 @@ import org.junit.Test; import org.mycore.common.MCRTestCase; +import org.mycore.common.config.MCRConfiguration2; public class MCRXMLFunctionsTest extends MCRTestCase { @@ -173,4 +174,20 @@ public void toNCNameSecondPart() { } } + @Test + public void testNextImportStep() { + MCRConfiguration2.set("MCR.URIResolver.xslImports.xsl-import", "functions/xsl-1.xsl,functions/xsl-2.xsl"); + + // test with old include part + String next = MCRXMLFunctions.nextImportStep("xsl-import:functions/xsl-2.xsl"); + assertEquals("functions/xsl-1.xsl", next); + + // test with new include part + next = MCRXMLFunctions.nextImportStep("xsl-import", "functions/xsl-2.xsl"); + assertEquals("functions/xsl-1.xsl", next); + + // test with new include part and self name not in list (i.e. using base template) + next = MCRXMLFunctions.nextImportStep("xsl-import", "xsl-parent.xsl"); + assertEquals("functions/xsl-2.xsl", next); + } } diff --git a/mycore-base/src/test/resources/xsl/functions/xsl-1.xsl b/mycore-base/src/test/resources/xsl/functions/xsl-1.xsl new file mode 100644 index 0000000000..8ed11ac45d --- /dev/null +++ b/mycore-base/src/test/resources/xsl/functions/xsl-1.xsl @@ -0,0 +1,5 @@ + + + + + diff --git a/mycore-base/src/test/resources/xsl/functions/xsl-2.xsl b/mycore-base/src/test/resources/xsl/functions/xsl-2.xsl new file mode 100644 index 0000000000..91361b71b5 --- /dev/null +++ b/mycore-base/src/test/resources/xsl/functions/xsl-2.xsl @@ -0,0 +1,5 @@ + + + + + diff --git a/mycore-base/src/test/resources/xslt/functions/xsl-1.xsl b/mycore-base/src/test/resources/xslt/functions/xsl-1.xsl new file mode 100644 index 0000000000..8ed11ac45d --- /dev/null +++ b/mycore-base/src/test/resources/xslt/functions/xsl-1.xsl @@ -0,0 +1,5 @@ + + + + + diff --git a/mycore-base/src/test/resources/xslt/functions/xsl-2.xsl b/mycore-base/src/test/resources/xslt/functions/xsl-2.xsl new file mode 100644 index 0000000000..91361b71b5 --- /dev/null +++ b/mycore-base/src/test/resources/xslt/functions/xsl-2.xsl @@ -0,0 +1,5 @@ + + + + + diff --git a/mycore-xeditor/src/test/java/org/mycore/frontend/xeditor/MCRXEditorTransformerTest.java b/mycore-xeditor/src/test/java/org/mycore/frontend/xeditor/MCRXEditorTransformerTest.java index c91b5c7c93..61771a358a 100644 --- a/mycore-xeditor/src/test/java/org/mycore/frontend/xeditor/MCRXEditorTransformerTest.java +++ b/mycore-xeditor/src/test/java/org/mycore/frontend/xeditor/MCRXEditorTransformerTest.java @@ -24,6 +24,7 @@ import java.io.IOException; import java.util.HashMap; +import java.util.Map; import javax.xml.transform.TransformerException; @@ -190,4 +191,14 @@ public void testSelect() throws IOException, TransformerException, JDOMException SAXException, JaxenException { testTransformation("testSelect-editor.xml", "testSelect-source.xml", "testSelect-transformed.xml"); } + + @Override + protected Map getTestProperties() { + final Map properties = super.getTestProperties(); + + properties.put("MCR.URIResolver.CachingResolver.Capacity", "100"); + properties.put("MCR.URIResolver.CachingResolver.MaxAge", "3600000"); + + return properties; + } } From d579af3509a50fd8178a4729bed5ca3d1588a087 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Thu, 28 Sep 2023 15:20:37 +0200 Subject: [PATCH 17/21] MCR-2966 xslt folder use startsWith for evaluating folder, fallback via configuration; reverse xmlfunctions:nextImportStep --- .../org/mycore/common/xml/MCRURIResolver.java | 20 ++++--------------- .../mycore/common/xml/MCRXMLFunctions.java | 17 +--------------- .../common/xml/MCRXMLFunctionsTest.java | 16 +++++++-------- 3 files changed, 13 insertions(+), 40 deletions(-) diff --git a/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java b/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java index 1c3c2da732..af865d3e20 100644 --- a/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java +++ b/mycore-base/src/main/java/org/mycore/common/xml/MCRURIResolver.java @@ -1379,27 +1379,15 @@ public Source resolve(String href, String base) throws TransformerException { final String baseURI = getParentDirectoryResourceURI(base); // set xslt folder final String xslFolder; - if (StringUtils.contains(baseURI, "/xsl/")) { + if (StringUtils.startsWith(baseURI, "resource:xsl/")) { xslFolder = "xsl"; - } else { + } else if (StringUtils.startsWith(baseURI, "resource:xslt/")) { xslFolder = "xslt"; - } - - // check for old import format: xslImport:property:current.xsl and issue a warning - final String importXSL; - final String importPart = StringUtils.substringAfter(href, ":"); - if (StringUtils.contains(importPart, ":")) { - final String propertyPart = StringUtils.substringBefore(importPart, ":"); - LOGGER.warn("{} is in old import format change to xslImport:{}!", href, propertyPart); - - importXSL = MCRXMLFunctions.nextImportStep(importPart); } else { - final String selfName = StringUtils.substringAfter(baseURI, xslFolder + "/") - + StringUtils.substringAfterLast(base, "/"); - - importXSL = MCRXMLFunctions.nextImportStep(importPart, selfName); + xslFolder = MCRConfiguration2.getStringOrThrow("MCR.Layout.Transformer.Factory.XSLFolder"); } + String importXSL = MCRXMLFunctions.nextImportStep(href.substring(href.indexOf(':') + 1)); if (importXSL.isEmpty()) { LOGGER.debug("End of import queue: {}", href); Namespace xslNamespace = Namespace.getNamespace("xsl", "http://www.w3.org/1999/XSL/Transform"); diff --git a/mycore-base/src/main/java/org/mycore/common/xml/MCRXMLFunctions.java b/mycore-base/src/main/java/org/mycore/common/xml/MCRXMLFunctions.java index 44a6914270..31ba727d26 100644 --- a/mycore-base/src/main/java/org/mycore/common/xml/MCRXMLFunctions.java +++ b/mycore-base/src/main/java/org/mycore/common/xml/MCRXMLFunctions.java @@ -750,21 +750,9 @@ public static String nextImportStep(String includePart) { selfName = includePart.substring(border + 1); includePart = includePart.substring(0, border); } - return nextImportStep(includePart, selfName); - } - - /** - * Helper function for xslImport URI resolver and {@link #hasNextImportStep(String)} - * - * @param includePart substring after xslImport: - * @param selfName name of the current stylesheet - * @return the next stylesheet name to import - */ - public static String nextImportStep(String includePart, String selfName) { if (LOGGER.isDebugEnabled()) { - LOGGER.debug("get next import step for {}:{}", includePart, selfName); + LOGGER.debug("get next import step for {}", includePart); } - // get the parameters from mycore.properties List importList = MCRConfiguration2.getString("MCR.URIResolver.xslImports." + includePart) .map(MCRConfiguration2::splitValue) @@ -778,9 +766,6 @@ public static String nextImportStep(String includePart, String selfName) { if (selfName == null && listIterator.hasPrevious()) { return listIterator.previous(); } - if (!importList.contains(selfName) && listIterator.hasPrevious()) { - return listIterator.previous(); - } while (listIterator.hasPrevious()) { String currentStylesheet = listIterator.previous(); diff --git a/mycore-base/src/test/java/org/mycore/common/xml/MCRXMLFunctionsTest.java b/mycore-base/src/test/java/org/mycore/common/xml/MCRXMLFunctionsTest.java index 67c46bf124..c742fd385b 100644 --- a/mycore-base/src/test/java/org/mycore/common/xml/MCRXMLFunctionsTest.java +++ b/mycore-base/src/test/java/org/mycore/common/xml/MCRXMLFunctionsTest.java @@ -178,16 +178,16 @@ public void toNCNameSecondPart() { public void testNextImportStep() { MCRConfiguration2.set("MCR.URIResolver.xslImports.xsl-import", "functions/xsl-1.xsl,functions/xsl-2.xsl"); - // test with old include part - String next = MCRXMLFunctions.nextImportStep("xsl-import:functions/xsl-2.xsl"); - assertEquals("functions/xsl-1.xsl", next); + // test with first stylesheet in chain + String next = MCRXMLFunctions.nextImportStep("xsl-import"); + assertEquals("functions/xsl-2.xsl", next); - // test with new include part - next = MCRXMLFunctions.nextImportStep("xsl-import", "functions/xsl-2.xsl"); + // test with include part + next = MCRXMLFunctions.nextImportStep("xsl-import:functions/xsl-2.xsl"); assertEquals("functions/xsl-1.xsl", next); - // test with new include part and self name not in list (i.e. using base template) - next = MCRXMLFunctions.nextImportStep("xsl-import", "xsl-parent.xsl"); - assertEquals("functions/xsl-2.xsl", next); + // test with last stylesheet in chain + next = MCRXMLFunctions.nextImportStep("xsl-import:functions/xsl-1.xsl"); + assertEquals("", next); } } From c05e7c415af6fd54357fae69862a84599b5d24c4 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Thu, 28 Sep 2023 15:53:25 +0200 Subject: [PATCH 18/21] MCR-2966 xslt folder remove test for new xslimport mechanism --- .../mycore/common/xml/MCRURIResolverTest.java | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/mycore-base/src/test/java/org/mycore/common/xml/MCRURIResolverTest.java b/mycore-base/src/test/java/org/mycore/common/xml/MCRURIResolverTest.java index d3a4e7c87a..ea3bf1873c 100644 --- a/mycore-base/src/test/java/org/mycore/common/xml/MCRURIResolverTest.java +++ b/mycore-base/src/test/java/org/mycore/common/xml/MCRURIResolverTest.java @@ -46,26 +46,13 @@ public void testImportFromSameDirectory() throws Exception { MCRConfiguration2.set("MCR.URIResolver.xslImports.xsl-import", "functions/xsl-1.xsl,functions/xsl-2.xsl"); Source resolved = MCRURIResolver.instance() - .resolve("xslImport:xsl-import:functions/xsl-2.xsl", "file:/tmp/xsl/functions/xsl-2.xsl"); + .resolve("xslImport:xsl-import:functions/xsl-2.xsl", "some.jar!/xsl/xsl/functions/xsl-2.xsl"); Assert.assertNotNull(resolved); Assert.assertTrue(StringUtils.endsWith(resolved.getSystemId(), "/xsl/functions/xsl-1.xsl")); resolved = MCRURIResolver.instance() - .resolve("xslImport:xsl-import:functions/xsl-2.xsl", "file:/tmp/xslt/functions/xsl-2.xsl"); + .resolve("xslImport:xsl-import:functions/xsl-2.xsl", "some.jar!/xslt/functions/xsl-2.xsl"); Assert.assertNotNull(resolved); Assert.assertTrue(StringUtils.endsWith(resolved.getSystemId(), "/xslt/functions/xsl-1.xsl")); - - // check with new import layout - resolved = MCRURIResolver.instance() - .resolve("xslImport:xsl-import", "file:/tmp/xslt/functions/xsl-2.xsl"); - Assert.assertNotNull(resolved); - Assert.assertTrue(StringUtils.endsWith(resolved.getSystemId(), "/xslt/functions/xsl-1.xsl")); - - // check with new import layout for calling xsl - resolved = MCRURIResolver.instance() - .resolve("xslImport:xsl-import", "file:/tmp/xslt/functions/xsl-parent.xsl"); - Assert.assertNotNull(resolved); - Assert.assertTrue(StringUtils.endsWith(resolved.getSystemId(), "/xslt/functions/xsl-2.xsl")); - } } From 42b4babe60f0b5d41191f926f8deba246ce0c7d3 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Mon, 9 Oct 2023 10:13:27 +0200 Subject: [PATCH 19/21] MCR-2966 xslt folder fix code style --- .../src/test/java/org/mycore/common/xml/MCRURIResolverTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/mycore-base/src/test/java/org/mycore/common/xml/MCRURIResolverTest.java b/mycore-base/src/test/java/org/mycore/common/xml/MCRURIResolverTest.java index febcabf705..da6f3132ed 100644 --- a/mycore-base/src/test/java/org/mycore/common/xml/MCRURIResolverTest.java +++ b/mycore-base/src/test/java/org/mycore/common/xml/MCRURIResolverTest.java @@ -4,7 +4,6 @@ import org.junit.Assert; import org.junit.Test; import org.mycore.common.MCRTestCase; -import org.mycore.common.MCRTestCase; import org.mycore.common.config.MCRConfiguration2; import org.mycore.common.config.MCRConfigurationDir; From 9127faf269df2dd613dd0a7fe2bb9795ffe3b454 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Fri, 13 Oct 2023 11:03:11 +0200 Subject: [PATCH 20/21] MCR-2966 xslt folder add response-browse content transformer for XSLT3 --- .../src/main/resources/components/solr/config/mycore.properties | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mycore-solr/src/main/resources/components/solr/config/mycore.properties b/mycore-solr/src/main/resources/components/solr/config/mycore.properties index bf97249b04..f51b210fbc 100644 --- a/mycore-solr/src/main/resources/components/solr/config/mycore.properties +++ b/mycore-solr/src/main/resources/components/solr/config/mycore.properties @@ -51,6 +51,8 @@ MCR.ContentTransformer.response.Class=org.mycore.common.content.transformer.MCRX MCR.ContentTransformer.response.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl MCR.ContentTransformer.response.Stylesheet=%MCR.ContentTransformer.response-prepared.Stylesheet%,xslt/solr/response/response.xsl +MCR.ContentTransformer.response-browse.Stylesheet=xslt/solr/response/response-browse.xsl + MCR.ContentTransformer.mycoreobject-solrdocument.Class=org.mycore.common.content.transformer.MCRXSL2JAXBTransformer MCR.ContentTransformer.mycoreobject-solrdocument.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl MCR.ContentTransformer.mycoreobject-solrdocument.Stylesheet=xslt/solr/indexing/mycoreobject-solrdocument.xsl From fb8c4456159fd3297ff6ead4e081e5dbd6552e79 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Wed, 18 Oct 2023 11:20:29 +0200 Subject: [PATCH 21/21] MCR-2966 xslt folder remove duplicate parameter from msie-warnings.xsl --- mycore-webtools/src/main/resources/xslt/msie-warning.xsl | 2 -- 1 file changed, 2 deletions(-) diff --git a/mycore-webtools/src/main/resources/xslt/msie-warning.xsl b/mycore-webtools/src/main/resources/xslt/msie-warning.xsl index c9adb4839f..c94ed565da 100644 --- a/mycore-webtools/src/main/resources/xslt/msie-warning.xsl +++ b/mycore-webtools/src/main/resources/xslt/msie-warning.xsl @@ -2,8 +2,6 @@ - -