Skip to content
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

merge 2023.06.x #1062

Merged
merged 19 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
dd49423
Bump jsoup from 1.15.2 to 1.15.3
dependabot[bot] Jul 2, 2024
82b9c67
MIR-1339 Obtain ORCID from lobid in xEditor name search (#1034)
Possommi Jul 30, 2024
a093c06
MIR-1337 fix property to control display of real name (#1032)
toKrause Jul 31, 2024
9299a9c
MIR-1338 fixed missing url encoding in solr query (#1033)
golsch Jul 31, 2024
847b1b1
Bump select2 from 4.0.6-rc.1 to 4.0.6 in /mir-module
dependabot[bot] Jul 2, 2024
aa31095
MIR-1344 update JavaScript dependencies
yagee-de Aug 12, 2024
6d192e4
MIR-1343 Do not render mir-admindata-box staticly (#1040)
Possommi Aug 29, 2024
0684999
MIR-1336 Display realname of creator/modifier in mir-admin-box (#1031)
Possommi Aug 30, 2024
6dc975d
Bump webpack in /mir-webapp/src/main/vue/name-search (#1051)
dependabot[bot] Aug 30, 2024
f417cdd
Bump micromatch in /mir-webapp/src/main/vue/editor-tools (#1050)
dependabot[bot] Aug 30, 2024
4cc374e
Bump express in /mir-webapp/src/main/vue/name-search (#994)
dependabot[bot] Aug 30, 2024
b11abe3
Bump express in /mir-webapp/src/main/vue/editor-tools (#993)
dependabot[bot] Aug 30, 2024
5607544
Bump webpack-dev-middleware in /mir-webapp/src/main/vue/name-search (…
dependabot[bot] Aug 30, 2024
2cad4bd
Bump follow-redirects in /mir-webapp/src/main/vue/editor-tools (#982)
dependabot[bot] Aug 30, 2024
9490181
Bump follow-redirects in /mir-webapp/src/main/vue/name-search (#981)
dependabot[bot] Aug 30, 2024
e93f639
MIR-1348 Provide realm of user in link to profile
Possommi Aug 30, 2024
43e20ed
MIR-1349 include ID correctly
toKrause Sep 2, 2024
e643167
MIR-1346 Allow to add custom meta elements in mir-flatmir-layout.xsl
Possommi Aug 27, 2024
b058416
MIR-1347-allow to change the number of entries per page of the filebo…
sebhofmann Aug 30, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ protected void assertEqualsIgnoreCase(String message, String expected, String ac
}

public void assertUserCreated(String user) {
driver.waitFor(ExpectedConditions.titleContains("Nutzerdaten anzeigen:" + user));
driver.waitFor(ExpectedConditions.titleContains("Nutzerdaten anzeigen: " + user));
}

public void assertValidationErrorVisible() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<!-- Overwrite stylesheet and template in your application module to add custom meta elements -->
<xsl:template name="mir-flatmir-layout-meta-tags"/>
</xsl:stylesheet>
5 changes: 3 additions & 2 deletions mir-layout/src/main/resources/xsl/mir-flatmir-layout.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
xmlns:i18n="xalan://org.mycore.services.i18n.MCRTranslation"
exclude-result-prefixes="xlink i18n">

<xsl:output method="html" indent="yes" omit-xml-declaration="yes" media-type="text/html"
version="5" />
<xsl:output method="html" indent="yes" omit-xml-declaration="yes" media-type="text/html" version="5" />
<xsl:strip-space elements="*" />
<xsl:include href="resource:xsl/mir-flatmir-layout-utils.xsl"/>
<xsl:include href="resource:xsl/mir-flatmir-layout-meta-tags.xsl"/>
<xsl:param name="MIR.DefaultLayout.CSS" />
<xsl:param name="MIR.CustomLayout.CSS" select="''" />
<xsl:param name="MIR.CustomLayout.JS" select="''" />
Expand All @@ -25,6 +25,7 @@
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<xsl:call-template name="mir-flatmir-layout-meta-tags"/>
<title>
<xsl:value-of select="$PageTitle" />
</title>
Expand Down
382 changes: 243 additions & 139 deletions mir-layout/yarn.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions mir-module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"bootstrap-datepicker": "1.9.0",
"grunt": "^1.5.3",
"grunt-cli": "^1.2.0",
"grunt-contrib-uglify": "https://github.com/gruntjs/grunt-contrib-uglify.git#harmony",
"grunt-contrib-uglify": "^5.2.2",
"grunt-npmcopy": "^0.1.0",
"handlebars": "4.5.3",
"jquery.dotdotdot": "1.7.4",
Expand All @@ -28,14 +28,14 @@
"myclabs.jquery.confirm": "2.7.0",
"openlayers": "4.6.4",
"popper.js": "^1.14.7",
"select2": "4.0.6-rc.1",
"select2": "^4.0.13",
"typeahead.js": "0.11.1",
"video.js": "7.14.3"
},
"dependencies": {
"ckeditor-notification": "^4.11.2",
"ckeditor-wordcount-plugin": "^1.17.12",
"ckeditor4": "^4.18.0",
"ckeditor4": "~4.22.0",
"vue": "3.2.13",
"vue3-openlayers": "^1.0.0"
}
Expand Down
4 changes: 4 additions & 0 deletions mir-module/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@
<groupId>org.mycore</groupId>
<artifactId>mycore-classifications</artifactId>
</dependency>
<dependency>
<groupId>org.mycore</groupId>
<artifactId>mycore-jobqueue</artifactId>
</dependency>
<dependency>
<groupId>org.mycore</groupId>
<artifactId>mycore-mods</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package org.mycore.mir.migration;

import jakarta.persistence.EntityManager;
import jakarta.persistence.criteria.CriteriaBuilder;
import jakarta.persistence.criteria.CriteriaQuery;
import jakarta.persistence.criteria.Predicate;
import jakarta.persistence.criteria.Root;
import jakarta.servlet.ServletContext;
import org.mycore.backend.jpa.MCREntityManagerProvider;
import org.mycore.common.events.MCRStartupHandler.AutoExecutable;
import org.mycore.services.queuedjob.MCRJob;
import org.mycore.services.queuedjob.MCRJobQueue;
import org.mycore.services.queuedjob.MCRJobQueueManager;
import org.mycore.services.queuedjob.MCRJobStatus;
import org.mycore.services.queuedjob.MCRJob_;
import org.mycore.util.concurrent.MCRTransactionableRunnable;

import java.util.ArrayList;
import java.util.List;

/**
* Class creates {@link MCRJob} in {@link MCRJobQueue} that migrates all static history content.
*
* @author shermann (Silvio Hermann)
* */
public class MIRMigrateStaticHistoryContent implements AutoExecutable {

@Override
public String getName() {
return MIRMigrateStaticHistoryContent.class.getName();
}

@Override
public int getPriority() {
return Integer.MIN_VALUE;
}

@Override
public void startUp(ServletContext servletContext) {
MCRTransactionableRunnable runnable = new MCRTransactionableRunnable(() -> {
if (!alreadyDone()) {
MCRJobQueueManager
.getInstance()
.getJobQueue(MIRMigrateStaticHistoryContentJobAction.class)
.offer(new MCRJob(MIRMigrateStaticHistoryContentJobAction.class));
}
});
new Thread(runnable).start();
}

private boolean alreadyDone() {
EntityManager manager = MCREntityManagerProvider.getCurrentEntityManager();
CriteriaBuilder builder = manager.getCriteriaBuilder();
CriteriaQuery<MCRJob> criteria = builder.createQuery(MCRJob.class);
Root<MCRJob> root = criteria.from(MCRJob.class);

List<Predicate> predicates = new ArrayList<Predicate>();
predicates.add(builder.equal(root.get(MCRJob_.action), MIRMigrateStaticHistoryContentJobAction.class));
predicates.add(builder.equal(root.get(MCRJob_.status), MCRJobStatus.FINISHED));

criteria.where(predicates.toArray(new Predicate[] {}));
List<MCRJob> resultList = manager.createQuery(criteria).getResultList();

return resultList.size() > 0;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
package org.mycore.mir.migration;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jdom2.Document;
import org.jdom2.input.SAXBuilder;
import org.mycore.common.config.MCRConfiguration2;
import org.mycore.datamodel.metadata.MCRMetadataManager;
import org.mycore.datamodel.metadata.MCRObjectID;
import org.mycore.services.queuedjob.MCRJob;
import org.mycore.services.queuedjob.MCRJobAction;
import org.mycore.services.queuedjob.staticcontent.MCRJobStaticContentGenerator;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.concurrent.ExecutionException;

/**
* Class converts all static history content on start up automatically.
*
* @author shermann (Silvio Hermann)
* */
public class MIRMigrateStaticHistoryContentJobAction extends MCRJobAction {
private Path staticHistoryPath;
private Logger logger;

public MIRMigrateStaticHistoryContentJobAction(MCRJob job) {
super(job);
logger = LogManager.getLogger(MIRMigrateStaticHistoryContentJobAction.class);

staticHistoryPath = Path.of(
MCRConfiguration2.getStringOrThrow("MCR.Object.Static.Content.Default.Path") + File.separator
+ "mir-history");
}

@Override
public void execute() throws ExecutionException {
try {
SAXBuilder builder = new SAXBuilder();
Files.walkFileTree(staticHistoryPath, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
String filename = file.getFileName().toString();
String id = filename.substring(0, filename.lastIndexOf('.'));

if (!MCRObjectID.isValid(id)) {
return FileVisitResult.CONTINUE;
}

try (InputStream is = Files.newInputStream(file)) {
Document history = builder.build(is);
if ("table".equals(history.getRootElement().getName())) {
logger.info("Migrating static history for object {}", id);
MCRJobStaticContentGenerator generator = new MCRJobStaticContentGenerator(
"mir-history");
generator.generate(MCRMetadataManager.retrieveMCRObject(MCRObjectID.getInstance(id)));
}
} catch (Exception e) {
logger.error("Could not migrate static mcr-history for file {}", file.getFileName(), e);
}
return FileVisitResult.CONTINUE;
}
});
} catch (IOException e) {
logger.error("Error occurred during migration of static history content", e);
}
}

@Override
public boolean isActivated() {
return true;
}

@Override
public String name() {
return MIRMigrateStaticHistoryContent.class.getName();
}

@Override
public void rollback() {
//not implemented
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
CKEDITOR.editorConfig = function( config ) {

config.versionCheck = false;

config.extraPlugins = 'notification,wordcount';

config.toolbar = JSON.parse(window["MIR.WebConfig.Editor.CKEditor.Toolbar"] || "{}");
Expand All @@ -24,4 +26,4 @@ CKEDITOR.editorConfig = function( config ) {
pasteWarningDuration: window["MIR.WebConfig.Editor.CKEditor.Wordcount.PasteWarningDuration"] || 0
};

};
};
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ mir.editor.subject.provider.variantName = Namensvarianten
mir.editor.subject.provider.website = Webseite
mir.editor.subject.provider.gndLink = GND-Link
mir.editor.subject.provider.place.biographicalOrHistoricalInformation = Biographische oder historische Informationen

mir.metaData.detailBox.by = von

mir.subject.bagde.gnd = GND
mir.subject.bagde.lcsh = LCSH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ mir.editor.subject.provider.variantName = Variant Name
mir.editor.subject.provider.website = Website
mir.editor.subject.provider.gndLink = GND Link
mir.editor.subject.provider.place.biographicalOrHistoricalInformation = Biographical or Historical Information

mir.metaData.detailBox.by = by
img.alt.search.complex = complex search
img.alt.search.simple = simple search

Expand Down
10 changes: 7 additions & 3 deletions mir-module/src/main/resources/config/mir/mycore.properties
Original file line number Diff line number Diff line change
Expand Up @@ -723,12 +723,9 @@ MCR.URIResolver.xslImports.modsmeta=%MCR.URIResolver.xslImports.modsmeta%,toc/my
# Static content #
##############################################################################
MCR.ContentTransformer.mir-history.Stylesheet=xsl/metadata/static/mir-history-static.xsl
MCR.ContentTransformer.mir-admindata-box.Stylesheet=xsl/metadata/static/mir-admindata-box-static.xsl

MCR.Object.Static.Content.Generator.mir-history.Class=org.mycore.services.queuedjob.staticcontent.MCRJobStaticContentGenerator
MCR.Object.Static.Content.Generator.mir-history.Transformer=mir-history
MCR.Object.Static.Content.Generator.mir-admindata-box.Class=org.mycore.services.queuedjob.staticcontent.MCRJobStaticContentGenerator
MCR.Object.Static.Content.Generator.mir-admindata-box.Transformer=mir-admindata-box

##############################################################################
# Workflow #
Expand Down Expand Up @@ -769,6 +766,11 @@ MIR.Viewer.DisableDerivateType=thumbnail
##############################################################################
MIR.CanonicalBaseURL=

##############################################################################
# Files per page in metadata view #
##############################################################################
MIR.FileBrowser.FilesPerPage=10

##############################################################################
# Sherpa Romeo API - details see https://v2.sherpa.ac.uk/api/ #
##############################################################################
Expand All @@ -783,3 +785,5 @@ MIR.Response.Facet.mods.genre.ClassId=mir_genres

MCR.ContentTransformer.svg-download.Class = org.mycore.common.content.transformer.MCRXSLTransformer
MCR.ContentTransformer.svg-download.Stylesheet = xslt/generate-svg-by-type.xsl

MCR.Startup.Class = %MCR.Startup.Class%,org.mycore.mir.migration.MIRMigrateStaticHistoryContent
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<xsl:param name="breadCrumb" />
<xsl:param name="MCR.Metadata.Languages" select="'de'" />
<xsl:param name="mcruser" select="document('user:current')/user"/>
<xsl:param name="MIR.Layout.usermenu.realname.enabled" select="false()"/>
<xsl:param name="MIR.Layout.usermenu.realname.enabled" select="'false'"/>

<xsl:include href="layout/mir-layout-utils.xsl" />
<xsl:include href="resource:xsl/layout/mir-navigation.xsl" />
Expand Down Expand Up @@ -64,7 +64,7 @@
<a id="currentUser" class="nav-link dropdown-toggle" data-toggle="dropdown" href="#">
<strong>
<xsl:choose>
<xsl:when test="$MIR.Layout.usermenu.realname.enabled = false()">
<xsl:when test="$MIR.Layout.usermenu.realname.enabled != 'true'">
<xsl:value-of select="$mcruser/@name"/>
</xsl:when>
<xsl:otherwise>
Expand Down
Loading
Loading