Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
* develop:
  UBO-254 fix facet counter length for 1
  UBO-254 fix facet count padding
  UBO-254 enables variable counter length in facet tile
  UBO-252 Fixed odd display of subjects generated from origin classification
  UBO-251 Add local user when publication is created and person selected in IdentityPicker does not exist yet (#298)
  UBO-247 Do not check for pid id in App.vue
  add missing coreFunction include
  add missing coreFunction include
  UBO-250 make user profile more generic (#297)
  fix order (is datatype text) and link to new duplication report
  Fix dependency management
  • Loading branch information
kkrebs committed Jul 11, 2023
2 parents 2c42c08 + 5d29f87 commit 25eac5f
Show file tree
Hide file tree
Showing 15 changed files with 143 additions and 110 deletions.
23 changes: 10 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.mycore</groupId>
<artifactId>mycore-parent</artifactId>
<version>49</version>
<relativePath/>
</parent>

<groupId>org.mycore.ubo</groupId>
Expand Down Expand Up @@ -58,9 +56,7 @@
<mycore.version>2022.06.2-SNAPSHOT</mycore.version>
<node.version>v16.0.0</node.version>
<sortpom.sortDeps>scope,groupId,artifactId</sortpom.sortDeps>
<sortpom.sortFile>
https://gist.githubusercontent.com/yagee-de/dfd3698c1b49173dbf251f74eb6a9297/raw/406460c088ff3cb6354e4ae6b40535e6f841607d/mycore_sort.xml
</sortpom.sortFile>
<sortpom.sortFile>https://gist.githubusercontent.com/yagee-de/dfd3698c1b49173dbf251f74eb6a9297/raw/406460c088ff3cb6354e4ae6b40535e6f841607d/mycore_sort.xml</sortpom.sortFile>
<sortpom.sortProps>true</sortpom.sortProps>
<timestamp>${maven.build.timestamp}</timestamp>
<yarn.version>v1.22.10</yarn.version>
Expand Down Expand Up @@ -171,8 +167,7 @@
<MCR.DataPrefix>dev</MCR.DataPrefix>
<cargo.jvmargs>-DMCR.AppName=${MCR.AppName}
-Dsolr.solr.home=${solr.home}
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=${cargo.debug.suspend},address=${cargo.debug.address}
</cargo.jvmargs>
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=${cargo.debug.suspend},address=${cargo.debug.address}</cargo.jvmargs>
</properties>
</profile>
<profile>
Expand Down Expand Up @@ -209,8 +204,7 @@
<configuration>
<properties>
<cargo.servlet.port>${cargo.servlet.port}</cargo.servlet.port>
<cargo.runtime.args>-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.JavaUtilLog
</cargo.runtime.args>
<cargo.runtime.args>-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.JavaUtilLog</cargo.runtime.args>
<cargo.jetty.realm.name>Restricted</cargo.jetty.realm.name>
</properties>
</configuration>
Expand Down Expand Up @@ -260,9 +254,7 @@
<cargo.tomcat.ajp.port>${cargo.tomcat.ajp.port}</cargo.tomcat.ajp.port>
<cargo.tomcat.uriencoding>UTF-8</cargo.tomcat.uriencoding>
<!-- fixes IIIF identifier encoding issues -->
<cargo.start.jvmargs>
-Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true${cargo.start.jvmargs}
</cargo.start.jvmargs>
<cargo.start.jvmargs>-Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true${cargo.start.jvmargs}</cargo.start.jvmargs>
</properties>
</configuration>
</configuration>
Expand Down Expand Up @@ -376,6 +368,11 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.mycore</groupId>
<artifactId>mycore-classifications</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>highlightjs</artifactId>
Expand Down
3 changes: 1 addition & 2 deletions ubo-cli/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.mycore.ubo</groupId>
Expand Down
39 changes: 10 additions & 29 deletions ubo-common/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.mycore.ubo</groupId>
Expand All @@ -13,31 +12,14 @@
<name>Universitätsbibliographie - Common Jar Module</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>analyze</id>
<goals>
<goal>analyze-only</goal>
</goals>
<configuration>
<ignoredUnusedDeclaredDependencies>
<ignoredUnusedDeclaredDependency>org.mycore.pica2mods:pica2mods-xslt:jar</ignoredUnusedDeclaredDependency>
</ignoredUnusedDeclaredDependencies>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addExtensions/>
<addExtensions />
</manifest>
<manifestEntries>
<MCR-Artifact-Id>${project.artifactId}</MCR-Artifact-Id>
Expand Down Expand Up @@ -140,14 +122,12 @@
<phase>prepare-package</phase>
<configuration>
<target>
<echo file="${project.build.directory}/classes/config/${artifactId}/mycore.properties" append="true">
# generated by ubo-common/pom.xml
<echo append="true" file="${project.build.directory}/classes/config/${artifactId}/mycore.properties"># generated by ubo-common/pom.xml
UBO.Frontend.jquery.version = ${jquery.version}
UBO.Frontend.jquery-ui.version = ${jquery.ui.version}
UBO.Frontend.chosen.version = ${chosen.version}
UBO.Frontend.bootstrap.version = ${bootstrap.version}
UBO.Frontend.font-awesome.version = ${font-awesome.version}
</echo>
UBO.Frontend.font-awesome.version = ${font-awesome.version}</echo>
</target>
</configuration>
</execution>
Expand Down Expand Up @@ -263,11 +243,6 @@
<groupId>org.mycore</groupId>
<artifactId>mycore-user2</artifactId>
</dependency>
<dependency>
<groupId>org.mycore.pica2mods</groupId>
<artifactId>pica2mods-xslt</artifactId>
<version>2.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>highlightjs</artifactId>
Expand Down Expand Up @@ -366,6 +341,12 @@
<artifactId>mycore-xeditor</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mycore.pica2mods</groupId>
<artifactId>pica2mods-xslt</artifactId>
<version>2.5-SNAPSHOT</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jdom2.Element;
import org.jdom2.filter.Filters;
import org.jdom2.output.Format;
import org.jdom2.output.XMLOutputter;
import org.mycore.common.MCRClassTools;
Expand All @@ -23,10 +24,13 @@
import org.mycore.ubo.matcher.MCRUserMatcherDTO;
import org.mycore.ubo.matcher.MCRUserMatcherLocal;
import org.mycore.ubo.matcher.MCRUserMatcherUtils;
import org.mycore.user2.MCRRealmFactory;
import org.mycore.user2.MCRUser;
import org.mycore.user2.MCRUserAttribute;
import org.mycore.user2.MCRUserManager;

import static org.mycore.common.MCRConstants.XPATH_FACTORY;
import static org.mycore.ubo.matcher.MCRUserMatcherUtils.MODS_NAMESPACE;

/**
* EventHandler for new publications in MODS-format.
Expand Down Expand Up @@ -184,7 +188,17 @@ protected void handleObjectCreated(MCREvent evt, MCRObject obj) {
enrichModsNameElementByLeadID(modsNameElement, leadIDName, affiliatedUser);
connectModsNameElementWithMCRUser(modsNameElement, affiliatedUser);
} else {
// ignore Person, do NOT create a new MCRUser
Optional<Element> leadId = modsNameElement.getChildren("nameIdentifier", MCRConstants.MODS_NAMESPACE)
.stream()
.filter(element -> element.getAttributeValue("type").equals(leadIDName))
.findFirst();

if(leadId.isPresent()) {
MCRUser newLocalUser = MCRUserMatcherUtils.createNewMCRUserFromModsNameElement(
modsNameElement, MCRRealmFactory.getLocalRealm().getID());
newLocalUser.setRealName(getRealNameFromNameElement(modsNameElement, newLocalUser));
connectModsNameElementWithMCRUser(modsNameElement, newLocalUser);
}
}
}

Expand Down Expand Up @@ -228,7 +242,7 @@ private void enrichModsNameElementByLeadID(Element modsNameElement, String leadI

private void enrichModsNameElementByNameIdentifierElement(Element modsNameElement,
String attributeType, String attributeValue) {
Element nameIdentifier = new Element("nameIdentifier", MCRUserMatcherUtils.MODS_NAMESPACE)
Element nameIdentifier = new Element("nameIdentifier", MODS_NAMESPACE)
.setAttribute("type", attributeType)
.setText(attributeValue);
modsNameElement.addContent(nameIdentifier);
Expand Down Expand Up @@ -259,4 +273,18 @@ private void connectModsNameElementWithMCRUser(Element modsNameElement, MCRUser
}
}
}

protected String getRealNameFromNameElement(Element nameElement, MCRUser mcrUser){
Element givenName = XPATH_FACTORY.compile("mods:namePart[@type='given']",
Filters.element(), null, MODS_NAMESPACE).evaluateFirst(nameElement);

Element familyName = XPATH_FACTORY.compile("mods:namePart[@type='family']",
Filters.element(), null, MODS_NAMESPACE).evaluateFirst(nameElement);

if((givenName != null) && (familyName != null)) {
return givenName.getText() + " " + familyName.getText();
}

return mcrUser.getUserID();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

// facets (sidebar searchresults etc.)
.mycore-facet-count:after {
content: " | ";
content: "|";
padding: 0 0 0 0.25rem;
}

.mycore-facet-exclude, .mycore-facet-remove {
Expand All @@ -23,6 +24,37 @@
margin: 0;
padding: 0;
text-align: right;
text-overflow: ellipsis;
overflow: hidden;
word-wrap: normal;
padding-right: .25rem;
}

.counter-length {
&-1 {
.mycore-facet-count { width: 25px; }
.mycore-facet-value { width: 210px; }
}
&-2 {
.mycore-facet-count { width: 30px; }
.mycore-facet-value { width: 205px; }
}
&-3 {
.mycore-facet-count { width: 40px; }
.mycore-facet-value { width: 195px; }
}
&-4 {
.mycore-facet-count { width: 50px; }
.mycore-facet-value { width: 185px; }
}
&-5 {
.mycore-facet-count { width: 60px; }
.mycore-facet-value { width: 175px; }
}
&-6 {
.mycore-facet-count { width: 70px; }
.mycore-facet-value { width: 165px; }
}
}

.mycore-facet-value {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1194,27 +1194,27 @@ upload.successful = Upload erfolgreich

urn.create = URN erzeugen

user.profile = Mein Profil
user.profile.account = Ihre Benutzerkennung
user.profile.eMail = Ihre E-Mail-Adresse
user.profile.id.connection = interne Connection-ID
user.profile.id.gnd = Ihre GND
user.profile.id.local = Ihre lokale ID
user.profile.id.lsf = Ihre LSF iD
user.profile.id.orcid = Ihre ORCID iD
user.profile.id.scopus = Ihre SCOPUS Autoren-iD
user.profile.publications = Ihre Publikationen
user.profile = Profil
user.profile.account = Benutzerkennung
user.profile.eMail = E-Mail-Adresse
user.profile.id.connection = Interne Connection-ID
user.profile.id.gnd = GND
user.profile.id.local = Lokale ID
user.profile.id.lsf = LSF iD
user.profile.id.orcid = ORCID iD
user.profile.id.scopus = SCOPUS Autoren-iD
user.profile.publications = Publikationen
user.profile.publications.num.multiple = {0} Publikationen
user.profile.publications.num.none = keine Publikationen
user.profile.publications.num.one = eine Publikation
user.profile.publications.orcid.intro = Ihr ORCID-Profil enth\u00E4lt
user.profile.publications.ubo.intro = Die Universit\u00E4tsbibliographie enth\u00E4lt
user.profile.publications.ubo.outro = \ mit Ihnen eindeutig zugeordneter LSF ID
user.profile.publications.ubo.outro = \ mit diesem Profil eindeutig zugeordneter LSF ID
user.profile.publications.ubo.published.extro.plural.false = im Status <strong>redaktionell gepr\u00FCft</strong>.
user.profile.publications.ubo.published.extro.plural.true = im Status <strong>redaktionell gepr\u00FCft</strong>.
user.profile.publications.ubo.published.intro.plural.false = Davon ist
user.profile.publications.ubo.published.intro.plural.true = Davon sind
user.profile.realName = Ihr Name
user.profile.realName = Name

video.bitRate = Bitrate
video.bitRate.kBit = kBit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1186,28 +1186,28 @@ upload.successful = Upload successful

urn.create = Create URN

user.profile = My profile
user.profile.account = Your account
user.profile.eMail = Your e-mail address
user.profile.id.connection = internal connection id
user.profile.id.gnd = Your GND
user.profile.id.local = Your local ID
user.profile.id.lsf = Your LSF iD
user.profile.id.orcid = Your ORCID iD
user.profile.id.scopus = Your SCOPUS author iD
user.profile.publications = Your publications
user.profile = Profile
user.profile.account = Account
user.profile.eMail = E-Mail address
user.profile.id.connection = Internal connection id
user.profile.id.gnd = GND
user.profile.id.local = Local ID
user.profile.id.lsf = LSF iD
user.profile.id.orcid = ORCID iD
user.profile.id.scopus = SCOPUS author iD
user.profile.publications = Publications
user.profile.publications.num.multiple = {0} publications
user.profile.publications.num.none = no publications
user.profile.publications.num.one = one publication
user.profile.publications.orcid.intro = Your ORCID record contains
user.profile.publications.ubo.intro = The university bibliography contains
user.profile.publications.ubo.outro = \ linked to your personal LSF ID
user.profile.publications.ubo.published.extro.plural.false = is in state <strong> editorially checked</strong>.
user.profile.publications.ubo.published.extro.plural.true = are in state <strong> editorially checked</strong>.
user.profile.publications.ubo.outro = \ linked to this LSF ID
user.profile.publications.ubo.published.extro.plural.false = is in state <strong>editorially checked</strong>.
user.profile.publications.ubo.published.extro.plural.true = are in state <strong>editorially checked</strong>.
user.profile.publications.ubo.published.intro = With actually
user.profile.publications.ubo.published.intro.plural.false = Thereof
user.profile.publications.ubo.published.intro.plural.true = Therof
user.profile.realName = Your name
user.profile.realName = Name

video.bitRate = Bitrate
video.bitRate.kBit = kBit
Expand Down
1 change: 1 addition & 0 deletions ubo-common/src/main/resources/xsl/debugEnrichment.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:mods="http://www.loc.gov/mods/v3">

<xsl:include href="mods-display.xsl" />
<xsl:include href="coreFunctions.xsl" />

<xsl:template match="/">
<html id="debugEnrichment">
Expand Down
Loading

0 comments on commit 25eac5f

Please sign in to comment.