diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index b98c3925..68be4353 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -10,7 +10,7 @@ jobs:
uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v3
with:
ff-site-goal: ''
- ff-os: 'ubuntu-22.04'
+ ff-os: 'ubuntu-24.04'
ff-jdk: '17'
ff-goal: '-P run-its verify'
ff-site-run: false
@@ -26,5 +26,5 @@ jobs:
{"os": "windows-latest"},
{"jdk": "8"},
{"jdk": "11"},
- {"os": "ubuntu-latest", "jdk": "17"}
+ {"os": "ubuntu-latest", "jdk": "21"}
]
diff --git a/LICENSE.txt b/LICENSE.txt
index 94a9ed02..f288702d 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see .
+ along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
@@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
-.
+.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
-.
+.
diff --git a/README.md b/README.md
index 41cbd2e4..f23835a2 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,36 @@ DBT (acronym for Digitale Bibliothek Thüringen) is an open source repository so
## Git-Style-Guide
For the moment see [agis-:Git-Style-Guide](https://github.com/agis-/git-style-guide) and use it with the following exceptions:
- - Subject to commits is in form: `{JIRA-Ticket} {Ticket summary} {Commit summary}`, like `DBT-104 GIT-Migration add .travis.yml`
- - Branch name to work on a ticket is in form: `issues/{JIRA-Ticket}-{Ticket Summary}`, like `issues/DBT-104-GIT-Migration`
+- Subject to commits is in form: `{JIRA-Ticket} {Ticket summary} {Commit summary}`, like `DBT-104 GIT-Migration add .travis.yml`
+- Branch name to work on a ticket is in form: `issues/{JIRA-Ticket}-{Ticket Summary}`, like `issues/DBT-104-GIT-Migration`
-Stay tuned for more information. :bow:
\ No newline at end of file
+---
+
+## Installation instructions for developers
+
+1. **Build JAR**:
+ - Run:
+ `mvn clean install`
+
+
+2. **Deploy the JAR File**:
+ - Move the generated JAR file (located in `dbt/target`) to the `lib` folder in your home directory.
+ For example: `~/.mycore/dev-mir/lib`
+
+
+3. **Update Solr Core Names**:
+ - Change the Solr core names from `mir` and `mir-classifications` to `dbt` and `dbt-classifications` using your Solr Admin UI.
+ - Restart your Solr server.
+
+
+4. **Launch and Setup DBT**:
+ - After starting your MIR, the DBT interface will launch.
+ - Log in as the administrator (Superuser) and navigate in the User menu to "Edit Classifications".
+ - Import all files from `src/main/resources/setup/classifications` for DBT to function correctly.
+ - Reload main and classifications in the WebCLI if needed.
+
+ `reload solr configuration main in core main`
+
+ `reload solr configuration classification in core classification`
+---
+Stay tuned for more information. :bow:
diff --git a/pom.xml b/pom.xml
index aea94c23..f1272a36 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
org.mycore
mycore-parent
- 52-SNAPSHOT
+ 53
dbt-module
2023.06-SNAPSHOT
diff --git a/src/main/java/de/urmel_dl/dbt/common/DBTVersion.java b/src/main/java/de/urmel_dl/dbt/common/DBTVersion.java
index fc725f47..a7888eb2 100644
--- a/src/main/java/de/urmel_dl/dbt/common/DBTVersion.java
+++ b/src/main/java/de/urmel_dl/dbt/common/DBTVersion.java
@@ -21,7 +21,8 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.UncheckedIOException;
-import java.net.URL;
+import java.net.URI;
+import java.net.URISyntaxException;
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
@@ -55,8 +56,13 @@ public static String getVersion() {
private static Properties loadVersionProperties() {
Properties props = new Properties();
- URL gitPropURL = MIRCoreVersion.class.getResource("/de/urmel_dl/dbt/git.properties");
- try (InputStream gitPropStream = getInputStream(gitPropURL);) {
+ URI gitPropURI;
+ try {
+ gitPropURI = MIRCoreVersion.class.getResource("/de/urmel_dl/dbt/git.properties").toURI();
+ } catch (URISyntaxException e) {
+ throw new RuntimeException(e);
+ }
+ try (InputStream gitPropStream = getInputStream(gitPropURI);) {
props.load(gitPropStream);
} catch (IOException e) {
throw new UncheckedIOException("Error while initializing DBTVersion.", e);
@@ -64,16 +70,16 @@ private static Properties loadVersionProperties() {
return props;
}
- private static InputStream getInputStream(URL gitPropURL) throws IOException {
- if (gitPropURL == null) {
+ private static InputStream getInputStream(URI gitPropURI) throws IOException {
+ if (gitPropURI == null) {
return new InputStream() {
@Override
- public int read() throws IOException {
+ public int read() {
return -1;
}
};
}
- return gitPropURL.openStream();
+ return gitPropURI.toURL().openStream();
}
public static String getBranch() {
diff --git a/src/main/java/de/urmel_dl/dbt/filter/VideoDirectLinkFilter.java b/src/main/java/de/urmel_dl/dbt/filter/VideoDirectLinkFilter.java
index 5bdfc43b..5f544a60 100644
--- a/src/main/java/de/urmel_dl/dbt/filter/VideoDirectLinkFilter.java
+++ b/src/main/java/de/urmel_dl/dbt/filter/VideoDirectLinkFilter.java
@@ -19,10 +19,8 @@
import java.io.IOException;
import java.io.UnsupportedEncodingException;
-import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
-import java.net.URL;
import java.net.URLDecoder;
import java.nio.file.Files;
import java.util.Arrays;
@@ -109,7 +107,7 @@ private boolean validateReferrer(final HttpServletRequest httpServletRequest) {
return false;
}
try {
- final String pathInfo = new URL(referrer).getPath();
+ final String pathInfo = URI.create(referrer).getPath();
if (PATTERN_ALLOWED_REFERRER.matcher(pathInfo).matches()) {
Optional optDerId = Arrays.stream(pathInfo.split("/"))
.filter(f -> PATTERN_DERIVATE_ID.matcher(f).matches())
@@ -122,7 +120,7 @@ private boolean validateReferrer(final HttpServletRequest httpServletRequest) {
return Files.exists(MCRPath.getPath(derivateId, fileName));
}
}
- } catch (MalformedURLException | UnsupportedEncodingException e) {
+ } catch (UnsupportedEncodingException e) {
LOGGER.error("Couldn't parse referrer " + referrer + ".", e);
}
return false;
diff --git a/src/main/java/de/urmel_dl/dbt/media/MediaService.java b/src/main/java/de/urmel_dl/dbt/media/MediaService.java
index 56922a6e..27a9578f 100644
--- a/src/main/java/de/urmel_dl/dbt/media/MediaService.java
+++ b/src/main/java/de/urmel_dl/dbt/media/MediaService.java
@@ -27,7 +27,6 @@
import java.io.UncheckedIOException;
import java.math.BigInteger;
import java.net.URI;
-import java.net.URL;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import java.nio.charset.StandardCharsets;
@@ -506,10 +505,9 @@ public void run() {
Path tmpFile = Files.createTempDirectory("media").resolve(job.getId() + ".zip");
try {
- URL website = new URL(SERVER_ADDRESS + new MessageFormat(CONVERTER_DOWNLOAD_PATH, Locale.ROOT)
+ URI website = URI.create(SERVER_ADDRESS + new MessageFormat(CONVERTER_DOWNLOAD_PATH, Locale.ROOT)
.format(new Object[] { job.getId().replaceAll(" ", "%20") }));
- ReadableByteChannel rbc = Channels.newChannel(website.openStream());
-
+ ReadableByteChannel rbc = Channels.newChannel(website.toURL().openStream());
try (FileOutputStream fos = new FileOutputStream(tmpFile.toFile())) {
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
}
diff --git a/src/main/java/de/urmel_dl/dbt/migration/MigrationCommands.java b/src/main/java/de/urmel_dl/dbt/migration/MigrationCommands.java
index 4e21815e..38e81e58 100644
--- a/src/main/java/de/urmel_dl/dbt/migration/MigrationCommands.java
+++ b/src/main/java/de/urmel_dl/dbt/migration/MigrationCommands.java
@@ -19,7 +19,7 @@
import java.io.File;
import java.io.IOException;
-import java.net.URL;
+import java.net.URI;
import java.nio.file.Files;
import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
@@ -63,7 +63,8 @@ public class MigrationCommands extends MCRAbstractCommands {
@MCRCommand(syntax = "fix objects for base {0} with file {1}",
help = "transforms all mycore objects for base {0} with the given file or URL {1}")
public static List xsltObjects(final String base, final String xslFile) throws Exception {
- URL styleFile = MigrationCommands.class.getResource("/xsl/" + xslFile);
+ URI styleFile = MigrationCommands.class.getResource("/xsl/" + xslFile).toURI();
+
if (styleFile == null) {
final File file = new File(xslFile);
@@ -72,7 +73,7 @@ public static List xsltObjects(final String base, final String xslFile)
return null;
}
- styleFile = file.toURI().toURL();
+ styleFile = file.toURI();
}
List cmds = new ArrayList();
diff --git a/src/main/java/de/urmel_dl/dbt/opc/OPCConnector.java b/src/main/java/de/urmel_dl/dbt/opc/OPCConnector.java
index 3ed0b756..76242fc7 100644
--- a/src/main/java/de/urmel_dl/dbt/opc/OPCConnector.java
+++ b/src/main/java/de/urmel_dl/dbt/opc/OPCConnector.java
@@ -24,7 +24,7 @@
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.ProtocolException;
-import java.net.URL;
+import java.net.URI;
import java.net.URLEncoder;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
@@ -82,7 +82,7 @@ public class OPCConnector {
private String db;
- private URL url = new URL(GVK_URL);
+ private URI uri = URI.create(GVK_URL);
private int maxhits = 500;
@@ -93,24 +93,24 @@ public class OPCConnector {
/**
* Creates a new OPC connection.
*
- * @param url the URL
+ * @param uri the URL
* @param db the database
* @throws Exception thrown on malformed url
*/
- public OPCConnector(final URL url, final String db) throws Exception {
- this.url = url;
+ public OPCConnector(final URI uri, final String db) throws Exception {
+ this.uri = uri;
this.db = (db == null) ? "1" : db;
}
/**
* Creates a new OPC connection.
*
- * @param url the URL
+ * @param uri the URL
* @param db the database
- * @throws MalformedURLException thrown on malformed url
+ * @throws MalformedURLException thrown on malformed uri
*/
- public OPCConnector(final String url, final String db) throws MalformedURLException {
- this.url = new URL(url);
+ public OPCConnector(final String uri, final String db) throws MalformedURLException {
+ this.uri = URI.create(uri);
this.db = (db == null) ? "1" : db;
}
@@ -121,7 +121,7 @@ public OPCConnector(final String url, final String db) throws MalformedURLExcept
* @throws MalformedURLException thrown on malformed url
*/
public OPCConnector() throws MalformedURLException {
- this.url = new URL(GVK_URL);
+ this.uri = URI.create(GVK_URL);
this.db = GVK_DB;
}
@@ -144,31 +144,31 @@ public String getDB() {
}
/**
- * Set the URL.
+ * Set the URI.
*
- * @param url the URL
- * @throws MalformedURLException thrown on malformed url
+ * @param uri the URI
+ * @throws MalformedURLException thrown on malformed uri
*/
- public void setURL(final String url) throws MalformedURLException {
- this.url = new URL(url);
+ public void setURL(final String uri) throws MalformedURLException {
+ this.uri = URI.create(uri);
}
/**
- * Set the URL
+ * Set the URI
*
- * @param url the URL
+ * @param uri the URI
*/
- public void setURL(final URL url) {
- this.url = url;
+ public void setURL(final URI uri) {
+ this.uri = uri;
}
/**
- * Return the OPC URL.
+ * Return the OPC URI.
*
- * @return the OPC URL
+ * @return the OPC URI
*/
- public URL getURL() {
- return url;
+ public URI getURL() {
+ return uri;
}
/**
@@ -229,20 +229,20 @@ public long getConnectionTimeout() {
* Returns the list of IKTs for the OPC.
*
* @return the list of ikts
- * @see IKTList#IKTList()
+ * @see IKTList
* @throws ExecutionException if cache couldn't generated
*/
public IKTList getIKTList() throws ExecutionException {
- if (this.url == null) {
+ if (this.uri == null) {
throw new IllegalArgumentException("No OPC URL was set.");
}
- final URL url = this.url;
+ final URI uri = this.uri;
IKTList iktList = (IKTList) CACHE.get(generateCacheKey("iktlist"), () -> {
- final URL pageURL = new URL(url + "/XML=1.0/MENUIKTLIST");
+ final URI pageURI = URI.create(uri + "/XML=1.0/MENUIKTLIST");
- final Document xml = new SAXBuilder().build(readContentFromUrl(pageURL));
+ final Document xml = new SAXBuilder().build(readContentFromUrl(pageURI));
final IKTList ikts = new IKTList();
@@ -281,21 +281,21 @@ public IKTList getIKTList() throws ExecutionException {
* @see Result#Result(OPCConnector)
*/
public Result search(final String trm, final String ikt) throws ExecutionException {
- if (this.url == null) {
+ if (this.uri == null) {
throw new IllegalArgumentException("No OPC URL was set.");
}
- final URL url = this.url;
+ final URI uri = this.uri;
final String db = this.db;
final int maxread = this.maxread;
Result result = (Result) CACHE.get(generateCacheKey(trm + "_" + ikt), () -> {
LOGGER.info("Search OPAC for \"" + trm + "\" with IKT \"" + ikt + "\"...");
- final URL pageURL = new URL(url + "/XML=1.0/DB=" + db + "/SET=1/TTL=1/CMD?ACT=SRCHA&IKT=" + ikt
+ final URI pageURI = URI.create(uri + "/XML=1.0/DB=" + db + "/SET=1/TTL=1/CMD?ACT=SRCHA&IKT=" + ikt
+ "&SRT=YOP&SHRTST=" + maxread + "&TRM=" + URLEncoder.encode(trm, "UTF-8"));
- final Document xml = new SAXBuilder().build(readContentFromUrl(pageURL));
+ final Document xml = new SAXBuilder().build(readContentFromUrl(pageURI));
return parseResult(xml);
});
@@ -325,20 +325,20 @@ public Result search(final String trm) throws ExecutionException {
* @see Result#Result(OPCConnector)
*/
public Result family(final String PPN) throws ExecutionException {
- if (this.url == null) {
+ if (this.uri == null) {
throw new IllegalArgumentException("No OPC URL was set.");
}
- final URL url = this.url;
+ final URI uri = this.uri;
final String db = this.db;
final int maxread = this.maxread;
Result result = (Result) CACHE.get(generateCacheKey("fam_" + PPN), () -> {
LOGGER.info("Enumarates member publications of PPN " + PPN);
- final URL pageURL = new URL(url + "/XML=1.0/DB=" + db + "/FAM?PPN=" + PPN + "&SHRTST=" + maxread);
+ final URI pageURI = URI.create(uri + "/XML=1.0/DB=" + db + "/FAM?PPN=" + PPN + "&SHRTST=" + maxread);
- final Document xml = new SAXBuilder().build(readContentFromUrl(pageURL));
+ final Document xml = new SAXBuilder().build(readContentFromUrl(pageURI));
return parseResult(xml);
});
@@ -386,9 +386,9 @@ private Result parseResult(final Document xml) throws JDOMException, IOException
LOGGER.info(" ...read part " + rc + "/" + (nums - 1) + " - " + pos + " to "
+ (pos + this.maxread > hits ? hits : pos + this.maxread));
- final URL pageURL = new URL(this.url + sessionpart + "/XML=1.0/NXT?FRST=" + pos + "&SHRTST="
+ final URI pageURI = URI.create(this.uri + sessionpart + "/XML=1.0/NXT?FRST=" + pos + "&SHRTST="
+ this.maxread + "&NORND=ON");
- final Document doc = new SAXBuilder().build(readContentFromUrl(pageURL));
+ final Document doc = new SAXBuilder().build(readContentFromUrl(pageURI));
entries = doc.getRootElement().getChildren("SET");
if (entries.size() == 1) {
@@ -413,11 +413,11 @@ private Result parseResult(final Document xml) throws JDOMException, IOException
}
private String getPicaPlus(final String PPN) throws ExecutionException {
- final URL url = this.url;
+ final URI uri = this.uri;
final String db = this.db;
String ppraw = (String) CACHE.get(generateCacheKey("raw_" + PPN),
- () -> readWebPageFromUrl(url + "/DB=" + db + "/PPN?PLAIN=ON&PPN=" + PPN));
+ () -> readWebPageFromUrl(uri + "/DB=" + db + "/PPN?PLAIN=ON&PPN=" + PPN));
LOGGER.debug("\n" + PicaCharDecoder.asHexString(ppraw));
@@ -425,7 +425,7 @@ private String getPicaPlus(final String PPN) throws ExecutionException {
}
/**
- * Return a set of {@link PPField#PPField()}.
+ * Return a set of {@link PPField}.
*
* @param PPN the PPN
* @return a set of PICA+ fields
@@ -475,10 +475,10 @@ public List getPPFields(final String PPN) throws ExecutionException {
}
/**
- * Return a new {@link Record#Record()}.
+ * Return a new {@link Record}.
*
* @param PPN the PPN
- * @return a new {@link Record#Record()}
+ * @return a new {@link Record}
* @throws ExecutionException if cache couldn't generated
*/
public Record getRecord(final String PPN) throws ExecutionException {
@@ -645,19 +645,19 @@ public String getPPNFromShelfMarkOrTitle(final String shelfMark, final boolean w
return null;
}
- private HttpURLConnection buildConnection(final URL url) throws IOException {
- return buildConnection(url, null);
+ private HttpURLConnection buildConnection(final URI uri) throws IOException {
+ return buildConnection(uri, null);
}
- private HttpURLConnection buildConnection(final URL url, final String cookies) throws IOException {
- return buildConnection(url, cookies, 0);
+ private HttpURLConnection buildConnection(final URI uri, final String cookies) throws IOException {
+ return buildConnection(uri, cookies, 0);
}
- private HttpURLConnection buildConnection(final URL url, final String cookies, int numRedirects)
+ private HttpURLConnection buildConnection(final URI uri, final String cookies, int numRedirects)
throws IOException {
- LOGGER.debug("Open URL: " + url.toExternalForm());
+ LOGGER.debug("Open URI: " + uri.toString());
- HttpURLConnection urlConn = (HttpURLConnection) url.openConnection();
+ HttpURLConnection urlConn = (HttpURLConnection) uri.toURL().openConnection();
urlConn.setConnectTimeout(this.connectionTimeout);
urlConn.setInstanceFollowRedirects(false);
@@ -679,10 +679,10 @@ private HttpURLConnection buildConnection(final URL url, final String cookies, i
if (redirect) {
if (numRedirects <= MAX_REDIRECTS) {
- URL newUrl = new URL(urlConn.getHeaderField("Location"));
+ URI newUri = URI.create(urlConn.getHeaderField("Location"));
+ String newCookies = urlConn.getHeaderField("Set-Cookie");
- LOGGER.debug("Redirect to URL : {} ({})", newUrl.toExternalForm(), numRedirects + 1);
- urlConn = buildConnection(newUrl, urlConn.getHeaderField("Set-Cookie"), numRedirects + 1);
+ urlConn = buildConnection(newUri, newCookies, numRedirects + 1);
} else {
throw new ProtocolException("Too many (" + numRedirects + ") redirects.");
}
@@ -691,14 +691,15 @@ private HttpURLConnection buildConnection(final URL url, final String cookies, i
return urlConn;
}
- private InputStream readContentFromUrl(final URL url) throws IOException {
- return buildConnection(url).getInputStream();
+
+ private InputStream readContentFromUrl(final URI uri) throws IOException {
+ return buildConnection(uri).getInputStream();
}
- private String readWebPageFromUrl(final String urlString) throws IOException {
+ private String readWebPageFromUrl(final String uriString) throws IOException {
String content = "";
- HttpURLConnection urlConn = buildConnection(new URL(urlString));
+ HttpURLConnection urlConn = buildConnection( URI.create(uriString));
final String encoding = (urlConn.getContentEncoding() != null ? urlConn.getContentEncoding()
: "ISO-8859-1");
@@ -718,7 +719,7 @@ private String readWebPageFromUrl(final String urlString) throws IOException {
}
private String generateCacheKey(final String key) {
- return this.url.getHost() + "_" + this.db + "-" + key;
+ return this.uri.getHost() + "_" + this.db + "-" + key;
}
static {
diff --git a/src/main/java/de/urmel_dl/dbt/opc/datamodel/Catalog.java b/src/main/java/de/urmel_dl/dbt/opc/datamodel/Catalog.java
index 88a2b9c7..5afc9f25 100644
--- a/src/main/java/de/urmel_dl/dbt/opc/datamodel/Catalog.java
+++ b/src/main/java/de/urmel_dl/dbt/opc/datamodel/Catalog.java
@@ -45,7 +45,7 @@ public class Catalog {
private boolean enabled;
- private OPACURL opc;
+ private OPACURI opc;
private OPCConnector opcConnector;
@@ -67,7 +67,7 @@ public Catalog() {
public OPCConnector getOPCConnector() {
if (opcConnector == null) {
try {
- opcConnector = new OPCConnector(opc.getURL().toString(), opc.getDB());
+ opcConnector = new OPCConnector(opc.getURI().toString(), opc.getDB());
} catch (final Exception e) {
return null;
}
@@ -156,10 +156,10 @@ public void setEnabled(final boolean enabled) {
* Returns the OPC configuration.
*
* @return the opc configuration
- * @see OPACURL#OPACURL()
+ * @see OPACURI#OPACURI()
*/
@XmlElement(name = "opc")
- public OPACURL getOPC() {
+ public OPACURI getOPC() {
return opc;
}
@@ -167,9 +167,9 @@ public OPACURL getOPC() {
* Set the OPC configuration.
*
* @param opc the opc configuration to set
- * @see OPACURL#OPACURL()
+ * @see OPACURI#OPACURI()
*/
- public void setOPC(final OPACURL opc) {
+ public void setOPC(final OPACURI opc) {
this.opc = opc;
}
@@ -181,7 +181,7 @@ public void setOPC(final OPACURL opc) {
* @throws MalformedURLException thrown on malformed url
*/
public void setOPC(final String url, final String db) throws MalformedURLException {
- this.opc = new OPACURL(url, db);
+ this.opc = new OPACURI(url, db);
}
/**
diff --git a/src/main/java/de/urmel_dl/dbt/opc/datamodel/OPACURL.java b/src/main/java/de/urmel_dl/dbt/opc/datamodel/OPACURI.java
similarity index 70%
rename from src/main/java/de/urmel_dl/dbt/opc/datamodel/OPACURL.java
rename to src/main/java/de/urmel_dl/dbt/opc/datamodel/OPACURI.java
index 060695e8..35f2fa17 100644
--- a/src/main/java/de/urmel_dl/dbt/opc/datamodel/OPACURL.java
+++ b/src/main/java/de/urmel_dl/dbt/opc/datamodel/OPACURI.java
@@ -18,7 +18,7 @@
package de.urmel_dl.dbt.opc.datamodel;
import java.net.MalformedURLException;
-import java.net.URL;
+import java.net.URI;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
@@ -27,60 +27,59 @@
import jakarta.xml.bind.annotation.XmlValue;
/**
- * The Class OPACURL.
+ * The Class OPACURI.
*
* @author Ren\u00E9 Adler (eagle)
*/
@XmlAccessorType(XmlAccessType.NONE)
-@XmlRootElement(name = "opacURL")
-public class OPACURL {
+@XmlRootElement(name = "opacURI")
+public class OPACURI {
- private URL url;
+ private URI uri;
private String db;
- protected OPACURL() {
+ protected OPACURI() {
}
/**
- * Instantiates a new opacurl.
+ * Instantiates a new opacuri.
*
- * @param url the url
+ * @param uri the uri
* @param db the db
*/
- public OPACURL(final URL url, final String db) {
- this.url = url;
+ public OPACURI(final URI uri, final String db) {
+ this.uri = uri;
this.db = db;
}
/**
- * Instantiates a new opacurl.
+ * Instantiates a new opacuri.
*
- * @param url the url
+ * @param uri the uri
* @param db the db
- * @throws MalformedURLException the malformed URL exception
*/
- public OPACURL(final String url, final String db) throws MalformedURLException {
- this(new URL(url), db);
+ public OPACURI(final String uri, final String db) {
+ this(URI.create(uri), db);
}
/**
- * Returns the URL.
+ * Returns the URI.
*
- * @return the url
+ * @return the uri
*/
@XmlValue
- public URL getURL() {
- return url;
+ public URI getURI() {
+ return uri;
}
/**
- * Set the URL.
+ * Set the URI.
*
- * @param url the url to set
+ * @param uri the uri to set
*/
- public void setURL(final URL url) {
- this.url = url;
+ public void setURI(final URI uri) {
+ this.uri = uri;
}
/**
diff --git a/src/main/java/de/urmel_dl/dbt/opc/datamodel/pica/Result.java b/src/main/java/de/urmel_dl/dbt/opc/datamodel/pica/Result.java
index 55508765..f214a0d8 100644
--- a/src/main/java/de/urmel_dl/dbt/opc/datamodel/pica/Result.java
+++ b/src/main/java/de/urmel_dl/dbt/opc/datamodel/pica/Result.java
@@ -17,6 +17,7 @@
*/
package de.urmel_dl.dbt.opc.datamodel.pica;
+import java.net.URI;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
@@ -63,7 +64,7 @@ protected void setConnection(final OPCConnector connection) {
}
@XmlAttribute(name = "url", required = true)
- public URL getURL() {
+ public URI getURL() {
return connection.getURL();
}
diff --git a/src/main/resources/META-INF/resources/config/navigation.xml b/src/main/resources/META-INF/resources/config/navigation.xml
index 0880863d..21075c72 100644
--- a/src/main/resources/META-INF/resources/config/navigation.xml
+++ b/src/main/resources/META-INF/resources/config/navigation.xml
@@ -106,17 +106,17 @@
fas fa-upload mr-1 d-none d-sm-inline-block d-lg-none
- -
-
-
+
-
+
+
-
- -
-
-
+
-
+
+
-
diff --git a/src/main/resources/META-INF/resources/dbt/js/mail-queue.js b/src/main/resources/META-INF/resources/dbt/js/mail-queue.js
index 3aa6dcfb..5c9e1931 100644
--- a/src/main/resources/META-INF/resources/dbt/js/mail-queue.js
+++ b/src/main/resources/META-INF/resources/dbt/js/mail-queue.js
@@ -1,7 +1,35 @@
-"use strict";
-
var appName = "MailQueue";
var app = angular.module(appName, [ "pascalprecht.translate", "angularModalService" ]);
+var translations = {}
+var token = null;
+
+
+function getToken(callback) {
+ $.ajax({
+ url: webApplicationBaseURL + "rsc/jwt",
+ type: "GET",
+ dataType: "json",
+ success: function (data) {
+ if (data.login_success) {
+ token = data.access_token;
+ callback();
+ } else {
+ console.error("Fehler: Nicht autorisiert");
+ }
+ },
+ error: function () {
+ console.error("Token-Anforderung fehlgeschlagen.");
+ }
+ });
+}
+
+app.config(['$translateProvider', function ($translateProvider) {
+ $translateProvider.translations('en', translations);
+ $translateProvider.preferredLanguage('en');
+ // Enable escaping of HTML
+ $translateProvider.useSanitizeValueStrategy('escape');
+}]);
+app.controller('Ctrl', ['$scope', function ($scope) {}]);
app.formatI18N = function(str, args) {
args = Array.prototype.slice.call(arguments, 1);
@@ -89,16 +117,25 @@ app.controller("queueCtrl", function($rootScope, $scope, $translate, $log, $http
};
$scope.load = function() {
+ if (!token) {
+ return;
+ }
+
$scope.jobs.loading = true;
- $http.get(webApplicationBaseURL + "rsc/jobqueue/de.urmel_dl.dbt.common.MailJob").then(function(result) {
+ $http.get(webApplicationBaseURL + "api/jobqueue/de.urmel_dl.dbt.common.MailJob", {
+ headers: {
+ "Authorization": "Bearer " + token
+ }
+ }).then(function(result) {
if (result.status === 200) {
$scope.jobs = result.data;
$scope.jobs.total = $scope.jobs.job.length;
$scope.jobs.limit = $scope.jobs.limit || 50;
$scope.jobs.start = 0;
}
- $scope.jobs.loading = false;
+
}, function(error) {
+ //here
$rootScope.$emit("alertEvent", "error", error);
$log.error(error);
$scope.jobs.loading = false;
@@ -218,6 +255,14 @@ app.controller("queueCtrl", function($rootScope, $scope, $translate, $log, $http
return m[1];
};
+
+
+
+
+ getToken(function() {
+ $scope.load();
+ });
+
$scope.showMailDialog = function(job) {
ModalService.showModal({
templateUrl : webApplicationBaseURL + "dbt/assets/templates/mail-dialog.html",
@@ -234,8 +279,6 @@ app.controller("queueCtrl", function($rootScope, $scope, $translate, $log, $http
});
});
};
-
- $scope.load();
});
app.controller("mailDialogCtrl", function($scope, $http, $log, $sce, parameters, close) {
@@ -286,4 +329,4 @@ app.controller("mailDialogCtrl", function($scope, $http, $log, $sce, parameters,
};
$scope.load();
-});
\ No newline at end of file
+});
diff --git a/src/main/resources/META-INF/resources/editor/editor-dbt.xed b/src/main/resources/META-INF/resources/editor/editor-dbt.xed
index c26a5212..35ae648d 100644
--- a/src/main/resources/META-INF/resources/editor/editor-dbt.xed
+++ b/src/main/resources/META-INF/resources/editor/editor-dbt.xed
@@ -102,6 +102,7 @@
+
diff --git a/src/main/resources/actionmappings.xml b/src/main/resources/actionmappings.xml
index 6acef462..21da4491 100644
--- a/src/main/resources/actionmappings.xml
+++ b/src/main/resources/actionmappings.xml
@@ -2,8 +2,8 @@
-
-
+
+
diff --git a/src/main/resources/config/dbt/mycore.properties b/src/main/resources/config/dbt/mycore.properties
index 845edb49..a9bbf4f3 100644
--- a/src/main/resources/config/dbt/mycore.properties
+++ b/src/main/resources/config/dbt/mycore.properties
@@ -38,8 +38,8 @@ MCR.PI.Service.Datacite=org.mycore.pi.doi.MCRDOIService
MCR.PI.Service.Datacite.Generator=MapObjectIDDOI
MCR.PI.Service.Datacite.MetadataService=MODSDOI
MCR.PI.Service.Datacite.RegistrationPredicate=org.mycore.pi.condition.MCRPIPublishedPredicate
-MCR.PI.Service.Datacite.Username=
-MCR.PI.Service.Datacite.Password=
+MCR.PI.Service.Datacite.Username=""
+MCR.PI.Service.Datacite.Password=""
MCR.PI.Service.Datacite.Transformer=datacite
MCR.PI.Service.Datacite.RegisterBaseURL=https://www.db-thueringen.de
MCR.PI.Service.Datacite.UseTestPrefix=true
@@ -58,12 +58,13 @@ MCR.PI.MetadataService.Uni-Weimar-MODSURN.Prefix=urn\:nbn\:de\:gbv\:wim2-
MCR.PI.Generator.Uni-Weimar-DOI=org.mycore.pi.doi.MCRMapObjectIDDOIGenerator
MCR.PI.Generator.Uni-Weimar-DOI.Prefix.dbt_mods=%MCR.PI.MetadataService.Uni-Weimar-MODSDOI.Prefix%/dbt.
+
MCR.PI.Service.Uni-Weimar-Datacite=org.mycore.pi.doi.MCRDOIService
MCR.PI.Service.Uni-Weimar-Datacite.MetadataService=Uni-Weimar-MODSDOI
MCR.PI.Service.Uni-Weimar-Datacite.Generator=Uni-Weimar-DOI
MCR.PI.Service.Uni-Weimar-Datacite.RegisterBaseURL=%MCR.PI.Service.Datacite.RegisterBaseURL%
-MCR.PI.Service.Uni-Weimar-Datacite.Username=
-MCR.PI.Service.Uni-Weimar-Datacite.Password=
+MCR.PI.Service.Uni-Weimar-Datacite.Username=""
+MCR.PI.Service.Uni-Weimar-Datacite.Password=""
MCR.PI.Service.Uni-Weimar-Datacite.UseTestServer=%MCR.PI.Service.Datacite.UseTestPrefix%
MCR.PI.Service.Uni-Weimar-Datacite.Transformer=datacite
MCR.PI.Service.Uni-Weimar-Datacite.JobApiUser=%MCR.PI.Service.Datacite.JobApiUser%
@@ -208,8 +209,7 @@ MCR.URIResolver.ModuleResolver.enum=de.urmel_dl.dbt.resolver.EnumResolver
# Configuration for Mailer Queue
######################################################################
-MCR.Startup.Class=%MCR.Startup.Class%,de.urmel_dl.dbt.common.MailJobThreadStarter,de.urmel_dl.dbt.migration.MailJobRenamer
-
+MCR.Startup.Class=%MCR.Startup.Class%,de.urmel_dl.dbt.migration.MailJobRenamer
MCR.QueuedJob.JobThreads=1
######################################################################
@@ -360,11 +360,12 @@ MCR.Access.Strategy.SubmittedCategory=%MCR.Access.Strategy.SubmittedCategory%,st
MCR.ContentTransformer.deepgreenjats2mods.Class=org.mycore.common.content.transformer.MCRXSLTransformer
MCR.ContentTransformer.deepgreenjats2mods.TransformerFactoryClass=net.sf.saxon.TransformerFactoryImpl
-MCR.ContentTransformer.deepgreenjats2mods.Stylesheet=xsl/sword/jats2mods.xsl
+MCR.ContentTransformer.deepgreenjats2mods.Stylesheet=xslt/sword/jats2mods.xsl
######################################################################
# MyCoRe / MIR overwrite
######################################################################
MCR.MODS.Import.Object.State=imported
-
+MCR.LayoutService.TransformerFactoryClass=org.apache.xalan.processor.TransformerFactoryImpl
+MCR.Layout.Transformer.Factory.XSLFolder=xsl
diff --git a/src/main/resources/xsl/layout/dbt-layout.xsl b/src/main/resources/xsl/layout/dbt-layout.xsl
index 137d40d6..4886a857 100644
--- a/src/main/resources/xsl/layout/dbt-layout.xsl
+++ b/src/main/resources/xsl/layout/dbt-layout.xsl
@@ -13,7 +13,7 @@
-
+
diff --git a/src/main/resources/xsl/rc/mail-queue.xsl b/src/main/resources/xsl/rc/mail-queue.xsl
index 24cfc2fc..fbc06e22 100644
--- a/src/main/resources/xsl/rc/mail-queue.xsl
+++ b/src/main/resources/xsl/rc/mail-queue.xsl
@@ -160,12 +160,11 @@
+
-
-
-
\ No newline at end of file
+
diff --git a/src/main/resources/xsl/repair/repair-institutions.xsl b/src/main/resources/xsl/repair/repair-institutions.xsl
index 3144c414..edb9bc3c 100644
--- a/src/main/resources/xsl/repair/repair-institutions.xsl
+++ b/src/main/resources/xsl/repair/repair-institutions.xsl
@@ -1,5 +1,5 @@
-
diff --git a/src/test/java/de/urmel_dl/dbt/opc/TestOPCConnector.java b/src/test/java/de/urmel_dl/dbt/opc/TestOPCConnector.java
index 1ad6d27e..91968491 100644
--- a/src/test/java/de/urmel_dl/dbt/opc/TestOPCConnector.java
+++ b/src/test/java/de/urmel_dl/dbt/opc/TestOPCConnector.java
@@ -109,7 +109,7 @@ public void testCatalogues() throws Exception {
public void testSetCatalog() throws Exception {
Catalog catalog = Catalogues.instance().getCatalogByISIL("DE-ILM1");
- OPCConnector opc = new OPCConnector(catalog.getOPC().getURL(), catalog.getOPC().getDB());
+ OPCConnector opc = new OPCConnector(catalog.getOPC().getURI(), catalog.getOPC().getDB());
Result result = opc.search("papula");
result.setCatalog(catalog);
diff --git a/src/test/resources/META-INF/persistence.xml b/src/test/resources/META-INF/persistence.xml
index 783f48c9..5e41ce86 100644
--- a/src/test/resources/META-INF/persistence.xml
+++ b/src/test/resources/META-INF/persistence.xml
@@ -1,20 +1,26 @@
-
+
META-INF/mycore-base-mappings.xml
META-INF/mycore-user2-mappings.xml
META-INF/mycore-pi-mappings.xml
META-INF/mir-module-mappings.xml
META-INF/mycore-acl-mappings.xml
+ META-INF/mycore-jobqueue-mappings.xml
-
-
-
-
+
+
+
+
+
+
diff --git a/src/test/resources/mycore.properties b/src/test/resources/mycore.properties
index fb2be8fb..5af59bbd 100644
--- a/src/test/resources/mycore.properties
+++ b/src/test/resources/mycore.properties
@@ -48,7 +48,7 @@ MCR.URIResolver.ModuleResolver.opc=de.urmel_dl.dbt.opc.resolver.OPCResolver
######################################################################
# EventHandler remove
######################################################################
-
+MCR.Layout.Transformer.Factory.XSLFolder=xsl
MCR.EventHandler.MCRObject.017.Class=
MCR.EventHandler.MCRDerivate.017.Class=
MCR.EventHandler.MCRObject.025.Class=