diff --git a/.env b/.env
new file mode 100644
index 000000000..e63e0c79f
--- /dev/null
+++ b/.env
@@ -0,0 +1,21 @@
+NAME=ubo
+
+DB_PORT=8293
+DB_USER=pguser
+DB_PASSWORD=password
+DB_DATA=./docker/postgres-data/
+
+APP_CONTEXT=ubo
+APP_HTTP=8291
+APP_AJP=8292
+APP_DEBUG=8295
+APP_HOME=./docker/ubo-home/
+APP_DATA=./docker/ubo-data/
+APP_LOGS=./docker/ubo-logs/
+APP_TMP=./docker/ubo-tmp/
+
+APP_XMS=1024m
+APP_XMX=1024m
+
+SOLR_HTTP=8290
+SOLR_DATA=./docker/solr-data/
diff --git a/.github/workflows/maven-pr.yml b/.github/workflows/maven-pr.yml
index dcc4eb5e0..d99c93326 100644
--- a/.github/workflows/maven-pr.yml
+++ b/.github/workflows/maven-pr.yml
@@ -15,11 +15,11 @@ jobs:
steps:
- uses: actions/checkout@v3
- - name: Set up JDK 11
+ - name: Set up JDK 17
uses: actions/setup-java@v3
with:
- java-version: '11'
- distribution: 'temurin'
+ java-version: '17'
+ distribution: 'adopt'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Build with Maven
diff --git a/.github/workflows/maven-publish-release.yml b/.github/workflows/maven-publish-release.yml
index b3253d022..614562066 100644
--- a/.github/workflows/maven-publish-release.yml
+++ b/.github/workflows/maven-publish-release.yml
@@ -16,11 +16,11 @@ jobs:
steps:
- uses: actions/checkout@v3
- - name: Set up JDK 11
+ - name: Set up JDK 17
uses: actions/setup-java@v3
with:
- java-version: '11'
- distribution: 'temurin'
+ java-version: '17'
+ distribution: 'adopt'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
@@ -31,3 +31,16 @@ jobs:
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
+ - name: Login to Docker Hub
+ if: success()
+ uses: docker/login-action@v2
+ with:
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
+ - name: Build the mir Docker images and push them
+ if: success()
+ run: |
+ docker build . --file Dockerfile --tag mycoreorg/ubo:${GITHUB_REF_NAME}
+ docker build ubo-webapp/src/main/setup/solr/ --file ubo-webapp/src/main/setup/solr/Dockerfile --tag mycoreorg/ubo-solr:${GITHUB_REF_NAME}
+ docker push mycoreorg/ubo:${GITHUB_REF_NAME}
+ docker push mycoreorg/ubo-solr:${GITHUB_REF_NAME}
diff --git a/.github/workflows/maven-publish-snapshot.yml b/.github/workflows/maven-publish-snapshot.yml
index 2001f3d3d..87535e1d0 100644
--- a/.github/workflows/maven-publish-snapshot.yml
+++ b/.github/workflows/maven-publish-snapshot.yml
@@ -19,11 +19,11 @@ jobs:
steps:
- uses: actions/checkout@v3
- - name: Set up JDK 11
+ - name: Set up JDK 17
uses: actions/setup-java@v3
with:
- java-version: '11'
- distribution: 'temurin'
+ java-version: '17'
+ distribution: 'adopt'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
@@ -32,3 +32,16 @@ jobs:
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
+ - name: Login to Docker Hub
+ if: success()
+ uses: docker/login-action@v2
+ with:
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
+ - name: Build the mir Docker images and push them
+ if: success()
+ run: |
+ docker build . --file Dockerfile --tag mycoreorg/ubo:${GITHUB_REF_NAME}
+ docker build ubo-webapp/src/main/setup/solr/ --file ubo-webapp/src/main/setup/solr/Dockerfile --tag mycoreorg/ubo-solr:${GITHUB_REF_NAME}
+ docker push mycoreorg/ubo:${GITHUB_REF_NAME}
+ docker push mycoreorg/ubo-solr:${GITHUB_REF_NAME}
diff --git a/.gitignore b/.gitignore
index e593c9872..bba14dbbd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,4 +6,5 @@
*.iml
pom.xml.bak
*/target/
-.DS_Store
\ No newline at end of file
+.DS_Store
+/docker/
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 000000000..2cc44a5a8
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,30 @@
+FROM tomcat:jdk17-temurin-focal
+RUN groupadd -r mcr -g 501 && \
+ useradd -d /home/mcr -u 501 -m -s /bin/bash -g mcr mcr
+WORKDIR /usr/local/tomcat/
+ARG PACKET_SIZE="65536"
+ENV APP_CONTEXT="ubo" \
+ MCR_CONFIG_DIR="/mcr/home/" \
+ MCR_DATA_DIR="/mcr/data/" \
+ MCR_LOG_DIR="/mcr/logs/" \
+ SOLR_CORE="ubo" \
+ SOLR_CLASSIFICATION_CORE="ubo-classifications" \
+ XMX="1g" \
+ XMS="1g"
+COPY --from=regreb/bibutils --chown=mcr:mcr /usr/local/bin/* /usr/local/bin/
+COPY --chown=root:root docker-entrypoint.sh /usr/local/bin/ubo.sh
+
+RUN set -eux; \
+ chmod 555 /usr/local/bin/ubo.sh; \
+ apt-get update; \
+ apt-get install -y gosu; \
+ rm -rf /var/lib/apt/lists/*;
+RUN rm -rf /usr/local/tomcat/webapps/* && \
+ mkdir /opt/ubo/ && \
+ chown mcr:mcr -R /opt/ubo/ && \
+ sed -ri "s/<\/Service>/&/g" /usr/local/tomcat/conf/server.xml
+COPY --chown=mcr:mcr ubo-webapp/target/ubo-*.war /opt/ubo/ubo.war
+COPY --chown=mcr:mcr ubo-cli /opt/ubo/ubo-cli
+COPY --chown=mcr:mcr docker-log4j2.xml /opt/ubo/log4j2.xml
+RUN chown mcr:mcr -R /opt/ubo/ /usr/local/tomcat/webapps/
+CMD ["bash", "/usr/local/bin/ubo.sh"]
diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml
new file mode 100644
index 000000000..720c0ed8d
--- /dev/null
+++ b/docker-compose.prod.yml
@@ -0,0 +1,49 @@
+version: '3.1'
+
+services:
+ db:
+ container_name: ${NAME}-db
+ image: postgres:12
+ restart: unless-stopped
+ environment:
+ - POSTGRES_USER=${DB_USER}
+ - POSTGRES_PASSWORD=${DB_PASSWORD}
+ - POSTGRES_DB=ubo
+ volumes:
+ - ${DB_DATA}:/var/lib/postgresql/data/
+ ports:
+ - ${DB_PORT}:5432
+ solr:
+ container_name: ${NAME}-solr
+ image: mycoreorg/ubo-solr:develop
+ restart: unless-stopped
+ volumes:
+ - ${SOLR_DATA}:/var/solr/data
+ ports:
+ - ${SOLR_HTTP}:8983
+ ubo:
+ container_name: ${NAME}-ubo
+ image: mycoreorg/ubo:develop
+ restart: unless-stopped
+ environment:
+ - APP_CONTEXT=${APP_CONTEXT}
+ - JDBC_NAME=${DB_USER}
+ - JDBC_PASSWORD=${DB_PASSWORD}
+ - JDBC_DRIVER=org.postgresql.Driver
+ - JDBC_URL=jdbc:postgresql://db:5432/ubo
+ - SOLR_URL=http://solr:8983
+ - SOLR_CORE=ubo
+ - SOLR_CLASSIFICATION_CORE=ubo-classifications
+ - XMX=${APP_XMX}
+ - XMS=${APP_XMS}
+ volumes:
+ - ${APP_HOME}:/mcr/home/
+ - ${APP_DATA}:/mcr/data/
+ - ${APP_LOGS}:/mcr/logs/
+ - ${APP_TMP}:/mcr/tmp/
+ depends_on:
+ - db
+ - solr
+ ports:
+ - ${APP_HTTP}:8080
+ - ${APP_AJP}:8009
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 000000000..e00808851
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,51 @@
+version: '3.1'
+
+services:
+ db:
+ container_name: ${NAME}-db
+ image: postgres:12
+ restart: unless-stopped
+ environment:
+ - POSTGRES_USER=${DB_USER}
+ - POSTGRES_PASSWORD=${DB_PASSWORD}
+ - POSTGRES_DB=ubo
+ volumes:
+ - ${DB_DATA}:/var/lib/postgresql/data/
+ ports:
+ - ${DB_PORT}:5432
+ solr:
+ container_name: ${NAME}-solr
+ build: ubo-webapp/src/main/setup/solr/
+ restart: unless-stopped
+ volumes:
+ - ${SOLR_DATA}:/var/solr/data
+ ports:
+ - ${SOLR_HTTP}:8983
+ ubo:
+ container_name: ${NAME}-ubo
+ build: ./
+ restart: unless-stopped
+ environment:
+ - APP_CONTEXT=${APP_CONTEXT}
+ - JDBC_NAME=${DB_USER}
+ - JDBC_PASSWORD=${DB_PASSWORD}
+ - JDBC_DRIVER=org.postgresql.Driver
+ - JDBC_URL=jdbc:postgresql://db:5432/ubo
+ - SOLR_URL=http://solr:8983
+ - SOLR_CORE=ubo
+ - SOLR_CLASSIFICATION_CORE=ubo-classifications
+ - XMX=${APP_XMX}
+ - XMS=${APP_XMS}
+ - APP_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8295
+ volumes:
+ - ${APP_HOME}:/mcr/home/
+ - ${APP_DATA}:/mcr/data/
+ - ${APP_LOGS}:/mcr/logs/
+ - ${APP_TMP}:/mcr/tmp/
+ depends_on:
+ - db
+ - solr
+ ports:
+ - ${APP_HTTP}:8080
+ - ${APP_AJP}:8009
+ - ${APP_DEBUG}:8295
diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh
new file mode 100755
index 000000000..45b04a6d7
--- /dev/null
+++ b/docker-entrypoint.sh
@@ -0,0 +1,158 @@
+#!/usr/bin/bash
+set -e
+
+MCR_SAVE_DIR="${MCR_CONFIG_DIR}save/"
+
+MCR_CONFIG_DIR_ESCAPED=$(echo "$MCR_CONFIG_DIR" | sed 's/\//\\\//g')
+MCR_DATA_DIR_ESCAPED=$(echo "$MCR_DATA_DIR" | sed 's/\//\\\//g')
+MCR_SAVE_DIR_ESCAPED=$(echo "$MCR_SAVE_DIR" | sed 's/\//\\\//g')
+MCR_LOG_DIR_ESCAPED=$(echo "$MCR_LOG_DIR" | sed 's/\//\\\//g')
+
+SOLR_URL_ESCAPED=$(echo "$SOLR_URL" | sed 's/\//\\\//g')
+SOLR_CORE_ESCAPED=$(echo "$SOLR_CORE" | sed 's/\//\\\//g')
+SOLR_CLASSIFICATION_CORE_ESCAPED=$(echo "$SOLR_CLASSIFICATION_CORE" | sed 's/\//\\\//g')
+
+JDBC_NAME_ESCAPED=$(echo "$JDBC_NAME" | sed 's/\//\\\//g')
+JDBC_PASSWORD_ESCAPED=$(echo "$JDBC_PASSWORD" | sed 's/\//\\\//g')
+JDBC_DRIVER_ESCAPED=$(echo "$JDBC_DRIVER" | sed 's/\//\\\//g')
+JDBC_URL_ESCAPED=$(echo "$JDBC_URL" | sed 's/\//\\\//g')
+HIBERNATE_SCHEMA_ESCAPED=$(echo "$JDBC_URL" | sed 's/\//\\\//g')
+
+MYCORE_PROPERTIES="${MCR_CONFIG_DIR}mycore.properties"
+PERSISTENCE_XML="${MCR_CONFIG_DIR}resources/META-INF/persistence.xml"
+
+function fixDirectoryRights() {
+ find "$1" \! -user "$2" -exec chown "$2:$2" '{}' +
+}
+
+echo "Running MIR Starter Script as User: $(whoami)"
+
+if [ "$EUID" -eq 0 ]
+ then
+ fixDirectoryRights "$MCR_CONFIG_DIR" "mcr"
+ fixDirectoryRights "$MCR_DATA_DIR" "mcr"
+ fixDirectoryRights "$MCR_LOG_DIR" "mcr"
+ exec gosu mcr "$0"
+ exit 0;
+fi
+
+sleep 5 # wait for database (TODO: replace with wait-for-it)
+
+cd /usr/local/tomcat/
+
+function setupLog4jConfig() {
+ if [[ ! -f "${MCR_CONFIG_DIR}resources/log4j2.xml" ]]
+ then
+ cp /opt/ubo/log4j2.xml "${MCR_CONFIG_DIR}resources/"
+ fi
+}
+
+function downloadDriver {
+ FILENAME=$(basename $1)
+ if [[ ! -f "${MCR_CONFIG_DIR}lib/$FILENAME" ]]
+ then
+ curl -o "${MCR_CONFIG_DIR}lib/$FILENAME" "$1"
+ fi
+}
+
+function setDockerValues() {
+ echo "Set Docker Values to Config!"
+ if [ -n "${SOLR_URL}" ]; then
+ sed -ri "s/#?(MCR\.Solr\.ServerURL=).+/\1${SOLR_URL_ESCAPED}/" "${MYCORE_PROPERTIES}";
+ fi
+
+ if [ -n "${SOLR_CORE}" ]; then
+ sed -ri "s/#?(MCR\.Solr\.Core\.main\.Name=).+/\1${SOLR_CORE_ESCAPED}/" "${MYCORE_PROPERTIES}";
+ fi
+
+ if [ -n "${SOLR_CLASSIFICATION_CORE}" ]; then
+ sed -ri "s/#?(MCR\.Solr\.Core\.classification\.Name=).+/\1${SOLR_CLASSIFICATION_CORE_ESCAPED}/" "${MYCORE_PROPERTIES}"
+ fi
+
+ if [ -n "${JDBC_NAME}" ]; then
+ sed -ri "s/(name=\"javax.persistence.jdbc.user\" value=\").*(\")/\1${JDBC_NAME_ESCAPED}\2/" "${PERSISTENCE_XML}"
+ fi
+
+ if [ -n "${JDBC_PASSWORD}" ]; then
+ sed -ri "s/(name=\"javax.persistence.jdbc.password\" value=\").*(\")/\1${JDBC_PASSWORD_ESCAPED}\2/" "${PERSISTENCE_XML}"
+ fi
+
+ if [ -n "${JDBC_DRIVER}" ]; then
+ sed -ri "s/(name=\"javax.persistence.jdbc.driver\" value=\").*(\")/\1${JDBC_DRIVER_ESCAPED}\2/" "${PERSISTENCE_XML}"
+ fi
+
+ if [ -n "${JDBC_URL}" ]; then
+ sed -ri "s/(name=\"javax.persistence.jdbc.url\" value=\").*(\")/\1${JDBC_URL_ESCAPED}\2/" "${PERSISTENCE_XML}"
+ fi
+
+ if [ -n "${SOLR_CLASSIFICATION_CORE}" ]; then
+ sed -ri "s/(name=\"hibernate.default_schema\" value=\").*(\")/\1${HIBERNATE_SCHEMA_ESCAPED}\2/" "${PERSISTENCE_XML}"
+ fi
+
+ sed -ri "s/(name=\"hibernate.hbm2ddl.auto\" value=\").*(\")/\1update\2/" "${PERSISTENCE_XML}"
+
+ if grep -q "MCR.datadir=" "${MYCORE_PROPERTIES}" ; then
+ sed -ri "s/#?(MCR\.datadir=).+/\1${MCR_DATA_DIR_ESCAPED}/" "${MYCORE_PROPERTIES}"
+ else
+ echo "MCR.datadir=${MCR_DATA_DIR}">>"${MYCORE_PROPERTIES}"
+ fi
+
+ if grep -q "MCR.Save.FileSystem=" "${MYCORE_PROPERTIES}" ; then
+ sed -ri "s/#?(MCR\.Save\.FileSystem=).+/\1${MCR_SAVE_DIR_ESCAPED}/" "${MYCORE_PROPERTIES}"
+ else
+ echo "MCR.Save.FileSystem=${MCR_SAVE_DIR}">>"${MYCORE_PROPERTIES}"
+ fi
+
+ case $JDBC_DRIVER in
+ org.postgresql.Driver) downloadDriver "https://jdbc.postgresql.org/download/postgresql-42.2.9.jar";;
+ org.mariadb.jdbc.Driver) downloadDriver "https://repo.maven.apache.org/maven2/org/mariadb/jdbc/mariadb-java-client/2.5.4/mariadb-java-client-2.5.4.jar";;
+ org.hsqldb.jdbcDriver) downloadDriver "https://repo.maven.apache.org/maven2/org/hsqldb/hsqldb/2.5.0/hsqldb-2.5.0.jar";;
+ org.h2.Driver) downloadDriver "https://repo.maven.apache.org/maven2/com/h2database/h2/1.4.200/h2-1.4.200.jar";;
+ com.mysql.jdbc.Driver) downloadDriver "https://repo.maven.apache.org/maven2/mysql/mysql-connector-java/8.0.19/mysql-connector-java-8.0.19.jar";;
+ esac
+
+ mkdir -p "${MCR_CONFIG_DIR}lib"
+
+ downloadDriver https://repo1.maven.org/maven2/org/hibernate/hibernate-c3p0/5.3.9.Final/hibernate-c3p0-5.3.9.Final.jar
+ downloadDriver https://repo1.maven.org/maven2/com/mchange/c3p0/0.9.5.2/c3p0-0.9.5.2.jar
+ downloadDriver https://repo1.maven.org/maven2/com/mchange/mchange-commons-java/0.2.15/mchange-commons-java-0.2.15.jar
+
+
+ if [ -f "${MCR_CONFIG_DIR}jwt.secret" ]; then
+ echo "jwt.secret already exists."
+ else
+ echo "jwt.secret does not exists, create it.."
+ openssl rand -out "${MCR_CONFIG_DIR}jwt.secret" 4096
+ fi;
+}
+
+function setUpMyCoRe {
+ /opt/ubo/ubo-cli/target/bin/ubo.sh create configuration directory
+ setDockerValues
+ setupLog4jConfig
+ sed -ri "s/(<\/properties>)/\n\n\n\n\n\n\1/" "${PERSISTENCE_XML}"
+ sed -ri "s/META-INF\/mycore-viewer-mappings.xml<\/mapping-file>//" "${PERSISTENCE_XML}"
+ sed -ri "s/META-INF\/mycore-iview2-mappings.xml<\/mapping-file>//" "${PERSISTENCE_XML}"
+ sed -ri "s/META-INF\/mycore-ifs-mappings.xml<\/mapping-file>//" "${PERSISTENCE_XML}"
+ /opt/ubo/ubo-cli/target/bin/ubo.sh init superuser
+ /opt/ubo/ubo-cli/target/bin/ubo.sh update all classifications from directory /opt/ubo/ubo-cli/src/main/setup/classifications
+ /opt/ubo/ubo-cli/target/bin/ubo.sh update permission update permission create-mods for id POOLPRIVILEGE with rulefile /opt/ubo/ubo-cli/src/main/setup/acl/acl-rule-always-allowed.xml described by always allowed
+ /opt/ubo/ubo-cli/target/bin/ubo.sh update permission update permission create-users for id POOLPRIVILEGE with rulefile /opt/ubo/ubo-cli/src/main/setup/acl/acl-rule-administrators-only.xml described by administrators only
+ /opt/ubo/ubo-cli/target/bin/ubo.sh update permission update permission administrate-users for id POOLPRIVILEGE with rulefile /opt/ubo/ubo-cli/src/main/setup/acl/acl-rule-administrators-only.xml described by administrators only
+ /opt/ubo/ubo-cli/target/bin/ubo.sh update permission update permission read for id default with rulefile /opt/ubo/ubo-cli/src/main/setup/acl/acl-rule-always-allowed.xml described by always allowed
+ /opt/ubo/ubo-cli/target/bin/ubo.sh update permission update permission writedb for id default with rulefile /opt/ubo/ubo-cli/src/main/setup/acl/acl-rule-administrators-only.xml described by administrators only
+ /opt/ubo/ubo-cli/target/bin/ubo.sh update permission update permission read for id restapi:/ with rulefile /opt/ubo/ubo-cli/src/main/setup/acl/acl-rule-always-allowed.xml described by always allowed
+ /opt/ubo/ubo-cli/target/bin/ubo.sh update permission deletedb for id default with rulefile /opt/ubo/ubo-cli/src/main/setup/acl/acl-rule-administrators-only.xml described by administrators only
+ /opt/ubo/ubo-cli/target/bin/ubo.sh reload solr configuration main in core main
+}
+
+sed -ri "s/(-DMCR.AppName=).+( \\\\)/\-DMCR.ConfigDir=${MCR_CONFIG_DIR_ESCAPED}\2/" /opt/ubo/ubo-cli/target/bin/ubo.sh
+sed -ri "s/(-DMCR.ConfigDir=).+( \\\\)/\-DMCR.ConfigDir=${MCR_CONFIG_DIR_ESCAPED}\2/" /opt/ubo/ubo-cli/target/bin/ubo.sh
+
+[ "$(ls -A "$MCR_CONFIG_DIR")" ] && setDockerValues || setUpMyCoRe
+
+rm -rf /usr/local/tomcat/webapps/*
+cp /opt/ubo/ubo.war "/usr/local/tomcat/webapps/${APP_CONTEXT}.war"
+
+export JAVA_OPTS="-DMCR.ConfigDir=${MCR_CONFIG_DIR} -Xmx${XMX} -Xms${XMS} -XX:+CrashOnOutOfMemoryError ${APP_OPTS}"
+catalina.sh run
diff --git a/docker-log4j2.xml b/docker-log4j2.xml
new file mode 100644
index 000000000..32c1db175
--- /dev/null
+++ b/docker-log4j2.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+ %highlight{%d{ISO8601} %-5p %X{loginId} %c{1}: %m%n%ex}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pom.xml b/pom.xml
index 3cd7573d1..7ef8191cf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
org.mycore
mycore-parent
- 48
+ 49
@@ -45,13 +45,22 @@
ubo
1.4
- 11
+ 4.4.1
+ 1.8.7
+ 5.13.0
+ 2.0.1
+ 6.0.0
+ 3.1.0
+ 3.0.1
+ 17
1.13.2
3.5.1
- 2021.06.2-SNAPSHOT
+ 2022.06.2-SNAPSHOT
v16.0.0
scope,groupId,artifactId
- https://gist.githubusercontent.com/yagee-de/dfd3698c1b49173dbf251f74eb6a9297/raw/406460c088ff3cb6354e4ae6b40535e6f841607d/mycore_sort.xml
+
+ https://gist.githubusercontent.com/yagee-de/dfd3698c1b49173dbf251f74eb6a9297/raw/406460c088ff3cb6354e4ae6b40535e6f841607d/mycore_sort.xml
+
true
${maven.build.timestamp}
v1.22.10
@@ -251,7 +260,9 @@
${cargo.tomcat.ajp.port}
UTF-8
- -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true${cargo.start.jvmargs}
+
+ -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true${cargo.start.jvmargs}
+
@@ -267,15 +278,30 @@
org.mycore
- mycore
+ mycore-bom
${mycore.version}
pom
import
- javax.xml.ws
- jaxws-api
- 2.3.1
+ jakarta.servlet
+ jakarta.servlet-api
+ ${jakarta.servlet-api.version}
+
+
+ jakarta.ws.rs
+ jakarta.ws.rs-api
+ ${jakarta.ws.rs-api.version}
+
+
+ jakarta.xml.bind
+ jakarta.xml.bind-api
+ ${jakarta.xml.bind.version}
+
+
+ org.apache.commons
+ commons-lang3
+ 3.10
org.apache.commons
@@ -300,12 +326,12 @@
org.webjars
bootstrap
- 4.4.1
+ ${bootstrap.version}
org.webjars
font-awesome
- 5.13.0
+ ${font-awesome.version}
org.webjars
@@ -325,12 +351,18 @@
org.webjars.npm
chosen-js
- 1.8.7
+ ${chosen.version}
xml-apis
xml-apis
- 1.0.b2
+ 1.4.01
+
+
+ com.sun.activation
+ jakarta.activation
+ ${jakarta.activation.version}
+ runtime
commons-discovery
diff --git a/ubo-cli/pom.xml b/ubo-cli/pom.xml
index 3b8a9aea5..7b95cc4ed 100644
--- a/ubo-cli/pom.xml
+++ b/ubo-cli/pom.xml
@@ -1,5 +1,6 @@
-
+
4.0.0
org.mycore.ubo
@@ -55,9 +56,9 @@
- javax.servlet
- javax.servlet-api
- 3.1.0
+ jakarta.servlet
+ jakarta.servlet-api
+ ${jakarta.servlet-api.version}
jar
true
diff --git a/ubo-common/pom.xml b/ubo-common/pom.xml
index 97ff001b4..df57f3cf4 100644
--- a/ubo-common/pom.xml
+++ b/ubo-common/pom.xml
@@ -1,5 +1,6 @@
-
+
4.0.0
org.mycore.ubo
@@ -12,6 +13,23 @@
Universitätsbibliographie - Common Jar Module
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+
+
+ analyze
+
+ analyze-only
+
+
+
+ org.mycore.pica2mods:pica2mods-xslt:jar
+
+
+
+
+
org.apache.maven.plugins
maven-jar-plugin
@@ -19,7 +37,7 @@
true
-
+
${project.artifactId}
@@ -111,6 +129,30 @@
+
+ org.apache.maven.plugins
+ maven-antrun-plugin
+
+
+
+ run
+
+ prepare-package
+
+
+
+ # 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}
+
+
+
+
+
+
@@ -128,10 +170,6 @@
commons-codec
1.10
-
- commons-lang
- commons-lang
-
jakarta.servlet
jakarta.servlet-api
@@ -225,6 +263,11 @@
org.mycore
mycore-user2
+
+ org.mycore.pica2mods
+ pica2mods-xslt
+ 2.5-SNAPSHOT
+
org.webjars
highlightjs
@@ -239,9 +282,9 @@
runtime
- javax.xml.ws
- jaxws-api
- 2.3.1
+ jakarta.xml.ws
+ jakarta.xml.ws-api
+ 2.3.2
runtime
@@ -323,12 +366,6 @@
mycore-xeditor
runtime
-
- org.mycore.pica2mods
- pica2mods-xslt
- 2.5-SNAPSHOT
- runtime
-
org.webjars
bootstrap
diff --git a/ubo-common/src/main/java/org/mycore/mods/enrichment/EnrichmentDebuggerServlet.java b/ubo-common/src/main/java/org/mycore/mods/enrichment/EnrichmentDebuggerServlet.java
index 82f198653..e2a0d2110 100644
--- a/ubo-common/src/main/java/org/mycore/mods/enrichment/EnrichmentDebuggerServlet.java
+++ b/ubo-common/src/main/java/org/mycore/mods/enrichment/EnrichmentDebuggerServlet.java
@@ -1,8 +1,7 @@
package org.mycore.mods.enrichment;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.jdom2.Document;
import org.jdom2.Element;
import org.mycore.common.MCRConstants;
diff --git a/ubo-common/src/main/java/org/mycore/ubo/DozBibCommands.java b/ubo-common/src/main/java/org/mycore/ubo/DozBibCommands.java
index 280c17ef6..d9657720e 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/DozBibCommands.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/DozBibCommands.java
@@ -13,7 +13,6 @@
import java.io.File;
import java.io.FileOutputStream;
import java.text.DateFormat;
-import java.text.MessageFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
@@ -24,7 +23,6 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
-import org.mycore.ubo.importer.scopus.ScopusInitialImporter;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jdom2.Attribute;
@@ -51,6 +49,7 @@
import org.mycore.frontend.cli.MCRCommand;
import org.mycore.mods.MCRMODSCommands;
import org.mycore.mods.MCRMODSWrapper;
+import org.mycore.ubo.importer.scopus.ScopusInitialImporter;
public class DozBibCommands extends MCRAbstractCommands {
diff --git a/ubo-common/src/main/java/org/mycore/ubo/DozBibEntryServlet.java b/ubo-common/src/main/java/org/mycore/ubo/DozBibEntryServlet.java
index 379fee46e..f08f703f0 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/DozBibEntryServlet.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/DozBibEntryServlet.java
@@ -13,9 +13,8 @@
import java.util.HashMap;
import java.util.List;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jdom2.Document;
diff --git a/ubo-common/src/main/java/org/mycore/ubo/DozBibGNDCommands.java b/ubo-common/src/main/java/org/mycore/ubo/DozBibGNDCommands.java
index 4d9433940..1cd8b12a0 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/DozBibGNDCommands.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/DozBibGNDCommands.java
@@ -20,7 +20,7 @@
import java.util.Map;
import java.util.Set;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jdom2.Attribute;
diff --git a/ubo-common/src/main/java/org/mycore/ubo/DozBibServlet.java b/ubo-common/src/main/java/org/mycore/ubo/DozBibServlet.java
index 2abf228f6..cf077a748 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/DozBibServlet.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/DozBibServlet.java
@@ -14,9 +14,8 @@
import java.util.Comparator;
import java.util.List;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.solr.client.solrj.SolrClient;
diff --git a/ubo-common/src/main/java/org/mycore/ubo/NewPublicationWizard.java b/ubo-common/src/main/java/org/mycore/ubo/NewPublicationWizard.java
index 3568b23f9..2af4c8b94 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/NewPublicationWizard.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/NewPublicationWizard.java
@@ -16,8 +16,7 @@
import java.util.List;
import java.util.Set;
-import javax.servlet.http.HttpServletResponse;
-
+import jakarta.servlet.http.HttpServletResponse;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.solr.client.solrj.SolrClient;
@@ -31,7 +30,7 @@
import org.jdom2.xpath.XPathExpression;
import org.jdom2.xpath.XPathFactory;
import org.mycore.common.MCRConstants;
-import org.mycore.common.MCRSessionMgr;
+import org.mycore.common.MCRSessionMgr;
import org.mycore.common.config.MCRConfiguration2;
import org.mycore.common.content.MCRJDOMContent;
import org.mycore.common.xml.MCRLayoutService;
@@ -41,7 +40,6 @@
import org.mycore.frontend.servlets.MCRServletJob;
import org.mycore.solr.MCRSolrClientFactory;
import org.mycore.solr.MCRSolrUtils;
-
import org.mycore.ubo.dedup.DeDupCriteriaBuilder;
import org.mycore.ubo.dedup.DeDupCriterion;
diff --git a/ubo-common/src/main/java/org/mycore/ubo/UBOUserByConnectionResolver.java b/ubo-common/src/main/java/org/mycore/ubo/UBOUserByConnectionResolver.java
index 4707f4635..b4ec35d77 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/UBOUserByConnectionResolver.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/UBOUserByConnectionResolver.java
@@ -18,6 +18,15 @@
package org.mycore.ubo;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import javax.xml.transform.Source;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.URIResolver;
+
+import jakarta.xml.bind.JAXBException;
+import jakarta.xml.bind.util.JAXBSource;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jdom2.Element;
@@ -26,15 +35,6 @@
import org.mycore.user2.MCRUserManager;
import org.mycore.user2.utils.MCRUserTransformer;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.util.JAXBSource;
-import javax.xml.transform.Source;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.URIResolver;
-import java.util.List;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
/**
* Resolves a User by connection id
*/
diff --git a/ubo-common/src/main/java/org/mycore/ubo/basket/BasketName2PIDEditor.java b/ubo-common/src/main/java/org/mycore/ubo/basket/BasketName2PIDEditor.java
index 782b1a061..55185c587 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/basket/BasketName2PIDEditor.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/basket/BasketName2PIDEditor.java
@@ -13,11 +13,8 @@
import java.util.List;
import java.util.Map;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.mycore.ubo.AccessControl;
-import org.mycore.ubo.DozBibEntryServlet;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jdom2.Document;
@@ -29,6 +26,8 @@
import org.mycore.frontend.basket.MCRBasketEntry;
import org.mycore.frontend.servlets.MCRServlet;
import org.mycore.frontend.servlets.MCRServletJob;
+import org.mycore.ubo.AccessControl;
+import org.mycore.ubo.DozBibEntryServlet;
/**
* Servlet invoked by edit-contributors.xml to
diff --git a/ubo-common/src/main/java/org/mycore/ubo/basket/Results2Basket.java b/ubo-common/src/main/java/org/mycore/ubo/basket/Results2Basket.java
index e740f6000..d08660a1d 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/basket/Results2Basket.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/basket/Results2Basket.java
@@ -9,9 +9,8 @@
package org.mycore.ubo.basket;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jdom2.Element;
diff --git a/ubo-common/src/main/java/org/mycore/ubo/dedup/DeDupCriteriaBuilder.java b/ubo-common/src/main/java/org/mycore/ubo/dedup/DeDupCriteriaBuilder.java
index c792b9e4e..c4176aeb7 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/dedup/DeDupCriteriaBuilder.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/dedup/DeDupCriteriaBuilder.java
@@ -20,7 +20,6 @@
import org.jdom2.Document;
import org.jdom2.Element;
-import org.jdom2.filter.ElementFilter;
import org.jdom2.filter.Filters;
import org.jdom2.xpath.XPathExpression;
import org.jdom2.xpath.XPathFactory;
diff --git a/ubo-common/src/main/java/org/mycore/ubo/importer/DozBibImportServlet.java b/ubo-common/src/main/java/org/mycore/ubo/importer/DozBibImportServlet.java
index 471ac927a..52447452b 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/importer/DozBibImportServlet.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/importer/DozBibImportServlet.java
@@ -13,10 +13,10 @@
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
import javax.xml.transform.TransformerException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.jdom2.Document;
import org.jdom2.Element;
import org.mycore.access.MCRAccessException;
diff --git a/ubo-common/src/main/java/org/mycore/ubo/importer/doi/DOI2XMLTransformer.java b/ubo-common/src/main/java/org/mycore/ubo/importer/doi/DOI2XMLTransformer.java
new file mode 100644
index 000000000..aa67e26c6
--- /dev/null
+++ b/ubo-common/src/main/java/org/mycore/ubo/importer/doi/DOI2XMLTransformer.java
@@ -0,0 +1,36 @@
+/**
+ * Copyright (c) 2017 Duisburg-Essen University Library
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Public License v2.0
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ **/
+
+package org.mycore.ubo.importer.doi;
+
+import java.io.IOException;
+import java.util.Arrays;
+
+import org.jdom2.Document;
+import org.jdom2.Element;
+import org.mycore.common.content.MCRContent;
+import org.mycore.common.content.MCRJDOMContent;
+import org.mycore.common.content.transformer.MCRContentTransformer;
+
+public class DOI2XMLTransformer extends MCRContentTransformer {
+
+ @Override
+ public MCRJDOMContent transform(MCRContent source) throws IOException {
+ Element root = new Element("list");
+ Document xml = new Document(root);
+
+ Arrays.stream(source.asString().split("\\s")).filter(p -> p.trim().length() > 0)
+ .forEach(doi -> {
+ Element e = new Element("doi");
+ e.setText(doi);
+ root.addContent(e);
+ });
+ return new MCRJDOMContent(xml);
+ }
+}
diff --git a/ubo-common/src/main/java/org/mycore/ubo/importer/evaluna/EvalunaImportJob.java b/ubo-common/src/main/java/org/mycore/ubo/importer/evaluna/EvalunaImportJob.java
index 628f3217f..dc4d6b86d 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/importer/evaluna/EvalunaImportJob.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/importer/evaluna/EvalunaImportJob.java
@@ -11,7 +11,6 @@
import org.jdom2.Element;
import org.mycore.common.content.MCRContent;
-
import org.mycore.ubo.importer.ImportJob;
public class EvalunaImportJob extends ImportJob {
diff --git a/ubo-common/src/main/java/org/mycore/ubo/importer/scopus/ScopusUpdater.java b/ubo-common/src/main/java/org/mycore/ubo/importer/scopus/ScopusUpdater.java
index 00aa5bf3a..1f3e1809e 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/importer/scopus/ScopusUpdater.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/importer/scopus/ScopusUpdater.java
@@ -1,11 +1,5 @@
package org.mycore.ubo.importer.scopus;
-import java.net.URLEncoder;
-import java.nio.charset.StandardCharsets;
-import java.time.Instant;
-import java.time.MonthDay;
-import java.time.temporal.TemporalAmount;
-import java.time.temporal.TemporalUnit;
import java.util.Arrays;
import java.util.Calendar;
import java.util.GregorianCalendar;
diff --git a/ubo-common/src/main/java/org/mycore/ubo/ldap/picker/LDAPPIDSearch.java b/ubo-common/src/main/java/org/mycore/ubo/ldap/picker/LDAPPIDSearch.java
index 88d01dbb4..298ba4657 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/ldap/picker/LDAPPIDSearch.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/ldap/picker/LDAPPIDSearch.java
@@ -7,10 +7,10 @@
import java.util.HashMap;
import java.util.Map;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
import javax.xml.transform.TransformerException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -19,9 +19,8 @@
import org.mycore.common.xml.MCRURIResolver;
import org.mycore.frontend.servlets.MCRServlet;
import org.mycore.frontend.servlets.MCRServletJob;
-import org.xml.sax.SAXException;
-
import org.mycore.ubo.picker.IdentityPickerService;
+import org.xml.sax.SAXException;
/**
* Servlet that handles requests when the LDAP strategy is configured in the mycore.properties:
diff --git a/ubo-common/src/main/java/org/mycore/ubo/ldap/picker/LDAPService.java b/ubo-common/src/main/java/org/mycore/ubo/ldap/picker/LDAPService.java
index 984a7d81a..257e47533 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/ldap/picker/LDAPService.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/ldap/picker/LDAPService.java
@@ -2,7 +2,6 @@
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
@@ -17,11 +16,11 @@
import javax.naming.OperationNotSupportedException;
+import com.google.common.collect.Multimap;
import org.apache.commons.text.similarity.LevenshteinDistance;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jdom2.Element;
-import org.jdom2.output.XMLOutputter;
import org.mycore.common.MCRSession;
import org.mycore.common.MCRSessionMgr;
import org.mycore.common.config.MCRConfiguration2;
@@ -31,8 +30,6 @@
import org.mycore.ubo.picker.PersonSearchResult;
import org.mycore.user2.MCRUserAttribute;
-import com.google.common.collect.Multimap;
-
/**
* With a configuration in mycore.properties, it is necessary to map two of the input fields of the search/pick-form,
* "lastName" and "firstName" (see ldappidsearch.xsl) to corresponding fields of the LDAP documents, for
@@ -210,7 +207,7 @@ public PersonSearchResult searchPerson(String query) throws OperationNotSupporte
.filter(user -> user.isUserInRole("admin")).isPresent();
persons.forEach(person-> {
- PersonSearchResult.PersonResult pr = new PersonSearchResult.PersonResult();
+ PersonSearchResult.PersonResult pr = new PersonSearchResult.PersonResult(this);
pr.firstName = person.getChildText("firstName");
pr.lastName = person.getChildText("lastName");
pr.displayName = pr.firstName + ((pr.lastName != null) ? " " + pr.lastName : "");
diff --git a/ubo-common/src/main/java/org/mycore/ubo/ldap/picker/LDAPWithLocalService.java b/ubo-common/src/main/java/org/mycore/ubo/ldap/picker/LDAPWithLocalService.java
index 21ee10978..fd5d963ce 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/ldap/picker/LDAPWithLocalService.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/ldap/picker/LDAPWithLocalService.java
@@ -10,9 +10,9 @@ public class LDAPWithLocalService extends LDAPService {
@Override
public PersonSearchResult searchPerson(String query) throws OperationNotSupportedException {
PersonSearchResult results = super.searchPerson(query);
- LocalService ls = new LocalService();
- PersonSearchResult localSr = ls.searchPerson(query);
- results.personList.addAll(0, localSr.personList);
+ LocalService localService = new LocalService();
+ PersonSearchResult personSearchResult = localService.searchPerson(query);
+ results.join(personSearchResult, 0);
return results;
}
}
diff --git a/ubo-common/src/main/java/org/mycore/ubo/local/LocalPIDSearch.java b/ubo-common/src/main/java/org/mycore/ubo/local/LocalPIDSearch.java
index c14e1ecd2..c58c4579e 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/local/LocalPIDSearch.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/local/LocalPIDSearch.java
@@ -21,10 +21,10 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
import javax.xml.transform.TransformerException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jdom2.Element;
diff --git a/ubo-common/src/main/java/org/mycore/ubo/local/LocalSearcher.java b/ubo-common/src/main/java/org/mycore/ubo/local/LocalSearcher.java
index 00ae503b5..1b8040547 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/local/LocalSearcher.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/local/LocalSearcher.java
@@ -1,13 +1,13 @@
package org.mycore.ubo.local;
+import java.util.List;
+import java.util.Optional;
+
import org.jdom2.Element;
import org.mycore.user2.MCRUser;
import org.mycore.user2.MCRUserAttribute;
import org.mycore.user2.MCRUserManager;
-import java.util.List;
-import java.util.Optional;
-
public class LocalSearcher {
private static final String FIRST_NAME_ELEMENT_NAME = "firstName";
diff --git a/ubo-common/src/main/java/org/mycore/ubo/local/LocalService.java b/ubo-common/src/main/java/org/mycore/ubo/local/LocalService.java
index 1eebac11d..caf33a420 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/local/LocalService.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/local/LocalService.java
@@ -5,6 +5,8 @@
import java.util.Map;
import java.util.stream.Collectors;
+import javax.naming.OperationNotSupportedException;
+
import org.jdom2.Element;
import org.mycore.common.config.MCRConfiguration2;
import org.mycore.ubo.picker.IdentityService;
@@ -13,8 +15,6 @@
import org.mycore.user2.MCRUserAttribute;
import org.mycore.user2.MCRUserManager;
-import javax.naming.OperationNotSupportedException;
-
public class LocalService implements IdentityService {
private final String USER_FIRST_NAME_ATTR = "firstName";
@@ -23,6 +23,9 @@ public class LocalService implements IdentityService {
private final String LEAD_ID = MCRConfiguration2.getStringOrThrow("MCR.user2.matching.lead_id");
+ private final boolean ENFORCE_LEAD_ID_PRESENT = MCRConfiguration2.getBoolean(
+ "MCR.IdentityPicker.strategy.Local.PID.Filter.enabled").orElse(true);
+
@Override
public Element getPersonDetails(Map paramMap) {
return null;
@@ -41,7 +44,7 @@ public PersonSearchResult searchPerson(String query) throws OperationNotSupporte
final List matchingUsers = MCRUserManager.listUsers(null, "local", displayName, null);
List personResults = matchingUsers.stream().map(user -> {
- PersonSearchResult.PersonResult personSearchResult = new PersonSearchResult.PersonResult();
+ PersonSearchResult.PersonResult personSearchResult = new PersonSearchResult.PersonResult(this);
personSearchResult.pid = user.getUserAttribute("id_" + LEAD_ID);
personSearchResult.displayName = user.getRealName().length() > 0 ? user.getRealName() : user.getUserName();
@@ -67,7 +70,7 @@ public PersonSearchResult searchPerson(String query) throws OperationNotSupporte
}
return personSearchResult;
- }).filter(psr -> psr.pid != null && !psr.pid.isEmpty())
+ }).filter(psr -> (psr.pid != null && !psr.pid.isEmpty()) || !ENFORCE_LEAD_ID_PRESENT)
.collect(Collectors.toList());
PersonSearchResult personSearchResult = new PersonSearchResult();
diff --git a/ubo-common/src/main/java/org/mycore/ubo/login/CascadingLoginServlet.java b/ubo-common/src/main/java/org/mycore/ubo/login/CascadingLoginServlet.java
index e2990ab16..a2b202dfa 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/login/CascadingLoginServlet.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/login/CascadingLoginServlet.java
@@ -1,8 +1,7 @@
package org.mycore.ubo.login;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jdom2.Document;
diff --git a/ubo-common/src/main/java/org/mycore/ubo/lsf/LSFPIDSearch.java b/ubo-common/src/main/java/org/mycore/ubo/lsf/LSFPIDSearch.java
index f4c720f22..b96232448 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/lsf/LSFPIDSearch.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/lsf/LSFPIDSearch.java
@@ -15,17 +15,17 @@
import java.util.HashMap;
import java.util.Map;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
import javax.xml.transform.TransformerException;
-import org.mycore.ubo.picker.IdentityPickerService;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jdom2.Element;
import org.mycore.common.content.MCRJDOMContent;
import org.mycore.frontend.servlets.MCRServlet;
import org.mycore.frontend.servlets.MCRServletJob;
+import org.mycore.ubo.picker.IdentityPickerService;
import org.xml.sax.SAXException;
public class LSFPIDSearch extends MCRServlet implements IdentityPickerService {
diff --git a/ubo-common/src/main/java/org/mycore/ubo/lsf/LSFService.java b/ubo-common/src/main/java/org/mycore/ubo/lsf/LSFService.java
index 798d25857..37e3f53a6 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/lsf/LSFService.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/lsf/LSFService.java
@@ -22,13 +22,9 @@
import java.util.Locale;
import java.util.Map;
import java.util.Set;
-import java.util.stream.Collectors;
-import org.mycore.ubo.picker.IdentityService;
-import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
-import org.glassfish.jersey.uri.UriComponent;
import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.filter.Filters;
@@ -38,14 +34,11 @@
import org.jdom2.xpath.XPathExpression;
import org.jdom2.xpath.XPathFactory;
import org.mycore.common.MCRException;
-import org.mycore.common.content.MCRJDOMContent;
import org.mycore.common.config.MCRConfiguration2;
import org.mycore.mods.merger.MCRHyphenNormalizer;
+import org.mycore.ubo.picker.IdentityService;
import org.mycore.ubo.picker.PersonSearchResult;
-import javax.naming.OperationNotSupportedException;
-import javax.ws.rs.core.MultivaluedMap;
-
/**
* Implements a Web Services client for HIS LSF.
* Allows searching for person data and retrieving details.
@@ -245,7 +238,7 @@ private void lookup(String firstName, String lastName, List attributes = object.getChildren("attribute");
for (Element attribute : attributes) {
diff --git a/ubo-common/src/main/java/org/mycore/ubo/matcher/MCRUserMatcherUtils.java b/ubo-common/src/main/java/org/mycore/ubo/matcher/MCRUserMatcherUtils.java
index 1ef9a9e99..48bbd4720 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/matcher/MCRUserMatcherUtils.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/matcher/MCRUserMatcherUtils.java
@@ -22,13 +22,12 @@
import org.mycore.datamodel.metadata.MCRObject;
import org.mycore.mods.MCRMODSWrapper;
import org.mycore.orcid.user.MCRORCIDUser;
+import org.mycore.ubo.ldap.LDAPObject;
import org.mycore.user2.MCRRealmFactory;
import org.mycore.user2.MCRUser;
import org.mycore.user2.MCRUser2Constants;
import org.mycore.user2.MCRUserAttribute;
-import org.mycore.ubo.ldap.LDAPObject;
-
/**
* Utility class for everything related to matching users of publications in MODS-format with MCRUsers and other
diff --git a/ubo-common/src/main/java/org/mycore/ubo/obfuscation/ObfuscationEventHandler.java b/ubo-common/src/main/java/org/mycore/ubo/obfuscation/ObfuscationEventHandler.java
index 0279f632a..96eec46a8 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/obfuscation/ObfuscationEventHandler.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/obfuscation/ObfuscationEventHandler.java
@@ -16,12 +16,11 @@
import org.mycore.common.events.MCREvent;
import org.mycore.common.events.MCREventHandlerBase;
import org.mycore.datamodel.metadata.MCRObject;
+import org.mycore.ubo.matcher.MCRUserMatcherUtils;
import org.mycore.user2.MCRUser;
import org.mycore.user2.MCRUserAttribute;
import org.mycore.user2.MCRUserManager;
-import org.mycore.ubo.matcher.MCRUserMatcherUtils;
-
/**
* EventHandler for obfuscation of nameIdentifiers
*
diff --git a/ubo-common/src/main/java/org/mycore/ubo/picker/IdentityPicker.java b/ubo-common/src/main/java/org/mycore/ubo/picker/IdentityPicker.java
index 96bc970aa..3c7f4e9e9 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/picker/IdentityPicker.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/picker/IdentityPicker.java
@@ -1,5 +1,14 @@
package org.mycore.ubo.picker;
+import java.io.IOException;
+import java.net.URLDecoder;
+import java.nio.charset.StandardCharsets;
+import java.util.Map;
+import java.util.Optional;
+
+import javax.xml.transform.TransformerException;
+
+import jakarta.servlet.http.HttpServletRequest;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jdom2.Document;
@@ -14,16 +23,6 @@
import org.mycore.services.i18n.MCRTranslation;
import org.xml.sax.SAXException;
-import javax.servlet.http.HttpServletRequest;
-import javax.xml.transform.TransformerException;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.nio.charset.StandardCharsets;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Optional;
-
public class IdentityPicker extends MCRServlet {
diff --git a/ubo-common/src/main/java/org/mycore/ubo/picker/IdentityService.java b/ubo-common/src/main/java/org/mycore/ubo/picker/IdentityService.java
index e956a64dc..9bcdfe60a 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/picker/IdentityService.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/picker/IdentityService.java
@@ -1,12 +1,11 @@
package org.mycore.ubo.picker;
-
import java.util.Map;
-import org.jdom2.Element;
-
import javax.naming.OperationNotSupportedException;
+import org.jdom2.Element;
+
public interface IdentityService {
public Element getPersonDetails(Map paramMap);
diff --git a/ubo-common/src/main/java/org/mycore/ubo/picker/PersonSearchResult.java b/ubo-common/src/main/java/org/mycore/ubo/picker/PersonSearchResult.java
index 5e74c0da8..7b51bc488 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/picker/PersonSearchResult.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/picker/PersonSearchResult.java
@@ -26,8 +26,17 @@ public class PersonSearchResult {
public List personList;
+ public static class PersonResult {
+
+ public PersonResult(IdentityService identityService){
+ this.service = identityService.getClass().getSimpleName();
+ }
+
+ /**
+ * The service this result was provided by
+ * */
+ public String service;
- public static class PersonResult {
/**
* The Identifier of the person [Required]
*/
@@ -58,5 +67,28 @@ public static class PersonResult {
*/
public List information;
}
+
+ /**
+ * Joins another {@link PersonSearchResult} with the current {@link PersonSearchResult}. The count field is updated
+ * automatically.
+ *
+ * @param other the {@link PersonSearchResult} to join.
+ * */
+ public void join(PersonSearchResult other) {
+ join(other, personList.size() - 1);
+ }
+
+ /**
+ * Joins another {@link PersonSearchResult} with the current {@link PersonSearchResult}. The count field is updated
+ * automatically.
+ *
+ * @param other the {@link PersonSearchResult} to join.
+ * @param index index at which to insert the first element from the specified {@link PersonSearchResult}
+ * */
+ public void join(PersonSearchResult other, int index) {
+ this.personList.addAll(index, other.personList);
+ this.count += other.count;
+ }
+
}
diff --git a/ubo-common/src/main/java/org/mycore/ubo/publication/PublicationEventHandler.java b/ubo-common/src/main/java/org/mycore/ubo/publication/PublicationEventHandler.java
index 42a5f0aae..b8eb78d45 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/publication/PublicationEventHandler.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/publication/PublicationEventHandler.java
@@ -19,14 +19,13 @@
import org.mycore.common.events.MCREvent;
import org.mycore.common.events.MCREventHandlerBase;
import org.mycore.datamodel.metadata.MCRObject;
-import org.mycore.user2.MCRUser;
-import org.mycore.user2.MCRUserAttribute;
-import org.mycore.user2.MCRUserManager;
-
import org.mycore.ubo.matcher.MCRUserMatcher;
import org.mycore.ubo.matcher.MCRUserMatcherDTO;
import org.mycore.ubo.matcher.MCRUserMatcherLocal;
import org.mycore.ubo.matcher.MCRUserMatcherUtils;
+import org.mycore.user2.MCRUser;
+import org.mycore.user2.MCRUserAttribute;
+import org.mycore.user2.MCRUserManager;
/**
diff --git a/ubo-common/src/main/java/org/mycore/ubo/relations/RelationEditorServlet.java b/ubo-common/src/main/java/org/mycore/ubo/relations/RelationEditorServlet.java
index 6a644970d..860f16f5e 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/relations/RelationEditorServlet.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/relations/RelationEditorServlet.java
@@ -3,9 +3,8 @@
import java.io.IOException;
import java.util.List;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jdom2.Element;
diff --git a/ubo-common/src/main/java/org/mycore/ubo/resources/UBOExportResource.java b/ubo-common/src/main/java/org/mycore/ubo/resources/UBOExportResource.java
index 2b78e43d5..e877c3426 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/resources/UBOExportResource.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/resources/UBOExportResource.java
@@ -29,14 +29,14 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
+import com.google.gson.Gson;
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.PathParam;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.QueryParam;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jdom2.Element;
@@ -45,9 +45,6 @@
import org.mycore.common.xml.MCRURIResolver;
import org.mycore.frontend.MCRFrontendUtil;
-import com.google.gson.Gson;
-
-
@Path("export")
public class UBOExportResource {
@@ -64,10 +61,13 @@ private static String encode(String s) {
return URLEncoder.encode(s, StandardCharsets.UTF_8);
}
+ protected static final String STATUS_RESTRICTION = MCRConfiguration2.getString("UBO.Export.Status.Restriction")
+ .orElse("+status:confirmed");
+
@GET
@Path("styles")
@Produces(MediaType.APPLICATION_JSON)
- public Response listStyles(){
+ public Response listStyles() {
String[] styles = MCRConfiguration2.getStringOrThrow("MCR.Export.CSL.Styles").split(",");
List result = new ArrayList<>(styles.length);
@@ -75,10 +75,10 @@ public Response listStyles(){
Element element = MCRURIResolver.instance().resolve("resource:" + style + ".csl");
String title = Optional.ofNullable(element.getChild("info", CSL_NAMESPACE))
- .map(el -> Optional.ofNullable(el.getChild("title", CSL_NAMESPACE)))
- .filter(Optional::isPresent)
- .map(Optional::get)
- .map(Element::getTextNormalize).orElse(style);
+ .map(el -> Optional.ofNullable(el.getChild("title", CSL_NAMESPACE)))
+ .filter(Optional::isPresent)
+ .map(Optional::get)
+ .map(Element::getTextNormalize).orElse(style);
CSLEntry cslEntry = new CSLEntry(style, title);
result.add(cslEntry);
@@ -120,7 +120,7 @@ public Response link(
yearPart = "";
}
- if(yearNew != null) {
+ if (yearNew != null) {
yearPart = "+year:" + yearNew + " ";
}
@@ -135,7 +135,7 @@ public Response link(
childFilterQuery += " +role:(" + String.join(" OR ", ROLES) + ")";
}
- String solrQuery = "+status:confirmed " + yearPart + partOfPart
+ String solrQuery = UBOExportResource.STATUS_RESTRICTION + " " + yearPart + partOfPart
+ "+{!parent which=\"objectType:mods\" filters=$childfq}objectKind:name";
StringBuilder solrRequest = new StringBuilder()
@@ -177,6 +177,7 @@ public CSLEntry(String id, String title) {
}
public String id;
+
public String title;
}
}
diff --git a/ubo-common/src/main/java/org/mycore/ubo/resources/UBOPersonSearchResource.java b/ubo-common/src/main/java/org/mycore/ubo/resources/UBOPersonSearchResource.java
index 9dc3aae52..3b9a9c6c6 100644
--- a/ubo-common/src/main/java/org/mycore/ubo/resources/UBOPersonSearchResource.java
+++ b/ubo-common/src/main/java/org/mycore/ubo/resources/UBOPersonSearchResource.java
@@ -19,12 +19,12 @@
package org.mycore.ubo.resources;
import javax.naming.OperationNotSupportedException;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Response;
import com.google.gson.Gson;
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.QueryParam;
+import jakarta.ws.rs.core.Response;
import org.mycore.access.MCRAccessManager;
import org.mycore.common.config.MCRConfiguration2;
import org.mycore.ubo.picker.IdentityService;
diff --git a/ubo-common/src/main/resources/META-INF/resources/import-list.xed b/ubo-common/src/main/resources/META-INF/resources/import-list.xed
index 4dcf6e183..37731b024 100644
--- a/ubo-common/src/main/resources/META-INF/resources/import-list.xed
+++ b/ubo-common/src/main/resources/META-INF/resources/import-list.xed
@@ -60,10 +60,8 @@
diff --git a/ubo-common/src/main/resources/META-INF/resources/index.xed b/ubo-common/src/main/resources/META-INF/resources/index.xed
index ae1bb1d1c..642529ea1 100644
--- a/ubo-common/src/main/resources/META-INF/resources/index.xed
+++ b/ubo-common/src/main/resources/META-INF/resources/index.xed
@@ -77,12 +77,12 @@
-
+