Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions mir-module/src/main/resources/config/mir/mycore.properties
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ MCR.Migration.ChildrenOrder.Strategy=org.mycore.migration.strategy.MCRNeverAddCh

#mir-module migration to Saxon
MCR.URIResolver.xslIncludes.components=resource:xsl/mcr-module-startIview2.xsl,resource:xsl/sessionListing.xsl,resource:xsl/altoChanges.xsl
MCR.ContentTransformer.mcr_error.Class=org.mycore.common.content.transformer.MCRTransformerPipe
MCR.ContentTransformer.mcr_error.Steps=tmp_mcr_error_xsl,tmp_xsl_mir_flatmir_layout
MCR.ContentTransformer.tmp_mcr_error_xsl.TransformerFactoryClass=%XALAN%
MCR.ContentTransformer.tmp_mcr_error_xsl.Stylesheet=xsl/mcr_error.xsl

MCR.ContentTransformer.site.Class=org.mycore.common.content.transformer.MCRTransformerPipe
MCR.ContentTransformer.site.Steps=tmp_site,tmp_xsl_mir_flatmir_layout
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:mcri18n="xalan://org.mycore.services.i18n.MCRTranslation"
<xsl:stylesheet version="3.0"
xmlns:mcri18n="http://www.mycore.de/xslt/i18n"
xmlns:mirstrutils="http://www.mycore.de/xslt/mirstrutils"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="mcri18n">
exclude-result-prefixes="#all">

<xsl:import href="resource:xsl/layout/mir-layout-utils.xsl" />
<xsl:include href="resource:xslt/layout/mir-layout-utils.xsl" />
<xsl:include href="resource:xslt/MyCoReLayout.xsl" />

<xsl:variable name="Type" select="'document'" />

<xsl:variable name="PageTitle" select="mcri18n:translate('titles.pageTitle.error',concat(' ',/mcr_error/@HttpError))" />
<xsl:variable
name="PageTitle"
select="mcri18n:translate-with-params('titles.pageTitle.error', concat(' ', /mcr_error/@HttpError))" />

<xsl:template match="/mcr_error">
<div class="jumbotron text-center">
<h1>
<xsl:value-of select="mcri18n:translate('mir.error.headline',/mcr_error/@HttpError)" />
<xsl:value-of select="mcri18n:translate-with-params('mir.error.headline', @HttpError)" />
</h1>
<h2>
<xsl:value-of select="mcri18n:translate('mir.error.subheadline')" />
</h2>
<p class="lead">
<xsl:value-of disable-output-escaping="yes"
select="mcri18n:translate(concat('mir.error.codes.',/mcr_error/@HttpError),/mcr_error/@requestURI)" />
<xsl:copy-of
select="
parse-xml-fragment(
mcri18n:translate-with-params(
concat('mir.error.codes.', @HttpError),
mirstrutils:escape-xml(string(@requestURI))
)
)/node()" />
</p>
<xsl:choose>
<xsl:when test="@errorServlet and string-length(text()) &gt; 1 or exception">
<xsl:if test="@errorServlet and string-length(text()) &gt; 1">
<xsl:when test="(@errorServlet and string-length(text()) gt 1) or exception">
<xsl:if test="@errorServlet and string-length(text()) gt 1">
<div class="alert alert-info" role="alert">
<xsl:attribute name="title">
<xsl:value-of select="mcri18n:translate('mir.error.message')" />
Expand All @@ -39,7 +48,7 @@
<div class="card-header bg-danger">
<xsl:value-of select="concat(mcri18n:translate('error.stackTrace'),' :')" />
</div>
<div class="card-body">
<div class="card-body text-start">
<xsl:for-each select="exception/trace">
<pre style="font-size:0.8em;">
<xsl:value-of select="." />
Expand All @@ -65,9 +74,18 @@
</div>
</xsl:template>

<xsl:template match="/mcr_error[contains('401|403', @HttpError)]">
<xsl:template match="/mcr_error[@HttpError = ('401', '403')]">
<xsl:call-template name="mir.printNotLoggedIn" />
</xsl:template>

<xsl:include href="resource:xsl/MyCoReLayout.xsl" />
<xsl:template name="lf2br">
<xsl:param name="string" as="xs:string" />

<xsl:for-each select="tokenize($string, '\r?\n')">
<xsl:value-of select="." />
<xsl:if test="position() ne last()">
<br />
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Loading