Skip to content

[DBT-386] fix rc and dependencies #289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: 2024.06.x
Choose a base branch
from
Open
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
3 changes: 1 addition & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
<maven.compiler.release>${java.target.version}</maven.compiler.release>
<media.projectBase>${project.build.directory}/media</media.projectBase>
<mir.version>2024.06.1-SNAPSHOT</mir.version>
<node.version>v16.19.1</node.version>
<npm.version>6.14.18</npm.version>
<npm.version>10.9.2</npm.version>
<rcclient.projectBase>${project.build.directory}/rcclient</rcclient.projectBase>
<template.assetsdir>${template.targetdir}/dbt/assets</template.assetsdir>
<template.cssdir>${template.targetdir}/dbt/css</template.cssdir>
Expand Down
7 changes: 4 additions & 3 deletions src/main/grunt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
},
"devDependencies": {
"@fortawesome/fontawesome-free": "5.13.1",
"grunt": ">=1.3.0",
"grunt-cli": "^1.2.0",
"grunt": ">=1.6.1",
"grunt-cli": "^1.5.0",
"grunt-contrib-concat": "^1.0.0",
"grunt-replace": "^1.0.0",
"grunt-contrib-copy": "^1.0.0",
Expand All @@ -27,8 +27,9 @@
"angular-modal-service": "~0.15.2",
"bootstrap": "4.6.2",
"bootstrap-fileinput": "~5.1.1",
"imagemin-gifsicle": "~7.0.0",
"node-waves": "~0.7.6",
"summernote": "~0.8.11",
"summernote": "~0.9.1",
"jquery-sortable": "~0.9.12",
"video.js": "7.21.5",
"videojs-share": "^3.2.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private static Optional<String> getDefaultMainFile(MCRDerivate derivate) {
Files.walkFileTree(path, visitor);

//sort files by name
ArrayList<java.nio.file.Path> paths = visitor.getPaths();
List<java.nio.file.Path> paths = visitor.getPaths();
paths.sort(Comparator.comparing(java.nio.file.Path::getNameCount)
.thenComparing(java.nio.file.Path::getFileName));
//extract first file, before filtering
Expand Down
11 changes: 10 additions & 1 deletion src/main/java/de/urmel_dl/dbt/rc/persistency/SlotManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.SolrQuery.SortClause;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.request.QueryRequest;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.SolrDocumentList;
import org.jdom2.JDOMException;
Expand All @@ -60,6 +61,8 @@
import org.mycore.mir.authorization.accesskeys.backend.MIRAccessKeyPair;
import org.mycore.solr.MCRSolrCoreManager;
import org.mycore.solr.MCRSolrUtils;
import org.mycore.solr.auth.MCRSolrAuthenticationLevel;
import org.mycore.solr.auth.MCRSolrAuthenticationManager;
import org.mycore.user2.MCRUser;
import org.mycore.user2.MCRUserAttribute;
import org.mycore.user2.MCRUserAttribute_;
Expand Down Expand Up @@ -598,7 +601,12 @@ public SlotList getFilteredSlotList(final String search, final String filter, In
query.setStart(start);
query.setRows(rows);

final QueryResponse response = client.query(query);
QueryRequest request = new QueryRequest(query);

MCRSolrAuthenticationManager authManager = MCRSolrAuthenticationManager.getInstance();
authManager.applyAuthentication(request, MCRSolrAuthenticationLevel.SEARCH);

final QueryResponse response = request.process(client);

SolrDocumentList results = response.getResults();

Expand All @@ -611,4 +619,5 @@ public SlotList getFilteredSlotList(final String search, final String filter, In
return slotList;
}


}
4 changes: 2 additions & 2 deletions src/main/media/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"css-loader": "^6.7.3",
"extract-loader": "^5.0.1",
"mini-css-extract-plugin": "^2.7.2",
"node-sass": "^9.0.0",
"sass-loader": "^13.2.0",
"sass": "^1.85.1",
"sass-loader": "^16.0.5",
"svgo": "^1.3.2",
"svgo-loader": "^2.2.2",
"terser-webpack-plugin": "^5.3.6",
Expand Down
25 changes: 10 additions & 15 deletions src/main/rcclient/package.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
{
"private": true,

"name" : "IBWRCClient",
"version" : "2.0.0",
"author" : "René Adler (eagle)",
"homepage" : "${project.url}",

"src" : "${basedir}/src/main/rcclient",

"name": "IBWRCClient",
"version": "2.0.0",
"author": "René Adler (eagle)",
"homepage": "${project.url}",
"src": "${basedir}/src/main/rcclient",
"repository": {
"type": "svn",
"url": "${project.scm.url}"
"type": "svn",
"url": "${project.scm.url}"
},

"license": "GPL-3.0",

"engines": {
"engines": {
"node": ">= 0.8.11"
},

"devDependencies": {
"grunt": ">=1.3.0",
"grunt": "~0.4.1",
"grunt-cli": "~1.3.2",
"grunt-contrib-clean": "~2.0.0",
"grunt-contrib-compress": "~1.5.0",
Expand All @@ -34,4 +28,5 @@
"grunt-typescript": "~0.8.0",
"crypto-js": "~3.1.8"
}

}
6 changes: 2 additions & 4 deletions src/main/resources/xsl/layout/dbt-layout.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
<xsl:template name="layout.head">
<nav class="navbar navbar-expand-md navbar-light navbar-dbt fixed-top" role="navigation">
<div class="container">
<a class="navbar-brand" href="{concat($WebApplicationBaseURL,substring($loaded_navigation_xml/@hrefStartingPage,2),$HttpSession)}">
<a class="navbar-brand" href="{concat($WebApplicationBaseURL,substring($loaded_navigation_xml/@hrefStartingPage,2))}">
<span class="img-placeholder"></span>
</a>
<button type="button" class="navbar-toggler collapsed plus-sign" data-toggle="collapse" data-target="#navbar,#container-overlay"
Expand Down Expand Up @@ -410,7 +410,7 @@
</li>
<li class="dropdown-divider" />
<li class="dropdown-item">
<a href="{$ServletsBaseURL}MCRBasketServlet{$HttpSession}?type={$basket/@type}&amp;action=show">
<a href="{$ServletsBaseURL}MCRBasketServlet?type={$basket/@type}&amp;action=show">
<xsl:value-of select="i18n:translate('basket.open')" />
</a>
</li>
Expand All @@ -426,8 +426,6 @@
<xsl:with-param name="navigation" select="$loaded_navigation_xml" />
</xsl:call-template>

<!-- include Internet Explorer warning -->
<xsl:call-template name="msie-note" />

<!-- <xsl:call-template name="action.buttons" /> -->
<xsl:call-template name="print.writeProtectionMessage" />
Expand Down
4 changes: 1 addition & 3 deletions src/main/resources/xsl/layout/dbt-navigation.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@
<xsl:value-of select="@href" />
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="UrlAddSession">
<xsl:with-param name="url" select="concat($WebApplicationBaseURL,substring-after(@href,'/'))" />
</xsl:call-template>
<xsl:value-of select="concat($WebApplicationBaseURL,substring-after(@href,'/'))" />
</xsl:otherwise>
</xsl:choose>
</xsl:param>
Expand Down
210 changes: 108 additions & 102 deletions src/main/resources/xsl/mcr_error.xsl
Original file line number Diff line number Diff line change
@@ -1,111 +1,117 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:i18n="xalan://org.mycore.services.i18n.MCRTranslation" xmlns:mcrxsl="xalan://org.mycore.common.xml.MCRXMLFunctions"
xmlns:encoder="xalan://java.net.URLEncoder" exclude-result-prefixes="i18n xlink mcrxsl encoder"
>
<xsl:variable name="Type" select="'document'" />
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:encoder="xalan://java.net.URLEncoder"
xmlns:i18n="xalan://org.mycore.services.i18n.MCRTranslation" exclude-result-prefixes="i18n encoder">
<xsl:import href="layout/mir-layout-utils.xsl"/>

<xsl:variable name="PageTitle" select="i18n:translate('titles.pageTitle.error',concat(' ',/mcr_error/@HttpError))" />
<xsl:variable name="Type" select="'document'"/>

<xsl:template match="/mcr_error">
<div class="card border-bottom-0">
<div class="card-body p-5">
<div class="text-center">
<h1 class="text-danger">
<xsl:value-of select="i18n:translate('mir.error.headline',/mcr_error/@HttpError)" />
</h1>
<h2 class="text-danger">
<xsl:value-of select="i18n:translate('mir.error.subheadline')" />
</h2>
<p class="lead mb-0">
<xsl:value-of disable-output-escaping="yes"
select="i18n:translate(concat('mir.error.codes.',/mcr_error/@HttpError),/mcr_error/@requestURI)" />
</p>
</div>
</div>
</div>
<div class="card">
<h5 class="card-header" id="error">
<a href="#" class="d-flex flex-row justify-content-between align-items-center" data-toggle="collapse" data-target="#error-details"
aria-expanded="false" aria-controls="error-details"
>
<xsl:value-of select="i18n:translate('error.stackTrace')" />
</a>
</h5>
<div id="error-details" class="collapse" aria-labelledby="error">
<div class="card-body">
<xsl:choose>
<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-warning my-2" role="alert">
<xsl:attribute name="title">
<xsl:value-of select="i18n:translate('mir.error.message')" />
</xsl:attribute>
<xsl:call-template name="lf2br">
<xsl:with-param name="string" select="text()" />
</xsl:call-template>
</div>
</xsl:if>

<xsl:if test="exception">
<xsl:for-each select="exception/trace">
<pre class="bg-dark text-light p-1 rounded">
<code>
<xsl:value-of select="." />
</code>
</pre>
</xsl:for-each>
</xsl:if>
</xsl:when>
<xsl:variable name="PageTitle" select="i18n:translate('titles.pageTitle.error',concat(' ',/mcr_error/@HttpError))"/>

<xsl:otherwise>
<p class="text-center">
<xsl:value-of select="i18n:translate('error.noInfo')" />
</p>
</xsl:otherwise>
</xsl:choose>
<xsl:template match="/mcr_error">
<div class="card border-bottom-0">
<div class="card-body p-5">
<div class="text-center">
<h1 class="text-danger">
<xsl:value-of select="i18n:translate('mir.error.headline',/mcr_error/@HttpError)"/>
</h1>
<h2 class="text-danger">
<xsl:value-of select="i18n:translate('mir.error.subheadline')"/>
</h2>
<p class="lead mb-0">
<xsl:value-of disable-output-escaping="yes"
select="i18n:translate(concat('mir.error.codes.',/mcr_error/@HttpError),/mcr_error/@requestURI)"/>
</p>
</div>
</div>
</div>
</div>
</div>
</xsl:template>

<xsl:template match="/mcr_error[contains('401|403', @HttpError)]">
<div class="alert alert-warning">
<h1>
<xsl:value-of select="i18n:translate(concat('mir.error.headline.', @HttpError))" />
</h1>
<p>
<xsl:choose>
<xsl:when test=" mcrxsl:isCurrentUserGuestUser()">
<xsl:value-of disable-output-escaping="yes" select="i18n:translate(concat('mir.error.codes.', @HttpError), @requestURI)" />
<xsl:text>&#160;</xsl:text>
<a href="{concat( $ServletsBaseURL, 'MCRLoginServlet', $HttpSession,'?url=', encoder:encode(string($RequestURL)))}">
<xsl:value-of select="i18n:translate('component.user2.button.login')" />
</a>
</xsl:when>
<xsl:when test="contains(@requestURI, '/receive/')">
<xsl:variable name="objectId" select="substring-after(@requestURI,'/receive/')" />
<xsl:variable name="accKP" select="document(concat('accesskeys:', $objectId))" />
<xsl:variable name="hasAccKP" select="count($accKP/accesskeys[@readkey|@writekey]) &gt; 0" />

<xsl:choose>
<xsl:when test="$hasAccKP">
<xsl:value-of disable-output-escaping="yes" select="i18n:translate('mir.error.accessKeyRequired', $objectId)" />
<xsl:text>&#160;</xsl:text>
<a
href="{concat($WebApplicationBaseURL, 'authorization/accesskey.xed', '?objId=', $objectId, '&amp;url=', encoder:encode(string($RequestURL)))}"
<div class="card">
<h5 class="card-header" id="error">
<a href="#" class="d-flex flex-row justify-content-between align-items-center"
data-toggle="collapse" data-target="#error-details"
aria-expanded="false" aria-controls="error-details"
>
<xsl:value-of select="i18n:translate('mir.accesskey.setOnUser')" />
<xsl:value-of select="i18n:translate('error.stackTrace')"/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of disable-output-escaping="yes" select="i18n:translate('mir.error.blocked')" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</p>
</div>
</xsl:template>
</h5>
<div id="error-details" class="collapse" aria-labelledby="error">
<div class="card-body">
<xsl:choose>
<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-warning my-2" role="alert">
<xsl:attribute name="title">
<xsl:value-of select="i18n:translate('mir.error.message')"/>
</xsl:attribute>
<xsl:call-template name="lf2br">
<xsl:with-param name="string" select="text()"/>
</xsl:call-template>
</div>
</xsl:if>

<xsl:include href="MyCoReLayout.xsl" />
<xsl:if test="exception">
<xsl:for-each select="exception/trace">
<pre class="bg-dark text-light p-1 rounded">
<code>
<xsl:value-of select="."/>
</code>
</pre>
</xsl:for-each>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<p class="text-center">
<xsl:value-of select="i18n:translate('error.noInfo')"/>
</p>
</xsl:otherwise>
</xsl:choose>
</div>
</div>
</div>

</xsl:template>

<xsl:template match="/mcr_error[contains('401|403', @HttpError)]">
<xsl:param name="isUserGuest" select="document('userobjectrights:isCurrentUserGuestUser:')/boolean"/>
<div class="alert alert-warning">
<h1>
<xsl:value-of select="i18n:translate(concat('mir.error.headline.', @HttpError))"/>
</h1>
<p>
<xsl:choose>
<xsl:when test="$isUserGuest='true'">
<xsl:value-of disable-output-escaping="yes"
select="i18n:translate(concat('mir.error.codes.', @HttpError), @requestURI)"/>
<xsl:text>&#160;</xsl:text>
<a href="{concat($ServletsBaseURL, 'MCRLoginServlet?url=', encoder:encode(string($RequestURL)))}">
<xsl:value-of select="i18n:translate('component.user2.button.login')"/>
</a>
</xsl:when>
<xsl:when test="contains(@requestURI, '/receive/')">
<xsl:variable name="objectId" select="substring-after(@requestURI,'/receive/')"/>
<xsl:variable name="accKP" select="document(concat('accesskeys:', $objectId))"/>
<xsl:variable name="hasAccKP" select="count($accKP/accesskeys[@readkey|@writekey]) &gt; 0"/>
<xsl:choose>
<xsl:when test="$hasAccKP">
<xsl:value-of disable-output-escaping="yes"
select="i18n:translate('mir.error.accessKeyRequired', $objectId)"/>
<xsl:text>&#160;</xsl:text>
<a
href="{concat($WebApplicationBaseURL, 'authorization/accesskey.xed', '?objId=', $objectId, '&amp;url=', encoder:encode(string($RequestURL)))}"
>
<xsl:value-of select="i18n:translate('mir.accesskey.setOnUser')"/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of disable-output-escaping="yes"
select="i18n:translate('mir.error.blocked')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</p>
</div>
</xsl:template>
<xsl:include href="MyCoReLayout.xsl"/>
</xsl:stylesheet>
Loading
Loading